3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start_time = "2017-03-20 16:30:00"; $start_mid_night = date_create_from_format("Y-m-d",explode(" ",$start_time)[0]); var_dump($start_mid_night,explode($start_time," ")[0]); $end_time = "2017-03-22 16:00:00"; $diff = strtotime(str_replace('-','/',$end_time)) - strtotime(str_replace('-','/',$start_time)); print_r( ceil(($diff)/(24*60*60)) ); echo PHP_EOL; print_r( (($diff)/(24*60*60)) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PUOdG
function name:  (null)
number of ops:  52
compiled vars:  !0 = $start_time, !1 = $start_mid_night, !2 = $end_time, !3 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2017-03-20+16%3A30%3A00'
    5     1        INIT_FCALL                                               'date_create_from_format'
          2        SEND_VAL                                                 'Y-m-d'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        FETCH_DIM_R                                      ~6      $5, 0
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    6    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        INIT_FCALL                                               'explode'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '+'
         16        DO_ICALL                                         $9      
         17        FETCH_DIM_R                                      ~10     $9, 0
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                                 
    8    20        ASSIGN                                                   !2, '2017-03-22+16%3A00%3A00'
   10    21        INIT_FCALL                                               'strtotime'
         22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 '-'
         24        SEND_VAL                                                 '%2F'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        INIT_FCALL                                               'strtotime'
         30        INIT_FCALL                                               'str_replace'
         31        SEND_VAL                                                 '-'
         32        SEND_VAL                                                 '%2F'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $15     
         35        SEND_VAR                                                 $15
         36        DO_ICALL                                         $16     
         37        SUB                                              ~17     $14, $16
         38        ASSIGN                                                   !3, ~17
   12    39        INIT_FCALL                                               'print_r'
         40        INIT_FCALL                                               'ceil'
         41        DIV                                              ~19     !3, 86400
         42        SEND_VAL                                                 ~19
         43        DO_ICALL                                         $20     
         44        SEND_VAR                                                 $20
         45        DO_ICALL                                                 
   13    46        ECHO                                                     '%0A'
   14    47        INIT_FCALL                                               'print_r'
         48        DIV                                              ~22     !3, 86400
         49        SEND_VAL                                                 ~22
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.95 ms | 1400 KiB | 27 Q