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()]=7; echo(serialize($a));
based on B4LRT
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: DateInterval::__construct() expects exactly 1 parameter, 0 given in /in/WEetg:12 Stack trace: #0 /in/WEetg(12): DateInterval->__construct() #1 {main} thrown in /in/WEetg on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Uncaught TypeError: DateInterval::__construct() expects exactly 1 parameter, 0 given in /in/WEetg:12 Stack trace: #0 /in/WEetg(12): DateInterval->__construct() #1 {main} thrown in /in/WEetg 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() expects exactly 1 parameter, 0 given' in /in/WEetg:12 Stack trace: #0 /in/WEetg(12): DateInterval->__construct() #1 {main} thrown in /in/WEetg on line 12
Process exited with code 255.