3v4l.org

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

End of function dias_transcurridos

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.77 ms | 1399 KiB | 18 Q