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 day')]=7; echo(serialize($a));
based on eUBvi
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (1 day) in /in/epSLn:12 Stack trace: #0 /in/epSLn(12): DateInterval->__construct('1 day') #1 {main} thrown in /in/epSLn 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 day)' in /in/epSLn:12 Stack trace: #0 /in/epSLn(12): DateInterval->__construct('1 day') #1 {main} thrown in /in/epSLn on line 12
Process exited with code 255.