mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
3b08f53c97
As an exception, we allow "Type $foo = null" to occur before a required parameter, because this pattern was used as a replacement for nullable types in PHP versions older than 7.1. Closes GH-5067.
36 lines
638 B
PHP
36 lines
638 B
PHP
--TEST--
|
|
Passing Closure as parameter to an non-existent function
|
|
--FILE--
|
|
<?php
|
|
|
|
class foo {
|
|
public static function __callstatic($x, $y) {
|
|
var_dump($x,$y);
|
|
return 1;
|
|
}
|
|
|
|
public static function teste() {
|
|
return foo::x(function &($a=1,$b) { });
|
|
}
|
|
}
|
|
|
|
var_dump(call_user_func(array('foo', 'teste')));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: Required parameter $b follows optional parameter $a in %s on line %d
|
|
string(1) "x"
|
|
array(1) {
|
|
[0]=>
|
|
object(Closure)#%d (1) {
|
|
["parameter"]=>
|
|
array(2) {
|
|
["$a"]=>
|
|
string(10) "<required>"
|
|
["$b"]=>
|
|
string(10) "<required>"
|
|
}
|
|
}
|
|
}
|
|
int(1)
|