3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Produce { public $number = 0; public function __construct($amount = 0) { $this->number = $amount; } } class Potatoes extends Produce { } class Apples extends Produce { } $potatoes = new Potatoes(23); $apples = new Apples(12); echo 'Number of potatoes: '.$potatoes->number."\n"; echo 'Number of apples: '.$apples->number."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sidSq
function name:  (null)
number of ops:  17
compiled vars:  !0 = $potatoes, !1 = $apples
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Potatoes'
          1        SEND_VAL_EX                                              23
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        NEW                                              $5      'Apples'
          5        SEND_VAL_EX                                              12
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   21     8        FETCH_OBJ_R                                      ~8      !0, 'number'
          9        CONCAT                                           ~9      'Number+of+potatoes%3A+', ~8
         10        CONCAT                                           ~10     ~9, '%0A'
         11        ECHO                                                     ~10
   22    12        FETCH_OBJ_R                                      ~11     !1, 'number'
         13        CONCAT                                           ~12     'Number+of+apples%3A+', ~11
         14        CONCAT                                           ~13     ~12, '%0A'
         15        ECHO                                                     ~13
         16      > RETURN                                                   1

Class Produce:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sidSq
function name:  __construct
number of ops:  4
compiled vars:  !0 = $amount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      0
    6     1        ASSIGN_OBJ                                               'number'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Produce.

Class Potatoes:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sidSq
function name:  __construct
number of ops:  4
compiled vars:  !0 = $amount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      0
    6     1        ASSIGN_OBJ                                               'number'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Potatoes.

Class Apples:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sidSq
function name:  __construct
number of ops:  4
compiled vars:  !0 = $amount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      0
    6     1        ASSIGN_OBJ                                               'number'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Apples.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.39 ms | 1399 KiB | 13 Q