3v4l.org

run code in 500+ PHP versions simultaneously
<?php $o = new stdClass(); $o->f = (function() { return $this->a; })->bindTo($o); $o->a = 'Hello'; echo ($o->f)();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BklFB
function name:  (null)
number of ops:  16
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $1      'stdClass'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
    4     3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        INIT_METHOD_CALL                                             ~5, 'bindTo'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $6      
          7        ASSIGN_OBJ                                                   !0, 'f'
          8        OP_DATA                                                      $6
    5     9        ASSIGN_OBJ                                                   !0, 'a'
         10        OP_DATA                                                      'Hello'
    7    11        FETCH_OBJ_R                                          ~8      !0, 'f'
         12        INIT_DYNAMIC_CALL                                            ~8
         13        DO_FCALL                                          0  $9      
         14        ECHO                                                         $9
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BklFB
function name:  {closure:/in/BklFB:4}
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                           $0      
          1        FETCH_OBJ_R                                          ~1      $0, 'a'
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
204.05 ms | 2083 KiB | 13 Q