3v4l.org

run code in 300+ PHP versions simultaneously
<?php function diff($diff) { if (5184000 < $diff) { // = 24*60*60*60 = 60 days return 'week'; } elseif (86400 < $diff) { // = 24*60*60 = 24 hours return 'day'; } elseif (3600 < $diff) { // = 60*60 = 60 minutes return 'hour'; } elseif (120 < $diff) { // = 2*60 = 2 minutes return 'minute'; } else { return 'second'; } } echo diff(1393887600-1393844400);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9hZMj
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'diff'
          1        SEND_VAL                                                 43200
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function diff:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9hZMj
function name:  diff
number of ops:  19
compiled vars:  !0 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_SMALLER                                               5184000, !0
          2      > JMPZ                                                     ~1, ->5
    5     3    > > RETURN                                                   'week'
          4*       JMP                                                      ->18
    6     5    >   IS_SMALLER                                               86400, !0
          6      > JMPZ                                                     ~2, ->9
    7     7    > > RETURN                                                   'day'
          8*       JMP                                                      ->18
    8     9    >   IS_SMALLER                                               3600, !0
         10      > JMPZ                                                     ~3, ->13
    9    11    > > RETURN                                                   'hour'
         12*       JMP                                                      ->18
   10    13    >   IS_SMALLER                                               120, !0
         14      > JMPZ                                                     ~4, ->17
   11    15    > > RETURN                                                   'minute'
         16*       JMP                                                      ->18
   13    17    > > RETURN                                                   'second'
   15    18*     > RETURN                                                   null

End of function diff

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.1 ms | 1399 KiB | 14 Q