3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTime($time) { list($hours, $minutes, $seconds) = explode(':', $time); echo $minutes . ': ' . 60 - ((int) floor((60-$minutes) / 10) * 10) . "\n"; } getTime('12:34:00'); getTime('12:19:00'); getTime('12:01:00'); getTime('12:46:00'); getTime('12:58:00');
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
34: 40 19: 20 01: 10 46: 50 58: 60
Output for 7.4.0 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/HlPLv on line 7 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 14 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 -21 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 -49 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 36 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 58
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.3.32 - 7.3.33
14 -21 -49 36 58
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 14 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 -21 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 -49 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 36 Notice: A non well formed numeric value encountered in /in/HlPLv on line 7 58

preferences:
189.03 ms | 403 KiB | 227 Q