3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Kitchen { private $yummy = 'cake'; } $kitchen = new Kitchen(); $cake = & Closure::bind(function & () { return $this->yummy; }, $kitchen, $kitchen)->__invoke(); var_dump($cake);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5Fof
function name:  (null)
number of ops:  16
compiled vars:  !0 = $kitchen, !1 = $cake
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'Kitchen'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   10     3        INIT_STATIC_METHOD_CALL                                  'Closure', 'bind'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fm5Fof%3A10%240'
          5        SEND_VAL                                                 ~5
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $6      
          9        INIT_METHOD_CALL                                         $6, '__invoke'
         10        DO_FCALL                                      0  $7      
         11        ASSIGN_REF                                               !1, $7
   12    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm5Fof%3A10%240:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/m5Fof
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_W                                      $1      $0, 'yummy'
          2      > RETURN_BY_REF                                            $1
          3*     > RETURN_BY_REF                                            null

End of function %00%7Bclosure%7D%2Fin%2Fm5Fof%3A10%240

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.43 ms | 1395 KiB | 15 Q