I'm trying to make a static class in PHP behave like a C# class, so,
- On the initial call to the class, the function Object() { [native code] } is immediately called.
- No instantiation is necessary.
Something like this:
static class Hello {
private static $greeting = 'Hello';
private __construct() {
$greeting .= ' There!';
}
public static greet(){
echo $greeting;
}
}
Hello::greet(); // Hello There!
Can someone please help me with this?