To be able to serialize/unserialize closures

Posted by PHPVote 5 years ago

- Can send execution over a wire (MQ, Web Service..) ```php $a = function(){}; ExternalService::send(serialize($a)); ``` - Can Identify duplicate closures. (Allowing you to refuse re-execution or return a response from a previous execution) ```php $a = function(){}; $b = function(){}; var_dump(serialize($a) === serialize($b)) // true ``` - Not have to scan php files and parse the closure as a string and then eval to hydrate back to a Closure to achieve the above
grikdotnet ยท 8 months ago