3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateCompare($a, $b) { $t1 = strtotime($a); $t2 = strtotime($b); return $t1 - $t2; } var_dump( dateCompare('2013-12-02', '2013-12-06')); var_dump( dateCompare('2013-12-06', '2013-12-02')/(60*60*24)); var_dump( 60*60*24);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L0s4X
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'datecompare'
          2        SEND_VAL                                                 '2013-12-02'
          3        SEND_VAL                                                 '2013-12-06'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'datecompare'
          9        SEND_VAL                                                 '2013-12-06'
         10        SEND_VAL                                                 '2013-12-02'
         11        DO_FCALL                                      0  $2      
         12        DIV                                              ~3      $2, 86400
         13        SEND_VAL                                                 ~3
         14        DO_ICALL                                                 
   10    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAL                                                 86400
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function datecompare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L0s4X
function name:  dateCompare
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $t1, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !2, $4
    5     6        INIT_FCALL                                               'strtotime'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !3, $6
    6    10        SUB                                              ~8      !2, !3
         11      > RETURN                                                   ~8
    7    12*     > RETURN                                                   null

End of function datecompare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.33 ms | 1399 KiB | 19 Q