3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=5; // global scope function myTest() { $y=10; // local scope echo "<p>Test variables inside the function:<p>"; echo "Variable x is: $x"; echo "<br>"; echo "Variable y is: $y"; } myTest(); echo "<p>Test variables outside the function:<p>"; echo "Variable x is: $x"; echo "<br>"; echo "Variable y is: $y"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6NDIB
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 5
   13     1        INIT_FCALL                                               'mytest'
          2        DO_FCALL                                      0          
   15     3        ECHO                                                     '%3Cp%3ETest+variables+outside+the+function%3A%3Cp%3E'
   16     4        NOP                                                      
          5        FAST_CONCAT                                      ~4      'Variable+x+is%3A+', !0
          6        ECHO                                                     ~4
   17     7        ECHO                                                     '%3Cbr%3E'
   18     8        NOP                                                      
          9        FAST_CONCAT                                      ~5      'Variable+y+is%3A+', !1
         10        ECHO                                                     ~5
   19    11      > RETURN                                                   1

Function mytest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6NDIB
function name:  myTest
number of ops:  10
compiled vars:  !0 = $y, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 10
    7     1        ECHO                                                     '%3Cp%3ETest+variables+inside+the+function%3A%3Cp%3E'
    8     2        NOP                                                      
          3        FAST_CONCAT                                      ~3      'Variable+x+is%3A+', !1
          4        ECHO                                                     ~3
    9     5        ECHO                                                     '%3Cbr%3E'
   10     6        NOP                                                      
          7        FAST_CONCAT                                      ~4      'Variable+y+is%3A+', !0
          8        ECHO                                                     ~4
   11     9      > RETURN                                                   null

End of function mytest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.5 ms | 1398 KiB | 14 Q