3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 1; function test1() { $var = 2; echo $var . "<br />"; } test1(); echo $var . "<br />"; echo "<hr />"; $var = 1; function test2() { global $var; $var = 2; echo $var . "<br />"; } test2(); echo $var . "<br />"; echo "<hr />"; $var = 1; function test3() { static $var = 2; echo $var . "<br />"; $var++; } test3(); test3(); test3(); echo $var . "<br />"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJZrV
function name:  (null)
number of ops:  22
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    7     1        INIT_FCALL                                               'test1'
          2        DO_FCALL                                      0          
    8     3        CONCAT                                           ~3      !0, '%3Cbr+%2F%3E'
          4        ECHO                                                     ~3
   10     5        ECHO                                                     '%3Chr+%2F%3E'
   12     6        ASSIGN                                                   !0, 1
   18     7        INIT_FCALL                                               'test2'
          8        DO_FCALL                                      0          
   19     9        CONCAT                                           ~6      !0, '%3Cbr+%2F%3E'
         10        ECHO                                                     ~6
   21    11        ECHO                                                     '%3Chr+%2F%3E'
   23    12        ASSIGN                                                   !0, 1
   29    13        INIT_FCALL                                               'test3'
         14        DO_FCALL                                      0          
   30    15        INIT_FCALL                                               'test3'
         16        DO_FCALL                                      0          
   31    17        INIT_FCALL                                               'test3'
         18        DO_FCALL                                      0          
   32    19        CONCAT                                           ~11     !0, '%3Cbr+%2F%3E'
         20        ECHO                                                     ~11
   33    21      > RETURN                                                   1

Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJZrV
function name:  test1
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 2
    5     1        CONCAT                                           ~2      !0, '%3Cbr+%2F%3E'
          2        ECHO                                                     ~2
    6     3      > RETURN                                                   null

End of function test1

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJZrV
function name:  test2
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   BIND_GLOBAL                                              !0, 'var'
   15     1        ASSIGN                                                   !0, 2
   16     2        CONCAT                                           ~2      !0, '%3Cbr+%2F%3E'
          3        ECHO                                                     ~2
   17     4      > RETURN                                                   null

End of function test2

Function test3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJZrV
function name:  test3
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   BIND_STATIC                                              !0
   26     1        CONCAT                                           ~1      !0, '%3Cbr+%2F%3E'
          2        ECHO                                                     ~1
   27     3        PRE_INC                                                  !0
   28     4      > RETURN                                                   null

End of function test3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.81 ms | 1407 KiB | 20 Q