<?php
abstract class Foo
{
}
class FooExtended extends Foo
{
}
abstract class AbstractTest
{
abstract function test();
}
class TestImpl extends AbstractTest
{
function test() : FooExtended
{
return new FooExtended();
}
}
$t = new TestImpl();
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 5.6.0 - 5.6.40
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/GoH1S on line 21
Process exited with code 255.