3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pizza { private $size; protected $price; public function __construct() { $this->size = 'large'; $this->price = 10; } } class PanPizza extends Pizza { private $size; public function getSize() { return $this->size; } public function getPrice() { return $this->price; } } $pizza = new PanPizza; var_dump($pizza->getSize()); var_dump($pizza->getPrice());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjYKA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $pizza
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'PanPizza'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getSize'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   31     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'getPrice'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Pizza:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjYKA
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'size'
          1        OP_DATA                                                  'large'
   10     2        ASSIGN_OBJ                                               'price'
          3        OP_DATA                                                  10
   11     4      > RETURN                                                   null

End of function __construct

End of class Pizza.

Class PanPizza:
Function getsize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjYKA
function name:  getSize
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~0      'size'
          1      > RETURN                                                   ~0
   21     2*     > RETURN                                                   null

End of function getsize

Function getprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjYKA
function name:  getPrice
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'price'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getprice

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TjYKA
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'size'
          1        OP_DATA                                                  'large'
   10     2        ASSIGN_OBJ                                               'price'
          3        OP_DATA                                                  10
   11     4      > RETURN                                                   null

End of function __construct

End of class PanPizza.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.12 ms | 1400 KiB | 15 Q