On 18/11/2014 18:54, Stanislav Malyshev wrote:
Hi!
You write:
Also, this can lead to more subtle BC breaks. Consider this code:
And then further on:
No backward incompatible changes, sin...
that can not be both right.
Ah, but the former describes the option that has been *rejected*. The
option that was chosen instead does not have the BC break.
Personally, I would much prefer the backwards compatibility break to
happen. It is frankly quite bizarre, and not at all useful, that the
following two pieces of code behave differently:
class Foo {}
new Foo( print('hello') );
// silent
vs
class Foo { function __construct() {} }
new Foo( print('hello') );
// says "hello"
(Incidentally, HHVM doesn't have this "optimisation", and says "hello"
in both cases: http://3v4l.org/ZDXs1)
If I came upon this without knowing more, I would assume it was a bug in
PHP, and any code relying on it was in need of fixing ASAP.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php