3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/Los_Angeles'); $firstOctober = new \DateTime('2016-10-01 00:00:00'); $endOctober = new \DateTime('2016-10-31 00:00:00'); var_dump( $firstOctober->diff($endOctober)->m ); date_default_timezone_set('Europe/Paris'); $firstOctober = new \DateTime('2016-10-01 00:00:00'); $endOctober = new \DateTime('2016-10-31 00:00:00'); var_dump( $firstOctober->diff($endOctober)->m );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eFkJd
function name:  (null)
number of ops:  37
compiled vars:  !0 = $firstOctober, !1 = $endOctober
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'America%2FLos_Angeles'
          2        DO_ICALL                                                 
    5     3        NEW                                              $3      'DateTime'
          4        SEND_VAL_EX                                              '2016-10-01+00%3A00%3A00'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
    6     7        NEW                                              $6      'DateTime'
          8        SEND_VAL_EX                                              '2016-10-31+00%3A00%3A00'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $6
    9    11        INIT_FCALL                                               'var_dump'
   10    12        INIT_METHOD_CALL                                         !0, 'diff'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $9      
         15        FETCH_OBJ_R                                      ~10     $9, 'm'
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
   12    18        INIT_FCALL                                               'date_default_timezone_set'
         19        SEND_VAL                                                 'Europe%2FParis'
         20        DO_ICALL                                                 
   14    21        NEW                                              $13     'DateTime'
         22        SEND_VAL_EX                                              '2016-10-01+00%3A00%3A00'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !0, $13
   15    25        NEW                                              $16     'DateTime'
         26        SEND_VAL_EX                                              '2016-10-31+00%3A00%3A00'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !1, $16
   18    29        INIT_FCALL                                               'var_dump'
   19    30        INIT_METHOD_CALL                                         !0, 'diff'
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0  $19     
         33        FETCH_OBJ_R                                      ~20     $19, 'm'
         34        SEND_VAL                                                 ~20
         35        DO_ICALL                                                 
   20    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.78 ms | 1396 KiB | 17 Q