3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface ProcessorInterface { public function __invoke(LogRecord $record); } class Foo implements ProcessorInterface { public function __invoke(array|LogRecord $record): LogRecord|array { return $this->doInvoke($record); } } class Bar implements ProcessorInterface { public function __invoke(LogRecord $record): LogRecord { return $this->doInvoke($record); } }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /in/L97Z5 on line 10
Process exited with code 255.

preferences:
74.06 ms | 1256 KiB | 4 Q