# BC break between PHP 5.6.5 and PHP 5.6.6

- Thread: https://externals.io/message/83972
- Original archive: https://news-web.php.net/php.internals/83972
- Started by Sebastian Bergmann on 2015-02-27T08:06:43+00:00
- Messages: 12
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #83972 — Sebastian Bergmann — 2015-02-27T08:06:43+00:00

URL: https://externals.io/message/83972#83972

While working on PHPUnit today I noticed one test of its own test
 suite failing on PHP 5.6.6 that passes on PHP 5.6.5. The details of
 this can be found at

   https://github.com/sebastianbergmann/phpunit/issues/1630

 Florian Margaine reduced the problem to the following minimal,
 self-contained, reproducing script:

     1 <?php
     2 class Foo extends Exception
     3 {
     4     public function __construct()
     5     {
     6         $this->code = 123;
     7     }
     8 }
     9
    10 try
    11 {
    12     throw new Foo;
    13 }
    14
    15 catch (Exception $e)
    16 {
    17     assert($e->code === 123);
    18 }

 The above script works as expected on PHP 5.6.5 but errors out on
 PHP 5.6.6:

   PHP Fatal error: Cannot access protected property Foo::$code in
   /home/sb/exception.php on line 17
   PHP Stack trace:
   PHP   1. {main}() /home/sb/exception.php:0

 I do not see a change in http://php.net/ChangeLog-5.php#5.6.6 that would
 explain this.

---

## #83974 — Remi Collet — 2015-02-27T08:14:47+00:00

URL: https://externals.io/message/83972#83974 · In reply to: #83972

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 27/02/2015 09:06, Sebastian Bergmann a écrit :
> While working on PHPUnit today I noticed one test of its own test 
> suite failing on PHP 5.6.6 that passes on PHP 5.6.5. The details
> of this can be found at
> 
> https://github.com/sebastianbergmann/phpunit/issues/1630

Hmmm http://3v4l.org/QST64



Remi.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlTwJ3YACgkQYUppBSnxahgrdgCePafbNJvGFPl5lAp4gQA0xbZj
IzwAoI4usnexubkVh7S0HTpIA8cT8B7c
=PLcI
-----END PGP SIGNATURE

---

## #83975 — Leigh — 2015-02-27T08:20:46+00:00

URL: https://externals.io/message/83972#83975 · In reply to: #83972

>  While working on PHPUnit today I noticed one test of its own test
>  suite failing on PHP 5.6.6 that passes on PHP 5.6.5. The details of
>  this can be found at
>
>    https://github.com/sebastianbergmann/phpunit/issues/1630
>
>  Florian Margaine reduced the problem to the following minimal,
>  self-contained, reproducing script:
>
>      1 <?php
>      2 class Foo extends Exception
>      3 {
>      4     public function __construct()
>      5     {
>      6         $this->code = 123;
>      7     }
>      8 }
>      9
>     10 try
>     11 {
>     12     throw new Foo;
>     13 }
>     14
>     15 catch (Exception $e)
>     16 {
>     17     assert($e->code === 123);
>     18 }
>
>  The above script works as expected on PHP 5.6.5 but errors out on
>  PHP 5.6.6:
>
>    PHP Fatal error: Cannot access protected property Foo::$code in
>    /home/sb/exception.php on line 17
>    PHP Stack trace:
>    PHP   1. {main}() /home/sb/exception.php:0
>
>  I do not see a change in http://php.net/ChangeLog-5.php#5.6.6 that would
>  explain this.

Looking through git blames, this property has been protected for a long time.

Possibly related (although not at all sure), Dmitry made some changes
to zend_read_property()

https://github.com/php/php-src/commit/3e31838d19750d287431d22e9290856ec962fd6a

---

## #83976 — Benjamin Eberlei — 2015-02-27T08:24:06+00:00

URL: https://externals.io/message/83972#83976 · In reply to: #83975

> On 27 February 2015 at 08:06, Sebastian Bergmann <sebastian@php.net>
> wrote:
> > […]
> would
> > […]
>
> Looking through git blames, this property has been protected for a long
> time.
>
> Possibly related (although not at all sure), Dmitry made some changes
> to zend_read_property()
>
>
> https://github.com/php/php-src/commit/3e31838d19750d287431d22e9290856ec962fd6a


Maybe Related to Reflection Accesibility? I suppose PHPUnit acceses the
private state somehow.

---

## #83977 — Sebastian Bergmann — 2015-02-27T08:26:07+00:00

URL: https://externals.io/message/83972#83977 · In reply to: #83974

Am 27.02.2015 um 09:14 schrieb Remi Collet:
> Hmmm http://3v4l.org/QST64

 No clue why PHP 5.6.5 seems to have worked for that reproducing script
 here earlier. Tried it again and, of course, it also fails with "my"
 PHP 5.6.5.

 Looks the like the reproducing script was not the right one. :-/

