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->day; }; 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/pejfE
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/pejfE
function name:  dias_transcurridos
number of ops:  23
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        INIT_FCALL_BY_NAME                                       'DateTime'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
    7     6        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !3, $8
    8    11        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !1
         14        DO_FCALL                                      0  $10     
         15        ASSIGN                                                   !4, $10
    9    16        INIT_METHOD_CALL                                         !3, 'diff'
         17        SEND_VAR_EX                                              !4
         18        DO_FCALL                                      0  $12     
         19        ASSIGN                                                   !5, $12
   10    20        FETCH_OBJ_R                                      ~14     !5, 'day'
         21        ECHO                                                     ~14
   12    22      > RETURN                                                   null

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157 ms | 1403 KiB | 14 Q