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 SplStorageObject(); $a[1]=new Stringable(); echo(serialize($a));
based on 7Idbm
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'SplStorageObject' not found in /in/JGmQp:11 Stack trace: #0 {main} thrown in /in/JGmQp on line 11
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Class 'SplStorageObject' not found in /in/JGmQp on line 11
Process exited with code 255.