3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (24*60*60*60 < $diff) { // 60 days echo 'week'; } elseif (24*60*60 < $diff) { // 24 hours echo 'day'; } elseif (60*60 < $diff) { // 60 minutes echo 'hour'; } elseif (2*60 < $diff) { // 2 minutes echo 'minute'; } echo 'second';
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: diff in /in/9cqOX on line 2 Notice: Undefined variable: diff in /in/9cqOX on line 4 Notice: Undefined variable: diff in /in/9cqOX on line 6 Notice: Undefined variable: diff in /in/9cqOX on line 8 second
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: diff in /in/9cqOX on line 2 Notice: Undefined variable: diff in /in/9cqOX on line 4 Notice: Undefined variable: diff in /in/9cqOX on line 6 Notice: Undefined variable: diff in /in/9cqOX on line 8 second