3v4l.org

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

Function datecompare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKTWa
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:
156.28 ms | 1397 KiB | 17 Q