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; } } 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.13
Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting variable (T_VARIABLE) in /in/RPD3P on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting variable (T_VARIABLE) in vt9ke on line 12
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected T_ARRAY, expecting T_VARIABLE in /in/RPD3P on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected T_ARRAY, expecting T_VARIABLE in vt9ke on line 12
Process exited with code 255.

preferences:
180.22 ms | 1395 KiB | 45 Q