3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { protected $x = "parent"; public function __construct() { $this->x = "parent - construct"; } } class MyChild extends MyParent { protected $x = "child"; public function __construct() { var_dump($this->x); $this->x = "child - construct"; var_dump($this->x); $closure = function () { var_dump($this->x); }; $closure = $closure->bindTo($this, parent::class); $closure(); } } new MyChild;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvE32
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $0      'MyChild'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class MyParent:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvE32
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'x'
          1        OP_DATA                                                  'parent+-+construct'
    8     2      > RETURN                                                   null

End of function __construct

End of class MyParent.

Class MyChild:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvE32
function name:  __construct
number of ops:  21
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~1      'x'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   17     4        ASSIGN_OBJ                                               'x'
          5        OP_DATA                                                  'child+-+construct'
   19     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~4      'x'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   21    10        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
         11        ASSIGN                                                   !0, ~6
   25    12        INIT_METHOD_CALL                                         !0, 'bindTo'
         13        FETCH_THIS                                       $8      
         14        SEND_VAR_EX                                              $8
         15        SEND_VAL_EX                                              'MyParent'
         16        DO_FCALL                                      0  $9      
         17        ASSIGN                                                   !0, $9
   26    18        INIT_DYNAMIC_CALL                                        !0
         19        DO_FCALL                                      0          
   27    20      > RETURN                                                   null


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

End of Dynamic Function 0

End of function __construct

End of class MyChild.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
226.09 ms | 1003 KiB | 14 Q