3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(getHourFormatForTimingGraph("0")); var_dump(getHourFormatForTimingGraph("3")); var_dump(getHourFormatForTimingGraph("12")); var_dump(getHourFormatForTimingGraph("20")); function getHourFormatForTimingGraph($str) { $dt = DateTime.createFromFormat('G',$str); return $dt; }
based on 56e6O
Output for 7.2.0
Warning: Use of undefined constant DateTime - assumed 'DateTime' (this will throw an Error in a future version of PHP) in /in/knSrS on line 9 Fatal error: Uncaught Error: Call to undefined function createFromFormat() in /in/knSrS:9 Stack trace: #0 /in/knSrS(2): getHourFormatForTimingGraph('0') #1 {main} thrown in /in/knSrS on line 9
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/knSrS on line 9 Fatal error: Uncaught Error: Call to undefined function createFromFormat() in /in/knSrS:9 Stack trace: #0 /in/knSrS(2): getHourFormatForTimingGraph('0') #1 {main} thrown in /in/knSrS on line 9
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Notice: Use of undefined constant DateTime - assumed 'DateTime' in /in/knSrS on line 9 Fatal error: Call to undefined function createFromFormat() in /in/knSrS on line 9
Process exited with code 255.