3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x() { $a = "A happily bound"; return function() use ( $a ) { return $a .= " PHP variable"; }; } $af = x(); print $af(); print $x()->__invoke();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiNoY
function name:  (null)
number of ops:  12
compiled vars:  !0 = $af, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'x'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   13     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   14     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0  $5      
          8        INIT_METHOD_CALL                                         $5, '__invoke'
          9        DO_FCALL                                      0  $6      
         10        ECHO                                                     $6
         11      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiNoY
function name:  x
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'A+happily+bound'
    7     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNiNoY%3A7%240'
          2        BIND_LEXICAL                                             ~2, !0
    9     3      > RETURN                                                   ~2
   10     4*     > RETURN                                                   null

End of function x

Function %00%7Bclosure%7D%2Fin%2FNiNoY%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiNoY
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        ASSIGN_OP                                     8  ~1      !0, '+PHP+variable'
          2      > RETURN                                                   ~1
    9     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNiNoY%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.89 ms | 1398 KiB | 14 Q