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; } } 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.3.0 - 5.4.13
Fatal error: Method Manager::__call() cannot take arguments by reference in /in/rH6ds on line 16
Process exited with code 255.