class MyClass { public static $myStaticProperty = "Hello World!"; } $value = getStaticProperty('MyClass', 'myStaticProperty'); echo $value; // Output: Hello World!
class MyOtherClass { public static $myOtherStaticProperty = array('red', 'green', 'blue'); } $values = getStaticProperty('MyOtherClass', 'myOtherStaticProperty'); print_r($values); // Output: Array ( [0] => red [1] => green [2] => blue )This example retrieves the value of the static property $myOtherStaticProperty of the class MyOtherClass and stores it in the $values variable. The output of the print_r() function is an array containing the values red, green, and blue. The package library that the getStaticProperty() function belongs to is likely PEAR's Class_Structure. This package provides various methods for introspecting classes and objects in PHP.