3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = function() { return 1; }; echo serialize($a);
based on vd5t6
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in /in/860KJ:7 Stack trace: #0 /in/860KJ(7): serialize(Object(Closure)) #1 {main} thrown in /in/860KJ on line 7
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in /in/860KJ:7 Stack trace: #0 /in/860KJ(7): serialize(Object(Closure)) #1 {main} thrown in /in/860KJ on line 7
Process exited with code 255.