3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i = new ArrayIterator(array(1)); try { $i->seek(-1); } catch (Exception $e) { var_dump($e); }
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
object(OutOfBoundsException)#2 (7) { ["message":protected]=> string(32) "Seek position -1 is out of range" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/r5PEH" ["line":protected]=> int(6) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/r5PEH" ["line"]=> int(6) ["function"]=> string(4) "seek" ["class"]=> string(13) "ArrayIterator" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> int(-1) } } } ["previous":"Exception":private]=> NULL }
Output for 5.1.0 - 5.2.17
object(OutOfBoundsException)#2 (6) { ["message:protected"]=> string(32) "Seek position -1 is out of range" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/r5PEH" ["line:protected"]=> int(6) ["trace:private"]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/r5PEH" ["line"]=> int(6) ["function"]=> string(4) "seek" ["class"]=> string(13) "ArrayIterator" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> int(-1) } } } }
Output for 5.0.4 - 5.0.5
object(Exception)#2 (6) { ["message:protected"]=> string(32) "Seek position -1 is out of range" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(9) "/in/r5PEH" ["line:protected"]=> int(6) ["trace:private"]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/r5PEH" ["line"]=> int(6) ["function"]=> string(4) "seek" ["class"]=> string(13) "ArrayIterator" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> int(-1) } } } }
Output for 5.0.0 - 5.0.3
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/r5PEH on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/r5PEH on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/r5PEH on line 5
Process exited with code 255.