Hi
Am 13.02.2015 um 08:48 schrieb Stanislav Malyshev:
Hi!

there should be no bc break as the API doesn't change and the method
produces the exact same result as before.
Sorry, this makes no sense to me. You claim that if you changed the
method code to do different thing it should continue working as if you
didn't change it? Why? I just don't get it.

It's not a good thing to magically change the method API in base of a
method body that's not port of the API.
"magically change the method API"? What are you talking about? You
changed the code, not magic.

Sorry it wasn't clear. I hope I will now:

The static modifier for methods is part of the method signature and method body isn't.
(That's way interfaces doesn't describe method bodies but signatures)

The static modifier defines a method as static and therefore defines the method is callable using "::".

What I mean with "magically" is that you like to define a method as static without the static modifier in base of the method body but the body isn't part of the signature.

Now if you change the method body only without this very special knowledge into something using $this you break all code that calls the method statically.

So for me a +1 to throw an E_DEPRECATED error in this case and remove this feature in PHP 8. This will inform existing applications about the wrong call and provide enough time to be fixed.

Marc


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to