Re: [PHP-DEV] Mixed mode methods

2019-09-02 Thread Andreas Hennings
In my experience, things that have different roles or behavior should be differently named. I have seen a lot of functions with dynamic return types based on a mode set in the parameter (e.g. the return type could be string, string[] or string[][] depending on whether some parameter is NULL or

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-02 Thread Arvids Godjuks
On Mon, Sep 2, 2019, 19:02 Sara Golemon wrote: > On Thu, Aug 29, 2019 at 2:29 PM Stanislav Malyshev > wrote: > > > >> I knew it worked, but I always considered this to basically be > > >> the PHP equivalent of undefined behavior in C. And I don't think > anyone > > > > It's not. It's very well

Re: [PHP-DEV] [RFC] Reclassifying engine warnings

2019-09-02 Thread Sara Golemon
On Thu, Aug 29, 2019 at 2:29 PM Stanislav Malyshev wrote: > >> I knew it worked, but I always considered this to basically be > >> the PHP equivalent of undefined behavior in C. And I don't think anyone > > It's not. It's very well defined behavior, that is not going to break - > unless it is

Re: [PHP-DEV] Mixed mode methods

2019-09-02 Thread Christian Schneider
Am 02.09.2019 um 17:01 schrieb Dan Ackroyd : > Also(, without checking to see if it's feasible,) to me a less > surprising approach would be to allow static and instance methods to > be declared separately with the same method name. > > class Foo { >static function loadXml() { >echo

Re: [PHP-DEV] Mixed mode methods

2019-09-02 Thread Dan Ackroyd
On Mon, 2 Sep 2019 at 15:03, Christian Schneider wrote: > > Please don't shoot this down just because you are not the target audience of > such a feature That is always good advice. When you draft the RFC, I strongly recommend coming up with a line of reasoning of why creating static versions

Re: [PHP-DEV] Mixed mode methods

2019-09-02 Thread Nikita Popov
On Mon, Sep 2, 2019 at 4:03 PM Christian Schneider wrote: > Hi internals, > > While some people are trying to make PHP a stricter language I'm also > interested in making it a more flexible language by allowing to opt-in to > advanced features for people who want it. > Please don't shoot this

[PHP-DEV] Mixed mode methods

2019-09-02 Thread Christian Schneider
Hi internals, While some people are trying to make PHP a stricter language I'm also interested in making it a more flexible language by allowing to opt-in to advanced features for people who want it. Please don't shoot this down just because you are not the target audience of such a feature