---

## #83978 — Matteo Beccati — 2015-02-27T08:28:10+00:00

URL: https://externals.io/message/83972#83978 · In reply to: #83972

>   While working on PHPUnit today I noticed one test of its own test
>   suite failing on PHP 5.6.6 that passes on PHP 5.6.5. The details of
>   this can be found at
>
>     https://github.com/sebastianbergmann/phpunit/issues/1630

It's actually very weird. As you know I'm monitoring a few key projects 
and running their test suites every day with the latest 5.4 to 7.

The test is not failing here:

https://revive.beccati.com/bamboo/browse/PHP-PHPUN-PHP56-283/test/case/11819608


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

---

## #83979 — Leigh — 2015-02-27T08:28:36+00:00

URL: https://externals.io/message/83972#83979 · In reply to: #83975

> Looking through git blames, this property has been protected for a long time.
>
> Possibly related (although not at all sure), Dmitry made some changes
> to zend_read_property()
>
> https://github.com/php/php-src/commit/3e31838d19750d287431d22e9290856ec962fd6a

I'm an idiot, this change was in master, not 5.6

---

## #83980 — Xinchen Hui — 2015-02-27T08:30:22+00:00

URL: https://externals.io/message/83972#83980 · In reply to: #83972

Hey:


>  While working on PHPUnit today I noticed one test of its own test
>  suite failing on PHP 5.6.6 that passes on PHP 5.6.5. The details of
>  this can be found at
>
>    https://github.com/sebastianbergmann/phpunit/issues/1630
>
>  Florian Margaine reduced the problem to the following minimal,
>  self-contained, reproducing script:
>
>      1 <?php
>      2 class Foo extends Exception
>      3 {
>      4     public function __construct()
>      5     {
>      6         $this->code = 123;
>      7     }
>      8 }
>      9
>     10 try
>     11 {
>     12     throw new Foo;
>     13 }
>     14
>     15 catch (Exception $e)
>     16 {
>     17     assert($e->code === 123);
>     18 }
>
>  The above script works as expected on PHP 5.6.5 but errors out on
>  PHP 5.6.6:
>
>    PHP Fatal error: Cannot access protected property Foo::$code in
>    /home/sb/exception.php on line 17
>    PHP Stack trace:
>    PHP   1. {main}() /home/sb/exception.php:0
>
>  I do not see a change in http://php.net/ChangeLog-5.php#5.6.6 that would
>  explain this.
>
maybe related to your own build?

http://3v4l.org/sD8SZ

seems works always consistently  same since PHP5

thanks
> --
> 
> 



-- 
Xinchen Hui
@Laruence
http://www.laruence.com/

---

## #83982 — Sebastian Bergmann — 2015-02-27T08:51:21+00:00

URL: https://externals.io/message/83972#83982 · In reply to: #83980

Am 27.02.2015 um 09:30 schrieb Xinchen Hui:
> maybe related to your own build?

 The test in the PHPUnit test suite fails with

   PHP 5.6.6 (cli) (built: Feb 19 2015 09:44:29)
   Copyright (c) 1997-2015 The PHP Group
   Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
       with Xdebug v2.3.1, Copyright (c) 2002-2015, by Derick Rethans

 which comes from

    Name        : php-cli
    Arch        : x86_64
    Version     : 5.6.6
    Release     : 1.fc21.remi
    Size        : 13 M
    Repo        : installed
    From repo   : remi
    Summary     : Command-line interface for PHP
    URL         : http://www.php.net/
    License     : PHP and Zend and BSD
    Description : The php-cli package contains the command-line interface
                : executing PHP scripts, /usr/bin/php, and the CGI
                  interface.

 The test in the PHPUnit test suite does not fail with

   /usr/local/php-5.6/bin/php -v
   PHP 5.6.5 (cli) (built: Feb 27 2015 08:26:15) (DEBUG)
   Copyright (c) 1997-2014 The PHP Group
   Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
       with Xdebug v2.3.0dev, Copyright (c) 2002-2013, by Derick Rethans

 which I have built from the PHP 5.6.5 tarball.

 The test in the PHPUnit test suite does not fail with

    /tmp/php-5.6.6/sapi/cli/php --version
    PHP 5.6.6 (cli) (built: Feb 27 2015 09:47:36)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

 which I have built from the PHP 5.6.6 tarball.

 Confusing :-/

---

## #83983 — Xinchen Hui — 2015-02-27T08:53:51+00:00

URL: https://externals.io/message/83972#83983 · In reply to: #83982

Hey:


