3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Productss{ protected $title; protected $category; const CHANGES_SAVED = 'Wijzigingen opgeslagen'; public function __construct($title, $category){ $this->title = $title; $this->category = $category; } public function someFunction(){ self::CHANGES_SAVED; // CHANGES_SAVED not changeable in this class, it is changeable in a child class } public function getCategory(){ return $this->category; } public function getTitle(){ return $this->title; } } class Order extends Productss{ protected $price; protected $deliver; const CHANGES_SAVED = 'Wijzigingen nu opgeslagen'; public function __construct($title, $category, $price){ parent::__construct($title, $category); $this->price = $price; $this->doWeDeliver(); } public function getPrice(){ return $this->price; } public function getDeliver(){ return $this->deliver; } protected function doWeDeliver(){ $this->deliver = $this->price > 30 ? 'Yes' : 'No' ; } } //$order = new Order('CD Brahms', 'Media', '45'); //echo 'Product :'.$order->getTitle(); //echo 'Categorie :'.$order->getCategory(); //echo 'Prijs :'.$order->getPrice(); //echo 'Gratis bezorging :'.$order->getDeliver(); echo Productss::CHANGES_SAVED.'<br />'; // 300 echo Order::CHANGES_SAVED.'<br />'; // 500
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFXJD
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   ECHO                                                     'Wijzigingen+opgeslagen%3Cbr+%2F%3E'
   54     1        ECHO                                                     'Wijzigingen+nu+opgeslagen%3Cbr+%2F%3E'
          2      > RETURN                                                   1

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

End of function __construct

Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFXJD
function name:  someFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   null

End of function somefunction

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

End of function getcategory

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

End of function gettitle

End of class Productss.

Class Order:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFXJD
function name:  __construct
number of ops:  12
compiled vars:  !0 = $title, !1 = $category, !2 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   31     3        INIT_STATIC_METHOD_CALL                                  
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
   32     7        ASSIGN_OBJ                                               'price'
          8        OP_DATA                                                  !2
   33     9        INIT_METHOD_CALL                                         'doWeDeliver'
         10        DO_FCALL                                      0          
   34    11      > RETURN                                                   null

End of function __construct

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

End of function getprice

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

End of function getdeliver

Function dowedeliver:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFXJD
function name:  doWeDeliver
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   FETCH_OBJ_R                                      ~1      'price'
          1        IS_SMALLER                                               30, ~1
          2      > JMPZ                                                     ~2, ->5
          3    >   QM_ASSIGN                                        ~3      'Yes'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~3      'No'
          6    >   ASSIGN_OBJ                                               'deliver'
          7        OP_DATA                                                  ~3
   44     8      > RETURN                                                   null

End of function dowedeliver

Function somefunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFXJD
function name:  someFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   null

End of function somefunction

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

End of function getcategory

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

End of function gettitle

End of class Order.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1403 KiB | 13 Q