Revision #36 was created by rackycz on Oct 14, 2025, 8:50:24 AM.
edit
Content
[...]
## Construct vs Invoke
It may be confusing that some classes contain both methods. Note that "property promotion" should be only used in `__construct()`.
Magic method `__invoke()` is only used if you create an instance and then use it as a function. Example:
```php
$obj = new MyObj(); // Now the __construct() is executed
$obj(); // Now the __invoke() is executed
```
To be honest, I still do not fully understand the real purpose of this situation.