3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = 'public'; protected $_b = 'protected'; private $_c = 'private'; } $method = function (){ $x =& $this; $x = new stdClass; var_dump($this, $this->a);}; $a = new A; $method = $method->bindTo($a); $method(); var_dump($this);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hWOVF
function name:  (null)
number of ops:  16
compiled vars:  !0 = $method, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhWOVF%3A9%240'
          1        ASSIGN                                                   !0, ~2
   10     2        NEW                                              $4      'A'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   11     5        INIT_METHOD_CALL                                         !0, 'bindTo'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !0, $7
   12     9        INIT_DYNAMIC_CALL                                        !0
         10        DO_FCALL                                      0          
   13    11        INIT_FCALL                                               'var_dump'
         12        FETCH_THIS                                       ~10     
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhWOVF%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hWOVF
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
          2        NEW                                              $3      'stdClass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
          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      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhWOVF%3A9%240

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.33 ms | 1388 KiB | 15 Q