3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Stringable { public function __toString() { return "A"; } } //var_dump(preg_replace('#A#si','B',$x=new Stringable())); $a=new SplObjectStorage(); $a[new DateInterval(1)]=7; echo(serialize($a));
based on WEetg
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (1) in /in/GleJp:12 Stack trace: #0 /in/GleJp(12): DateInterval->__construct('1') #1 {main} thrown in /in/GleJp on line 12
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (1)' in /in/GleJp:12 Stack trace: #0 /in/GleJp(12): DateInterval->__construct('1') #1 {main} thrown in /in/GleJp on line 12
Process exited with code 255.