3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 100; $function = function() use(&$var){ // notice the & $var = $var + 23; echo "within the function \$var is " . $var . "\n"; }; $function(); // calls the above function echo "outside of the function \$var is " . $var . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WEEOI
function name:  (null)
number of ops:  10
compiled vars:  !0 = $var, !1 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 100
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWEEOI%3A5%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !1, ~3
   10     4        INIT_DYNAMIC_CALL                                        !1
          5        DO_FCALL                                      0          
   12     6        CONCAT                                           ~6      'outside+of+the+function+%24var+is+', !0
          7        CONCAT                                           ~7      ~6, '%0A'
          8        ECHO                                                     ~7
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWEEOI%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WEEOI
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        ADD                                              ~1      !0, 23
          2        ASSIGN                                                   !0, ~1
    7     3        CONCAT                                           ~3      'within+the+function+%24var+is+', !0
          4        CONCAT                                           ~4      ~3, '%0A'
          5        ECHO                                                     ~4
    8     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWEEOI%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.04 ms | 1394 KiB | 13 Q