3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sf($arg) { echo "called\n"; return $arg; } function test() { global ${sf("a")}; var_dump($a); } $a = 42; test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5na8
function name:  (null)
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 42
   14     1        INIT_FCALL                                               'test'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function sf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5na8
function name:  sf
number of ops:  4
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     'called%0A'
    5     2      > RETURN                                                   !0
    6     3*     > RETURN                                                   null

End of function sf

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5na8
function name:  test
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'sf'
          1        SEND_VAL                                                 'a'
          2        DO_FCALL                                      0  $1      
          3        FETCH_W                      global lock         $2      $1
          4        FETCH_W                      local               $3      $1
          5        ASSIGN_REF                                               $3, $2
   10     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   11     9      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.67 ms | 1398 KiB | 17 Q