mirror of
https://github.com/php/php-src.git
synced 2024-12-12 11:23:53 +08:00
def1ab1e60
- Fixed bug #54039 (use() of static variables in lambda functions can break staticness)
40 lines
599 B
PHP
40 lines
599 B
PHP
--TEST--
|
|
Bug #54358 (Closure, use and reference)
|
|
--FILE--
|
|
<?php
|
|
class asserter {
|
|
public function call($function) {
|
|
}
|
|
}
|
|
|
|
$asserter = new asserter();
|
|
|
|
$closure = function() use ($asserter, &$function) {
|
|
$asserter->call($function = 'md5');
|
|
};
|
|
|
|
$closure();
|
|
|
|
var_dump($function);
|
|
|
|
$closure = function() use ($asserter, $function) {
|
|
$asserter->call($function);
|
|
};
|
|
|
|
$closure();
|
|
|
|
var_dump($function);
|
|
|
|
$closure = function() use ($asserter, $function) {
|
|
$asserter->call($function);
|
|
};
|
|
|
|
$closure();
|
|
|
|
var_dump($function);
|
|
?>
|
|
--EXPECT--
|
|
string(3) "md5"
|
|
string(3) "md5"
|
|
string(3) "md5"
|