3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $dateStart = date_create('2014-07-29'); $dateToday = date_create('2014-07-30'); $startDiff = date_diff( $dateToday , $dateStart); var_dump( $startDiff->days ); var_dump( $startDiff->format('%h') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PDXQF
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dateStart, !1 = $dateToday, !2 = $startDiff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'UTC'
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'date_create'
          4        SEND_VAL                                                 '2014-07-29'
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
    6     7        INIT_FCALL                                               'date_create'
          8        SEND_VAL                                                 '2014-07-30'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    7    11        INIT_FCALL                                               'date_diff'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !2, $8
    9    16        INIT_FCALL                                               'var_dump'
         17        FETCH_OBJ_R                                      ~10     !2, 'days'
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                                 
   10    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !2, 'format'
         22        SEND_VAL_EX                                              '%25h'
         23        DO_FCALL                                      0  $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.95 ms | 1395 KiB | 21 Q