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); echo str_replace("\0", '\0', var_export($b, true)); 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 = 22, Position 2 = 34
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/VWdHK
function name:  (null)
number of ops:  36
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                                               'str_replace'
         12        SEND_VAL                                                 '%00'
         13        SEND_VAL                                                 '%5C0'
         14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ECHO                                                     $12
   39    21      > FE_RESET_R                                       $13     !1, ->34
         22    > > FE_FETCH_R                                       ~14     $13, !2, ->34
         23    >   ASSIGN                                                   !3, ~14
   41    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'bin2hex'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $16     
         28        INIT_ARRAY                                       ~17     $16
         29        ADD_ARRAY_ELEMENT                                ~17     !3
         30        ADD_ARRAY_ELEMENT                                ~17     !2
         31        SEND_VAL                                                 ~17
         32        DO_ICALL                                                 
   39    33      > JMP                                                      ->22
         34    >   FE_FREE                                                  $13
   42    35      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VWdHK
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/VWdHK
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:
165.27 ms | 1400 KiB | 21 Q