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 { public $b; private $c; public function __construct() { parent::__construct(); $this->b = 'B_b'; $this->c = 'B_c'; } } $b = new B; var_dump($b); $array = (array) $b; var_dump($array); var_export($b); foreach ($array as $k => $v) { var_dump([bin2hex($k), $k, $v]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/fTF2q
function name:  (null)
number of ops:  29
compiled vars:  !0 = $b, !1 = $array, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $4      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   32     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   34     6        CAST                                          7  ~8      !0
          7        ASSIGN                                                   !1, ~8
   35     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   37    11        INIT_FCALL                                               'var_export'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   39    14      > FE_RESET_R                                       $12     !1, ->27
         15    > > FE_FETCH_R                                       ~13     $12, !2, ->27
         16    >   ASSIGN                                                   !3, ~13
   41    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'bin2hex'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $15     
         21        INIT_ARRAY                                       ~16     $15
         22        ADD_ARRAY_ELEMENT                                ~16     !3
         23        ADD_ARRAY_ELEMENT                                ~16     !2
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                                 
   39    26      > JMP                                                      ->15
         27    >   FE_FREE                                                  $12
   42    28      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fTF2q
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/fTF2q
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   26     2        ASSIGN_OBJ                                               'b'
          3        OP_DATA                                                  'B_b'
   27     4        ASSIGN_OBJ                                               'c'
          5        OP_DATA                                                  'B_c'
   28     6      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.58 ms | 1400 KiB | 19 Q