3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateDiff($start, $end) { $start = strtotime($start); $end = strtotime($end); $diff = $end - $start; return round($diff / 86400); } echo dateDiff("2010-01-30", date('Y-m-d')).' d.' ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ud2GA
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'datediff'
          1        SEND_VAL                                                 '2010-01-30'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'Y-m-d'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $1      
          7        CONCAT                                           ~2      $1, '+d.'
          8        ECHO                                                     ~2
          9      > RETURN                                                   1

Function datediff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ud2GA
function name:  dateDiff
number of ops:  18
compiled vars:  !0 = $start, !1 = $end, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        INIT_FCALL                                               'strtotime'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    4     6        INIT_FCALL                                               'strtotime'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    5    10        SUB                                              ~7      !1, !0
         11        ASSIGN                                                   !2, ~7
    6    12        INIT_FCALL                                               'round'
         13        DIV                                              ~9      !2, 86400
         14        SEND_VAL                                                 ~9
         15        DO_ICALL                                         $10     
         16      > RETURN                                                   $10
    7    17*     > RETURN                                                   null

End of function datediff

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.05 ms | 1399 KiB | 20 Q