3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { public $throw_exception = false; function __sleep() { } function __construct() { echo "construct called\n"; if ($this->throw_exception == true) { throw new Exception(); } else { $this->throw->exception=true; } } } $a = new foo; $x = serialize($a); $y = unserialize($a);
Output for 5.4.0 - 7.1.0
construct called Warning: Creating default object from empty value in /in/hEh4f on line 15 Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in /in/hEh4f on line 21 Warning: unserialize() expects parameter 1 to be string, object given in /in/hEh4f on line 22
Output for 5.2.5 - 5.3.29
construct called Strict Standards: Creating default object from empty value in /in/hEh4f on line 15 Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in /in/hEh4f on line 21 Warning: unserialize() expects parameter 1 to be string, object given in /in/hEh4f on line 22
Output for 5.2.0 - 5.2.4
construct called Strict Standards: Creating default object from empty value in /in/hEh4f on line 15 Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize. in /in/hEh4f on line 21 Warning: unserialize() expects parameter 1 to be string, object given in /in/hEh4f on line 22
Output for 5.0.3 - 5.1.6
construct called Strict Standards: Creating default object from empty value in /in/hEh4f on line 15 Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize. in /in/hEh4f on line 21 Notice: unserialize(): Argument is not a string in /in/hEh4f on line 22
Output for 5.0.0 - 5.0.2
construct called Strict Standards: Creating default object from empty value in /in/hEh4f on line 15 Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize. in /in/hEh4f on line 21 Notice: unserialize(): Argument is not an string in /in/hEh4f on line 22
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/hEh4f on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/hEh4f on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/hEh4f on line 4
Process exited with code 255.