3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dias_transcurridos($fecha_i,$fecha_f) { $formato="Y-m-d"; //DateTime($fecha_i); //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-01");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PMLCK
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-01'
          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/PMLCK
function name:  dias_transcurridos
number of ops:  20
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'
    7     3        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !3, $7
    8     8        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !4, $9
    9    13        INIT_METHOD_CALL                                         !3, 'diff'
         14        SEND_VAR_EX                                              !4
         15        DO_FCALL                                      0  $11     
         16        ASSIGN                                                   !5, $11
   10    17        FETCH_OBJ_R                                      ~13     !5, 'days'
         18        ECHO                                                     ~13
   12    19      > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.06 ms | 1398 KiB | 14 Q