23b681e872
In HPHPc it didn't allow closures to be cloned but in HHVM it did. When I migrated to a C++ closure then i left the HPHPc code. Zend 5.4 allows them to be cloned so lets go with this.
7 linhas
85 B
PHP
7 linhas
85 B
PHP
<?php
|
|
|
|
$a = function() { return 1; };
|
|
$b = clone $a;
|
|
var_dump($a());
|
|
var_dump($b());
|