3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=15; $b=17; function test () { global $a, $b; $c=$a+$b; } test (); echo $c; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vac4
function name:  (null)
number of ops:  6
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
    9     2        INIT_FCALL                                               'test'
          3        DO_FCALL                                      0          
   10     4        ECHO                                                     !2
   11     5      > RETURN                                                   1

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.3 ms | 1397 KiB | 14 Q