> Am 27.02.2015 um 09:30 schrieb Xinchen Hui:
> > […]
>
>  The test in the PHPUnit test suite fails with
>
>    PHP 5.6.6 (cli) (built: Feb 19 2015 09:44:29)
>    Copyright (c) 1997-2015 The PHP Group
>    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
>        with Xdebug v2.3.1, Copyright (c) 2002-2015, by Derick Rethans
>
>  which comes from
>
>     Name        : php-cli
>     Arch        : x86_64
>     Version     : 5.6.6
>     Release     : 1.fc21.remi
>     Size        : 13 M
>     Repo        : installed
>     From repo   : remi
>     Summary     : Command-line interface for PHP
>     URL         : http://www.php.net/
>     License     : PHP and Zend and BSD
>     Description : The php-cli package contains the command-line interface
>                 : executing PHP scripts, /usr/bin/php, and the CGI
>                   interface.
>
>  The test in the PHPUnit test suite does not fail with
>
>    /usr/local/php-5.6/bin/php -v
>    PHP 5.6.5 (cli) (built: Feb 27 2015 08:26:15) (DEBUG)
>    Copyright (c) 1997-2014 The PHP Group
>    Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
>        with Xdebug v2.3.0dev, Copyright (c) 2002-2013, by Derick Rethans
I noticed different version of xdebug, could you try without it?

thanks
>
>  which I have built from the PHP 5.6.5 tarball.
>
>  The test in the PHPUnit test suite does not fail with
>
>     /tmp/php-5.6.6/sapi/cli/php --version
>     PHP 5.6.6 (cli) (built: Feb 27 2015 09:47:36)
>     Copyright (c) 1997-2015 The PHP Group
>     Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
>
>  which I have built from the PHP 5.6.6 tarball.
>
>  Confusing :-/
>
> --
> 
> 



-- 
Xinchen Hui
@Laruence
http://www.laruence.com/

---

## #83984 — Dmitry Stogov — 2015-02-27T08:56:24+00:00

URL: https://externals.io/message/83972#83984 · In reply to: #83982

check xdebug

Thanks. Dmitry.

On Fri, Feb 27, 2015 at 11:51 AM, Sebastian Bergmann <sebastian@php.net>
wrote:

> Am 27.02.2015 um 09:30 schrieb Xinchen Hui:
> > […]
>
>  The test in the PHPUnit test suite fails with
>
>    PHP 5.6.6 (cli) (built: Feb 19 2015 09:44:29)
>    Copyright (c) 1997-2015 The PHP Group
>    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
>        with Xdebug v2.3.1, Copyright (c) 2002-2015, by Derick Rethans
>
>  which comes from
>
>     Name        : php-cli
>     Arch        : x86_64
>     Version     : 5.6.6
>     Release     : 1.fc21.remi
>     Size        : 13 M
>     Repo        : installed
>     From repo   : remi
>     Summary     : Command-line interface for PHP
>     URL         : http://www.php.net/
>     License     : PHP and Zend and BSD
>     Description : The php-cli package contains the command-line interface
>                 : executing PHP scripts, /usr/bin/php, and the CGI
>                   interface.
>
>  The test in the PHPUnit test suite does not fail with
>
>    /usr/local/php-5.6/bin/php -v
>    PHP 5.6.5 (cli) (built: Feb 27 2015 08:26:15) (DEBUG)
>    Copyright (c) 1997-2014 The PHP Group
>    Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
>        with Xdebug v2.3.0dev, Copyright (c) 2002-2013, by Derick Rethans
>
>  which I have built from the PHP 5.6.5 tarball.
>
>  The test in the PHPUnit test suite does not fail with
>
>     /tmp/php-5.6.6/sapi/cli/php --version
>     PHP 5.6.6 (cli) (built: Feb 27 2015 09:47:36)
>     Copyright (c) 1997-2015 The PHP Group
>     Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
>
>  which I have built from the PHP 5.6.6 tarball.
>
>  Confusing :-/

---

## #83985 — Sebastian Bergmann — 2015-02-27T08:59:09+00:00

URL: https://externals.io/message/83972#83985 · In reply to: #83983

Am 27.02.2015 um 09:53 schrieb Xinchen Hui:
> I noticed different version of xdebug, could you try without it?

 Thank you for bringing Xdebug to my attention. You are right, it
 appears to be related to Xdebug.

 Without Xdebug

   $ php -v
   PHP 5.6.6 (cli) (built: Feb 19 2015 09:44:29)
   Copyright (c) 1997-2015 The PHP Group
   Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

 the test from PHPUnit's own test suite passes.

 With Xdebug

   $ php -v
   PHP 5.6.6 (cli) (built: Feb 19 2015 09:44:29)
   Copyright (c) 1997-2015 The PHP Group
   Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
       with Xdebug v2.3.1, Copyright (c) 2002-2015, by Derick Rethans

 the test from PHPUnit's own test suite fails.

 Sorry for the noise, time to bug Derick.
