3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $interval = new \DateInterval('P10M'); var_dump(property_exists($interval, 'm')); var_dump($interval); var_dump(property_exists($interval, 'm')); echo '¯\_(ツ)_/¯' . PHP_EOL;
Output for 7.1.0 - 7.2.0
bool(true) object(DateInterval)#1 (16) { ["y"]=> int(0) ["m"]=> int(10) ["d"]=> int(0) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> bool(false) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } bool(true) ¯\_(ツ)_/¯
Output for 7.0.20
bool(true) object(DateInterval)#1 (15) { ["y"]=> int(0) ["m"]=> int(10) ["d"]=> int(0) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> bool(false) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } bool(true) ¯\_(ツ)_/¯
Output for 5.5.0 - 7.0.10
bool(false) object(DateInterval)#1 (15) { ["y"]=> int(0) ["m"]=> int(10) ["d"]=> int(0) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["weekday"]=> int(0) ["weekday_behavior"]=> int(0) ["first_last_day_of"]=> int(0) ["invert"]=> int(0) ["days"]=> bool(false) ["special_type"]=> int(0) ["special_amount"]=> int(0) ["have_weekday_relative"]=> int(0) ["have_special_relative"]=> int(0) } bool(true) ¯\_(ツ)_/¯