3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public function takeUntilTimeout(DateTimeInterface $timeout, callable $callback = null){} } class B extends A{ public function takeUntilTimeout(DateTimeInterface $timeout){} }
Output for 8.0.1 - 8.0.16, 8.1.0 - 8.1.3
Fatal error: Declaration of B::takeUntilTimeout(DateTimeInterface $timeout) must be compatible with A::takeUntilTimeout(DateTimeInterface $timeout, ?callable $callback = null) in /in/h5gkL on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.28
Warning: Declaration of B::takeUntilTimeout(DateTimeInterface $timeout) should be compatible with A::takeUntilTimeout(DateTimeInterface $timeout, ?callable $callback = NULL) in /in/h5gkL on line 8

preferences:
176.85 ms | 1004 KiB | 7 Q