3v4l.org

run code in 300+ PHP versions simultaneously
<html> <body> <?php $x=15; // global scope function myTest() { $y=25; // 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"; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/skSVh
function name:  (null)
number of ops:  14
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, 15
   15     2        INIT_FCALL                                               'mytest'
          3        DO_FCALL                                      0          
   17     4        ECHO                                                     '%3Cp%3ETest+variables+outside+the+function%3A%3C%2Fp%3E'
   18     5        NOP                                                      
          6        FAST_CONCAT                                      ~4      'Variable+x+is%3A+', !0
          7        ECHO                                                     ~4
   19     8        ECHO                                                     '%3Cbr%3E'
   20     9        NOP                                                      
         10        FAST_CONCAT                                      ~5      'Variable+y+is%3A+', !1
         11        ECHO                                                     ~5
   22    12        ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   24    13      > RETURN                                                   1

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

End of function mytest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.02 ms | 1398 KiB | 14 Q