3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FtjNH2%3A10%240:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/tjNH2
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%2FtjNH2%3A10%240

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.82 ms | 1395 KiB | 17 Q