3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); function run() { $default = function() { global $test; return $test; }; $test = 'test'; echo $default(); } run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Qi82
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
   17     3        INIT_FCALL                                               'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Qi82
function name:  run
number of ops:  7
compiled vars:  !0 = $default, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0Qi82%3A6%240'
          1        ASSIGN                                                   !0, ~2
   12     2        ASSIGN                                                   !1, 'test'
   14     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0  $5      
          5        ECHO                                                     $5
   15     6      > RETURN                                                   null

End of function run

Function %00%7Bclosure%7D%2Fin%2F0Qi82%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Qi82
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                              !0, 'test'
    9     1      > RETURN                                                   !0
   10     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0Qi82%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.65 ms | 1398 KiB | 16 Q