3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = new \DateInterval('P1M'); $fooz = []; var_dump($foo->__set_state($fooz)); var_dump($fooz);
based on 504tn
Output for 7.1.0 - 7.3.0rc3
object(DateInterval)#2 (16) { ["y"]=> int(-1) ["m"]=> int(-1) ["d"]=> int(-1) ["h"]=> int(-1) ["i"]=> int(-1) ["s"]=> int(-1) ["f"]=> float(-1) ["weekday"]=> int(-1) ["weekday_behavior"]=> int(-1) ["first_last_day_of"]=> int(-1) ["invert"]=> int(0) ["days"]=> int(-1) ["special_type"]=> int(0) ["special_amount"]=> int(-1) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } array(0) { }
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
object(DateInterval)#2 (15) { ["y"]=> int(-1) ["m"]=> int(-1) ["d"]=> int(-1) ["h"]=> int(-1) ["i"]=> int(-1) ["s"]=> int(-1) ["weekday"]=> int(-1) ["weekday_behavior"]=> int(-1) ["first_last_day_of"]=> int(-1) ["invert"]=> int(0) ["days"]=> int(-1) ["special_type"]=> int(0) ["special_amount"]=> int(-1) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } array(0) { }
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Call to undefined method DateInterval::__set_state() in /in/DlBa0:7 Stack trace: #0 {main}
Process exited with code 255.