3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2009-10-11'); $end = new DateTime('2010-12-23'); $diff = $end->diff($start); $months = ($diff->y * 12) + $diff->m; $rollup = 0; var_dump("months: $months"); while ($months-- > 0) { echo "rollup: $rollup".PHP_EOL; $rollup += $rollup ?: 500; } var_dump("result: $rollup");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 24
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 24
Branch analysis from position: 34
Branch analysis from position: 24
filename:       /in/51XMD
function name:  (null)
number of ops:  40
compiled vars:  !0 = $start, !1 = $end, !2 = $diff, !3 = $months, !4 = $rollup
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DateTime'
          1        SEND_VAL_EX                                              '2009-10-11'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        NEW                                              $8      'DateTime'
          5        SEND_VAL_EX                                              '2010-12-23'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    6     8        INIT_METHOD_CALL                                         !1, 'diff'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $11     
         11        ASSIGN                                                   !2, $11
    8    12        FETCH_OBJ_R                                      ~13     !2, 'y'
         13        MUL                                              ~14     ~13, 12
         14        FETCH_OBJ_R                                      ~15     !2, 'm'
         15        ADD                                              ~16     ~14, ~15
         16        ASSIGN                                                   !3, ~16
    9    17        ASSIGN                                                   !4, 0
   11    18        INIT_FCALL                                               'var_dump'
         19        NOP                                                      
         20        FAST_CONCAT                                      ~19     'months%3A+', !3
         21        SEND_VAL                                                 ~19
         22        DO_ICALL                                                 
   13    23      > JMP                                                      ->31
   14    24    >   NOP                                                      
         25        FAST_CONCAT                                      ~21     'rollup%3A+', !4
         26        CONCAT                                           ~22     ~21, '%0A'
         27        ECHO                                                     ~22
   15    28        JMP_SET                                          ~23     !4, ->30
         29        QM_ASSIGN                                        ~23     500
         30        ASSIGN_OP                                     1          !4, ~23
   13    31    >   POST_DEC                                         ~25     !3
         32        IS_SMALLER                                               0, ~25
         33      > JMPNZ                                                    ~26, ->24
   18    34    >   INIT_FCALL                                               'var_dump'
         35        NOP                                                      
         36        FAST_CONCAT                                      ~27     'result%3A+', !4
         37        SEND_VAL                                                 ~27
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.02 ms | 1072 KiB | 14 Q