Welcome Guest, Not a member yet? Register   Sign In
Class Name is variable does NOT work
#1

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/
Reply


Messages In This Thread
Class Name is variable does NOT work - by iot - 10-07-2020, 07:38 PM
RE: Class Name is variable does NOT work - by iot - 10-11-2020, 07:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB