3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dias_transcurridos($fecha_i,$fecha_f) { $formato="d-m-Y"; $diff = abs(DateTime::createFromFormat($formato,$fecha_i)-DateTime::createFromFormat($formato,$fecha_f)); echo $dif; echo floor($datediff/(60*60*24)); return $dif; }; 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/49Len
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     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/49Len
function name:  dias_transcurridos
number of ops:  24
compiled vars:  !0 = $fecha_i, !1 = $fecha_f, !2 = $formato, !3 = $diff, !4 = $dif, !5 = $datediff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, 'd-m-Y'
    6     3        INIT_FCALL                                               'abs'
          4        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $7      
          8        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $8      
         12        SUB                                              ~9      $7, $8
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !3, $10
    7    16        ECHO                                                     !4
    8    17        INIT_FCALL                                               'floor'
         18        DIV                                              ~12     !5, 86400
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        ECHO                                                     $13
    9    22      > RETURN                                                   !4
   11    23*     > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.06 ms | 1398 KiB | 18 Q