Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] Minor BC break in gettype()

Posted by Sara Golemon 
Sara Golemon
[PHP-DEV] Minor BC break in gettype()
November 18, 2017 10:20AM
https://3v4l.org/kRON7

https://github.com/php/php-src/commit/f00d1c72b4dbaf3532569d20efc1da7c408605d6

The above patch optimizes calls to gettype() into an opcode, however the strings returned for closed resources has changed relative to 7.1 and earlier.

The newer output is objectively better, but it's technically a BC break.

Was this intentional, and are we fine letting this change stand?

-Sara
Nikita Popov
Re: [PHP-DEV] Minor BC break in gettype()
November 18, 2017 11:30AM
On Sat, Nov 18, 2017 at 10:17 AM, Sara Golemon <[email protected]> wrote:

> https://3v4l.org/kRON7
>
> https://github.com/php/php-src/commit/f00d1c72b4dbaf3532569d20efc1da
> 7c408605d6
>
> The above patch optimizes calls to gettype() into an opcode, however the
> strings returned for closed resources has changed relative to 7.1 and
> earlier.
>
> The newer output is objectively better, but it's technically a BC break.
>
> Was this intentional, and are we fine letting this change stand?
>
> -Sara


This is unrelated to the linked optimizations: The change was introduced in
https://github.com/php/php-src/commit/34824b70f8e72b200d77957145bb61883b03322d
and discussed as part of https://externals.io/message/94434. Another change
from the same thread is that is_object() now returns true for all objects,
including those of incomplete classes.

Nikita
Björn Larsson
Re: [PHP-DEV] Minor BC break in gettype()
November 18, 2017 02:00PM
Den 2017-11-18 kl. 10:17, skrev Sara Golemon:
> https://3v4l.org/kRON7
>
> https://github.com/php/php-src/commit/f00d1c72b4dbaf3532569d20efc1da7c408605d6
>
> The above patch optimizes calls to gettype() into an opcode, however the strings returned for closed resources has changed relative to 7.1 and earlier.
>
> The newer output is objectively better, but it's technically a BC break.
>
> Was this intentional, and are we fine letting this change stand?
>
> -Sara
It's intentional and in my eyes it should stand.

Alternative to write an RFC and / or wait for 8.0 seems a bit
more far fetched.

r//Björn Larsson

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Dmitry Stogov
[PHP-DEV] Re: Minor BC break in gettype()
November 20, 2017 08:20AM
I think PHP 7.2 is a good place for these minor break.


Dmitry.

________________________________
From: Sara Golemon <[email protected]>
Sent: Saturday, November 18, 2017 12:17:24 PM
To: Dmitry Stogov; internals@lists.php.net
Subject: Minor BC break in gettype()

https://3v4l.org/kRON7

https://github.com/php/php-src/commit/f00d1c72b4dbaf3532569d20efc1da7c408605d6

The above patch optimizes calls to gettype() into an opcode, however the strings returned for closed resources has changed relative to 7.1 and earlier..

The newer output is objectively better, but it's technically a BC break.

Was this intentional, and are we fine letting this change stand?

-Sara
Sara Golemon
[PHP-DEV] Re: Minor BC break in gettype()
November 20, 2017 09:40PM
Good enough for me. Thanks!

On Mon, Nov 20, 2017 at 2:13 AM, Dmitry Stogov <[email protected]> wrote:
> I think PHP 7.2 is a good place for these minor break.
>
>
> Dmitry.
>
> ________________________________
> From: Sara Golemon <[email protected]>
> Sent: Saturday, November 18, 2017 12:17:24 PM
> To: Dmitry Stogov; internals@lists.php.net
> Subject: Minor BC break in gettype()
>
> https://3v4l.org/kRON7
>
> https://github.com/php/php-src/commit/f00d1c72b4dbaf3532569d20efc1da7c408605d6
>
> The above patch optimizes calls to gettype() into an opcode, however the
> strings returned for closed resources has changed relative to 7.1 and
> earlier.
>
> The newer output is objectively better, but it's technically a BC break.
>
> Was this intentional, and are we fine letting this change stand?
>
> -Sara

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login