3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name='why';//定义变量name,并初始化 function echoName() { //通过global来声明$name,相当于传递参数 global $name;//global是起传递参数的作用,而并非使变量的作用域为全局。 echo 'myname is'.$name; } echoName(); echo $name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8cAfn
function name:  (null)
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'why'
   10     1        INIT_FCALL                                               'echoname'
          2        DO_FCALL                                      0          
   11     3        ECHO                                                     !0
          4      > RETURN                                                   1

Function echoname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8cAfn
function name:  echoName
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                              !0, 'name'
    8     1        CONCAT                                           ~1      'myname+is', !0
          2        ECHO                                                     ~1
    9     3      > RETURN                                                   null

End of function echoname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.63 ms | 1396 KiB | 14 Q