mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

RFC: https://wiki.php.net/rfc/fcc_in_const_expr Co-authored-by: Volker Dusch <volker@tideways-gmbh.com>
26 lines
339 B
PHP
26 lines
339 B
PHP
--TEST--
|
|
FCC in property initializer
|
|
--FILE--
|
|
<?php
|
|
|
|
class C {
|
|
public Closure $d = strrev(...);
|
|
}
|
|
|
|
$c = new C();
|
|
var_dump($c->d);
|
|
var_dump(($c->d)("abc"));
|
|
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(Closure)#%d (2) {
|
|
["function"]=>
|
|
string(6) "strrev"
|
|
["parameter"]=>
|
|
array(1) {
|
|
["$string"]=>
|
|
string(10) "<required>"
|
|
}
|
|
}
|
|
string(3) "cba"
|