3v4l.org

run code in 300+ PHP versions simultaneously
<?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.23, 5.4.13
Fatal error: Method Manager::__call() cannot take arguments by reference in /in/ZXlZ1 on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.4.0 - 5.4.12
Fatal error: Method Manager::__call() cannot take arguments by reference in rH6ds on line 16
Process exited with code 255.

preferences:
176.2 ms | 1395 KiB | 45 Q