PHP 8.5.0 Alpha 4 available for testing

Voting

: max(zero, eight)?
(Example: nine)

The Note You're Voting On

Hoffmann dot P-no-sp at m-gmx dot net
8 years ago
You can use function variables (jay!)

So the following works:

$add = function ($a, $b) {
return $a + $b;
};
$v8 = new V8Js('PHP', array('add' => 'add'));
$result = $v8->executeString('PHP.add(1,2)');
var_dump($result);

yields indeed:
int(3)

<< Back to user notes page

To Top