I have an helper class with some static functions. All the functions in the class require a ‘heavy’ initialization function to run once (as if it were a constructor).
If you don't like public static initializer, reflection can be a workaround.
public
setAccessible(true); // Execute the 'initialize' method. $ref->invoke(null); } catch (Exception $e) { } } } class MyClass { private static function initialize() { } } LanguageUtility::initializeClass('MyClass'); ?>