3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; protected $b; private $c; public function __construct() { $this->a = 'A_a'; $this->b = 'A_b'; $this->c = 'A_c'; } } class B extends A { protected $b; private $c; public function __construct($b, $c) { parent::__construct(); $this->b = 'B_b'; $this->c = 'B_c'; } } $b = new B; var_dump($b); $array = (array) $b; var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QUGK
function name:  (null)
number of ops:  12
compiled vars:  !0 = $b, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   34     6        CAST                                          7  ~6      !0
          7        ASSIGN                                                   !1, ~6
   35     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QUGK
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'a'
          1        OP_DATA                                                  'A_a'
   12     2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  'A_b'
   13     4        ASSIGN_OBJ                                               'c'
          5        OP_DATA                                                  'A_c'
   14     6      > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QUGK
function name:  __construct
number of ops:  9
compiled vars:  !0 = $b, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        INIT_STATIC_METHOD_CALL                                  
          3        DO_FCALL                                      0          
   26     4        ASSIGN_OBJ                                               'b'
          5        OP_DATA                                                  'B_b'
   27     6        ASSIGN_OBJ                                               'c'
          7        OP_DATA                                                  'B_c'
   28     8      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.29 ms | 941 KiB | 16 Q