ea782cbd3e
This actually was pretty broken already. If you defined a new function in the ##create_function## string it would return that function but it wouldn't move it to the right unit so it can't execute. A big mess. For example:
$ cat a.php
<?php
$a = create_function('', 'function b() { return 3; }');
$a();
var_dump(b());
$ php a.php
HipHop Fatal error: Undefined function: b in /data/users/ptarjan/hphp/hphp/a.php on line 4
$ hhvm a.php
int(3)
7 linhas
122 B
PHP
7 linhas
122 B
PHP
<?php
|
|
|
|
$a = create_function('$x', 'return function($y) use ($x) { return $x * $y; };');
|
|
|
|
var_dump($a(2)->__invoke(4));
|
|
|
|
?>
|