This code work on CI3 but not on CI4
PHP Code:
class Foo
{
public static $var2 = 1;
}
$classname = 'Foo';
echo $classname::$var2; // Outputs 1
In CI4, it will return an error:
Class 'Foo' not found
Could anyone please tell me how to fix it.
Thank you in advance.
Please note that if I change
echo $classname::$var2; to
echo Foo::$var2;, it will work/