3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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());
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected '{', expecting '(' in /in/YVVfC on line 24
Process exited with code 255.