3v4l.org

run code in 300+ PHP versions simultaneously
<html> <body> <?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/C03QI
function name:  (null)
number of ops:  13
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Cbody%3E%0A%0A'
    5     1        ASSIGN                                                   !0, 5
   16     2        INIT_FCALL                                               'mytest'
          3        DO_FCALL                                      0          
   18     4        ECHO                                                     '%3Cp%3ETest+variables+outside+the+function%3A%3Cp%3E'
   19     5        NOP                                                      
          6        FAST_CONCAT                                      ~4      'Variable+x+is%3A+', !0
          7        ECHO                                                     ~4
   20     8        ECHO                                                     '%3Cbr%3E'
   21     9        NOP                                                      
         10        FAST_CONCAT                                      ~5      'Variable+y+is%3A+', !1
         11        ECHO                                                     ~5
   22    12      > RETURN                                                   1

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

End of function mytest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.45 ms | 1398 KiB | 14 Q