3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dias_transcurridos($fecha_i,$fecha_f) { $formato="d-m-Y"; $dias = (DateTime::createFromFormat($formato,$fecha_i)-DateTime::createFromFormat($formato,$fecha_f))/86400; $dias = abs($dias); $dias = floor($dias); return $dias; }; echo dias_transcurridos(" 2014-06-01"," 2014-06-02");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H7pmv
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'dias_transcurridos'
          1        SEND_VAL                                                 '+2014-06-01'
          2        SEND_VAL                                                 '+2014-06-02'
          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/H7pmv
function name:  dias_transcurridos
number of ops:  24
compiled vars:  !0 = $fecha_i, !1 = $fecha_f, !2 = $formato, !3 = $dias
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_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $5      
          7        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !1
         10        DO_FCALL                                      0  $6      
         11        SUB                                              ~7      $5, $6
         12        DIV                                              ~8      ~7, 86400
         13        ASSIGN                                                   !3, ~8
         14        INIT_FCALL                                               'abs'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
         18        INIT_FCALL                                               'floor'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !3, $12
         22      > RETURN                                                   !3
    7    23*     > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.8 ms | 1390 KiB | 18 Q