3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public $a = 'public'; } $m = function (){ $x =& $this; $x = new stdClass; var_dump($this, $this->a); }; $a = new A; $m = $m->bindTo($a); $m();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O6CHg
function name:  (null)
number of ops:  12
compiled vars:  !0 = $m, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          1        ASSIGN                                                       !0, ~2
   14     2        NEW                                                  $4      'A'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $4
   15     5        INIT_METHOD_CALL                                             !0, 'bindTo'
          6        SEND_VAR_EX                                                  !1
          7        DO_FCALL                                          0  $7      
          8        ASSIGN                                                       !0, $7
   16     9        INIT_DYNAMIC_CALL                                            !0
         10        DO_FCALL                                          0          
         11      > 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/O6CHg
function name:  {closure:/in/O6CHg:8}
number of ops:  13
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                           $1      
          1        ASSIGN_REF                                                   !0, $1
   10     2        NEW                                                  $3      'stdClass'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $3
   11     5        INIT_FCALL                                                   'var_dump'
          6        FETCH_THIS                                           ~6      
          7        SEND_VAL                                                     ~6
          8        FETCH_THIS                                           $7      
          9        FETCH_OBJ_R                                          ~8      $7, 'a'
         10        SEND_VAL                                                     ~8
         11        DO_ICALL                                                     
   12    12      > RETURN                                                       null

End of Dynamic Function 0

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.72 ms | 3002 KiB | 14 Q