3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dias_transcurridos($fecha_i,$fecha_f) { $formato="Y-m-d"; //echo DateTime::createFromFormat($formato,$fecha_i); $diff = abs(DateTime::createFromFormat($formato,$fecha_i)-DateTime::createFromFormat($formato,$fecha_f)); echo $diff; echo floor($diff/(60*60*24)); return $diff; }; echo dias_transcurridos("2014-06-01","2014-06-03");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MpoBf
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'dias_transcurridos'
          1        SEND_VAL                                                 '2014-06-01'
          2        SEND_VAL                                                 '2014-06-03'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function dias_transcurridos:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MpoBf
function name:  dias_transcurridos
number of ops:  24
compiled vars:  !0 = $fecha_i, !1 = $fecha_f, !2 = $formato, !3 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, 'Y-m-d'
    7     3        INIT_FCALL                                               'abs'
          4        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $5      
          8        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $6      
         12        SUB                                              ~7      $5, $6
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !3, $8
    8    16        ECHO                                                     !3
    9    17        INIT_FCALL                                               'floor'
         18        DIV                                              ~10     !3, 86400
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                         $11     
         21        ECHO                                                     $11
   10    22      > RETURN                                                   !3
   12    23*     > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.57 ms | 1398 KiB | 18 Q