3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dias_transcurridos($fecha_i,$fecha_f) { $formato="Y-m-d"; $f1=new DateTime($fecha_i); $f2=new DateTime($fecha_f); //echo DateTime::createFromFormat($formato,$fecha_i); //$f1=DateTime::createFromFormat($formato,$fecha_i); //$f2=DateTime::createFromFormat($formato,$fecha_f); $diff = $f1->diff($f2); echo $diff->days; }; 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/WI53D
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     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/WI53D
function name:  dias_transcurridos
number of ops:  18
compiled vars:  !0 = $fecha_i, !1 = $fecha_f, !2 = $formato, !3 = $f1, !4 = $f2, !5 = $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'
    5     3        NEW                                              $7      'DateTime'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $7
    6     7        NEW                                              $10     'DateTime'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !4, $10
   10    11        INIT_METHOD_CALL                                         !3, 'diff'
         12        SEND_VAR_EX                                              !4
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !5, $13
   11    15        FETCH_OBJ_R                                      ~15     !5, 'days'
         16        ECHO                                                     ~15
   13    17      > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.61 ms | 1397 KiB | 14 Q