3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = function() { echo "hi"; }; $y = serialize( $x );
Output for 7.0.0 - 7.3.1
Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in /in/1f86o:5 Stack trace: #0 /in/1f86o(5): serialize(Object(Closure)) #1 {main} thrown in /in/1f86o on line 5
Process exited with code 255.
Output for hhvm-3.17.3
Warning: Attempted to serialize unserializable builtin class Closure$;2 in /in/1f86o on line 5
Output for hhvm-3.15.4
Warning: Attempted to serialize unserializable builtin class Closure$;1135901751$b28a8294d3bb194edf08ad8cf311e5ce$ in /in/1f86o on line 5
Output for hhvm-3.12.14 - 3.13.2
Warning: Attempted to serialize unserializable builtin class Closure$;1135901751$99633947b3f52f4bfa14b2cce3127dca$ in /in/1f86o on line 5
Output for hhvm-3.11.1
Warning: Attempted to serialize unserializable builtin class Closure$;1135901751$32ec0180d7263dd3cb1c0f6193eff727$ in /in/1f86o on line 5
Output for hhvm-3.10.1
Warning: Attempted to serialize unserializable builtin class Closure$;1135901751$ccb675d014d8cb9319f32b33b508ac0d$ in /in/1f86o on line 5
Output for 5.4.0 - 5.6.30
Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in /in/1f86o:5 Stack trace: #0 /in/1f86o(5): serialize(Object(Closure)) #1 {main} thrown in /in/1f86o on line 5
Process exited with code 255.