3v4l.org

run code in 300+ PHP versions simultaneously
<? class Post { public function __construct() { echo $this->getKeywords(); echo "\r\n"; echo $this->getDescription(); echo "\r\n"; echo $this->getTitle(); echo "\r\n"; } public function getKeywords() { return 'POST:keywords'; } protected function getDescription() { return 'POST:description'; } private function getTitle() { return 'POST:title'; } } class News extends Post { public function __construct() { parent::__construct(); } public function getKeywords() { return 'News:keywords'; } protected function getDescription() { return 'News:description'; } private function getTitle() { return 'News:title'; } } //1 случай $Object = new News(); //2 случай echo $Object->getKeywords(); echo "\r\n"; echo $Object->getTitle(); echo "\r\n"; echo $Object->getDescription(); echo "\r\n";
Output for git.master, git.master_jit, rfc.property-hooks
<? class Post { public function __construct() { echo $this->getKeywords(); echo "\r\n"; echo $this->getDescription(); echo "\r\n"; echo $this->getTitle(); echo "\r\n"; } public function getKeywords() { return 'POST:keywords'; } protected function getDescription() { return 'POST:description'; } private function getTitle() { return 'POST:title'; } } class News extends Post { public function __construct() { parent::__construct(); } public function getKeywords() { return 'News:keywords'; } protected function getDescription() { return 'News:description'; } private function getTitle() { return 'News:title'; } } //1 случай $Object = new News(); //2 случай echo $Object->getKeywords(); echo "\r\n"; echo $Object->getTitle(); echo "\r\n"; echo $Object->getDescription(); echo "\r\n";

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.69 ms | 403 KiB | 8 Q