<?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
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/uJYeR on line 54
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uJYeR on line 4
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/uJYeR on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/uJYeR on line 4
Process exited with code 255.