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.
-----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
Remi.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlTwJ3YACgkQYUppBSnxahgrdgCePafbNJvGFPl5lAp4gQA0xbZj
IzwAoI4usnexubkVh7S0HTpIA8cT8B7c
=PLcI
-----END PGP SIGNATURE
Am 27.02.2015 um 09:14 schrieb Remi Collet:
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. :-/
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 athttps://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:0I 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
On 27 February 2015 at 08:06, Sebastian Bergmann sebastian@php.net
wrote: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 athttps://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:0I 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
Maybe Related to Reflection Accesibility? I suppose PHPUnit acceses the
private state somehow.
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
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 athttps://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/
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 athttps://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:0I 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?
seems works always consistently same since PHP5
thanks
--
--
Xinchen Hui
@Laruence
http://www.laruence.com/
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 :-/
Hey:
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 Rethanswhich 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/
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.
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:
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 Rethanswhich 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 Rethanswhich 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 :-/