<?php
namespace Test;
class Element {
}
class Super {
public function test() {
$this->getOptions(new Element);
}
protected function getOptions(Element $element) : array {
return ["element", "Eelement"];
}
}
class Child extends Super {
protected function getOptions(Element $element) : array {
print "hei";
return ["ok", "Test"];
}
}
$super = new Super();
$super->test();
$child = new Child();
$child->test();
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
hei
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/E3Ph1 on line 14
Process exited with code 255.