3v4l.org

run code in 300+ 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                                  '%00%7Bclosure%7D%2Fin%2FO6CHg%3A8%240'
          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

Function %00%7Bclosure%7D%2Fin%2FO6CHg%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O6CHg
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FO6CHg%3A8%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.18 ms | 1395 KiB | 15 Q