3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <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"; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcm93
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                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%0A'
    6     1        ASSIGN                                                   !0, 5
   16     2        INIT_FCALL                                               'mytest'
          3        DO_FCALL                                      0          
   18     4        ECHO                                                     '%3Cp%3ETest+variables+outside+the+function%3A%3C%2Fp%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
   23    12        ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   25    13      > RETURN                                                   1

Function mytest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcm93
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%3C%2Fp%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:
149.53 ms | 1398 KiB | 14 Q