mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
064b464448
RFC: https://wiki.php.net/rfc/constructor_promotion Closes GH-5291.
13 lines
283 B
PHP
13 lines
283 B
PHP
--TEST--
|
|
Constructor promotion with null default, requires an explicitly nullable type
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
public function __construct(public int $x = null) {}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use null as default value for parameter $x of type int in %s on line %d
|