Get $this In A Static

no-email (Damien Seguy), Damien Seguy
Tue, 20 Jun 2023 00:00:00 +0000

A static method does not have access to the current object, by definition.

It is also possible to call statically any method within a class.

But when a static method calls a non-static method, an error is produced: Non-static ``method x::foo()`` cannot be called statically.

Finally, calling statically a non-static method still defines ``$this`` in the target method. Static is the nature of the method, not the call.