3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class Manager { public $content_storage=''; public function __toString() { return $this->content_storage; } public function __call($name,&array $params) { $this->content_storage.=$this->_GetObject($name,$params).'<br>'.PHP_EOL; return $this; } } abstract class EntryClass { public static function Launch() { return new FluentInterface; } } class FluentInterface extends Manager { public function __construct() { /** * Что-нибудь инициализируем */ } public static function _GetObject($n,array $params) { return $n; } } echo $FI=EntryClass::Launch() ->First() ->Second() ->Third(); /* Выведет First Second Third */ ?>
Output for 5.4.0 - 5.4.13
Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting variable (T_VARIABLE) in /in/vt9ke on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.23
Parse error: syntax error, unexpected T_ARRAY, expecting T_VARIABLE in /in/vt9ke on line 12
Process exited with code 255.