3v4l.org

run code in 500+ 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); $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/kWIGr
function name:  (null)
number of ops:  20
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                              ~5      [0]
          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                                                     
   14    15        ASSIGN                                                       !1, 'the+cake+is+a+lie%21'
   16    16        INIT_FCALL                                                   'var_dump'
         17        SEND_VAR                                                     !0
         18        DO_ICALL                                                     
         19      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/kWIGr
function name:  {closure:/in/kWIGr:10}
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 Dynamic Function 0

Class Kitchen: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
193.42 ms | 3320 KiB | 14 Q