3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Base { protected function __construct(){} public function create(){ return new self(); } abstract function action(); } class Item extends Base{ public function action(){ echo __CLASS__ } } $item = Item::create(); $item->action();
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/9qBrU on line 13
Process exited with code 255.

preferences:
170.03 ms | 1399 KiB | 63 Q