3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface ContainerInterface extends \RecursiveIterator { /** * @param string|callable $filter * @return ContainerInterface */ public function filter($filter, array $params = []): self; } class Item implements ContainerInterface { /** * @var ContainerInterface */ private $container; /** * @return Item */ public function current() { return $this->container->current(); } }
Output for 8.5.0 - 8.5.7
Deprecated: Return type of Item::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/1booS on line 22 Fatal error: Class Item contains 7 abstract methods and must therefore be declared abstract or implement the remaining methods (ContainerInterface::filter, RecursiveIterator::hasChildren, RecursiveIterator::getChildren, ...) in /in/1booS on line 12 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22
Deprecated: Return type of Item::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/1booS on line 22 Fatal error: Class Item contains 7 abstract methods and must therefore be declared abstract or implement the remaining methods (ContainerInterface::filter, RecursiveIterator::hasChildren, RecursiveIterator::getChildren, ...) in /in/1booS on line 12
Process exited with code 255.
Output for 7.1.25 - 7.1.27, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Fatal error: Class Item contains 7 abstract methods and must therefore be declared abstract or implement the remaining methods (ContainerInterface::filter, RecursiveIterator::hasChildren, RecursiveIterator::getChildren, ...) in /in/1booS on line 12
Process exited with code 255.

preferences:
114.99 ms | 1511 KiB | 4 Q