3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=15; $b=17; $c=0; function test () { $GLOBALS['c']=$GLOBALS['a']+$GLOBALS['b']; } test (); echo $c; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GJh5D
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 15
    3     1        ASSIGN                                                   !1, 17
    4     2        ASSIGN                                                   !2, 0
   10     3        INIT_FCALL                                               'test'
          4        DO_FCALL                                      0          
   11     5        ECHO                                                     !2
   12     6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GJh5D
function name:  test
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_R                      global              ~2      'GLOBALS'
          1        FETCH_DIM_R                                      ~3      ~2, 'a'
          2        FETCH_R                      global              ~4      'GLOBALS'
          3        FETCH_DIM_R                                      ~5      ~4, 'b'
          4        ADD                                              ~6      ~3, ~5
          5        FETCH_W                      global              $0      'GLOBALS'
          6        ASSIGN_DIM                                               $0, 'c'
          7        OP_DATA                                                  ~6
    9     8      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.02 ms | 1397 KiB | 14 Q