<?php
abstract class ParentClass
{
abstract public function doSomething(string $foo);
}
class ChildClass extends ParentClass
{
public function doSomething($foo) {}
}
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Fatal error: Declaration of ChildClass::doSomething($foo) must be compatible with ParentClass::doSomething(string $foo) in /in/LGNYb on line 11
Process exited with code 255.
Fatal error: Declaration of ChildClass::doSomething() must be compatible with ParentClass::doSomething(string $foo) in /in/LGNYb on line 11
Process exited with code 255.
Fatal error: Declaration of ChildClass::doSomething() must be compatible with that of ParentClass::doSomething() in /in/LGNYb on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/LGNYb on line 3
Process exited with code 255.