<?php
interface I {
const C = 12;
public static function test(array $a);
}
abstract class A {
const A = 14;
protected static $var = 17;
public static function test(array $a){
return self::C;
}
}
class B extends A implements I {
const D = 15;
}
var_dump(B::test(array()));
Fatal error: Uncaught Error: Undefined constant A::C in /in/qBDvq:11
Stack trace:
#0 /in/qBDvq(19): A::test(Array)
#1 {main}
thrown in /in/qBDvq on line 11
Process exited with code 255.
Output for 8.3.5
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
Fatal error: Uncaught Error: Undefined constant A::C in /in/qBDvq:11
Stack trace:
#0 /in/qBDvq(19): A::test(Array)
#1 {main}
thrown in /in/qBDvq on line 11
Process exited with code 255.
Fatal error: Uncaught Error: Undefined class constant 'C' in /in/qBDvq:11
Stack trace:
#0 /in/qBDvq(19): A::test(Array)
#1 {main}
thrown in /in/qBDvq on line 11
Process exited with code 255.