3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Stringable { public function __toString() {die ('hi'); return "A"; } } //var_dump(preg_replace('#A#si','B',$x=new Stringable())); $a=new SplFixedArray(3); $a[]='A'; echo(serialize($a));
based on oD5Ll
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught RuntimeException: Index invalid or out of range in /in/lD5B9:12 Stack trace: #0 {main} thrown in /in/lD5B9 on line 12
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Uncaught exception 'RuntimeException' with message 'Index invalid or out of range' in /in/lD5B9:12 Stack trace: #0 /in/lD5B9(12): unknown() #1 {main} thrown in /in/lD5B9 on line 12
Process exited with code 255.