I have a static class Foo (this isn’t a real class, so static fields are just for example)
class Foo{
public static $name = "foo";
public static $age = "18";
public static $city = "Boston";
}
In my code I want to build an array of all the public static properties and their current values.
Is there a quick/easy way anyone can suggest to do this without instantiating a Foo?
Use a
ReflectionClassinstance like this to get an array of the property names and values: