3v4l.org

run code in 300+ PHP versions simultaneously
<?php $b = 10; $f = function() use ($b) { return $x = function($b) { return $b; }; }; var_dump( $f(1)());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTMKf
function name:  (null)
number of ops:  13
compiled vars:  !0 = $b, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 10
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQTMKf%3A3%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !1, ~3
    7     4        INIT_FCALL                                               'var_dump'
          5        INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0  $5      
          8        INIT_DYNAMIC_CALL                                        $5
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQTMKf%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTMKf
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $b, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQTMKf%3A4%241'
          2        ASSIGN                                           ~3      !1, ~2
          3      > RETURN                                                   ~3
    6     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQTMKf%3A3%240

Function %00%7Bclosure%7D%2Fin%2FQTMKf%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTMKf
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
    5     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQTMKf%3A4%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.15 ms | 1396 KiB | 15 Q