3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fileDate = DateTime::createFromFormat("Ymd", "19350320"); $now = new DateTime("now"); echo $fileDate->format("Ymd").' '; echo $now->format("Ymd").' '; $diff1 = $now->diff($fileDate, true); echo $diff1->$y; ?>
based on JOb9L
Output for 7.1.0 - 7.2.0
19350320 20151130 Notice: Undefined variable: y in /in/QuaLb on line 8 Notice: Undefined property: DateInterval::$ in /in/QuaLb on line 8
Output for 7.0.0 - 7.0.20
19350320 20151130 Notice: Undefined variable: y in /in/QuaLb on line 8 Fatal error: Uncaught Error: Cannot access empty property in /in/QuaLb:8 Stack trace: #0 {main} thrown in /in/QuaLb on line 8
Process exited with code 255.
Output for 5.5.0 - 5.6.28
19350320 20151130 Notice: Undefined variable: y in /in/QuaLb on line 8 Fatal error: Cannot access empty property in /in/QuaLb on line 8
Process exited with code 255.