Hi.

I would like to register an RFC on the following issue.
https://github.com/php/php-src/issues/13813

To summarize briefly, users expect that the `__callStatic` magic method
will be called in all cases when a method is not static while using the
`__callStatic`. However, in reality, if the method is public, the
`__callStatic` magic method is not called, and an error still occurs.

I would like to hear your opinions.
I also hope someone can help with the RFC registration.


--------------------------------------------------------

```php
<?php
class MyClass
{
public static function __callStatic($method, $args)
{
echo $method . "\n";
}

private function privateMethod() {}
protected function protectedMethod() {}
public function publicMethod() {}
}

MyClass::privateMethod();
MyClass::protectedMethod();
MyClass::publicMethod();
```

Resulted in this output:
```
privateMethod
protectedMethod
Fatal error: Uncaught Error: Non-static method MyClass::publicMethod()
cannot be called statically in ...
```

But I expected this output instead:
```
privateMethod
protectedMethod
publicMethod
```

Reply via email to