3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime(); $now->setTime(08,00); $punchIn = new DateTime(); // 10:55 am $punchIn->setTime(11,00); $hour = (int)$now->diff($punchIn)->format('%R%H'); $min = (int)$now->diff($punchIn)->format('%R%i'); print_r($hour\n); print_r($min\n); print_r($hour*60+$min); if ($hour*60+$min < 10) { print_r( 'punchIn'); }
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in 35Gqc on line 11
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected T_NS_SEPARATOR in /in/35Gqc on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_NS_SEPARATOR in 35Gqc on line 11
Process exited with code 255.

preferences:
175.28 ms | 1395 KiB | 49 Q