3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = 'public'; protected $_b = 'protected'; private $_c = 'private'; } $method = function (){ $GLOBALS['this'] =& $this; $GLOBALS['this'] = 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/he485
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%2Fhe485%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%2Fhe485%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/he485
function name:  {closure}
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       $2      
          1        MAKE_REF                                         $3      $2
          2        FETCH_W                      global              $0      'GLOBALS'
          3        FETCH_DIM_W                                      $1      $0, 'this'
          4        ASSIGN_REF                                               $1, $3
          5        NEW                                              $7      'stdClass'
          6        DO_FCALL                                      0          
          7        FETCH_W                      global              $5      'GLOBALS'
          8        ASSIGN_DIM                                               $5, 'this'
          9        OP_DATA                                                  $7
         10        INIT_FCALL                                               'var_dump'
         11        FETCH_THIS                                       ~9      
         12        SEND_VAL                                                 ~9
         13        FETCH_THIS                                       $10     
         14        FETCH_OBJ_R                                      ~11     $10, 'a'
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
         17      > RETURN                                                   null

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

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.77 ms | 1396 KiB | 15 Q