From c6203da6c26439ed698193f71e3983be74a4545b Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 13 Jan 2013 16:34:35 -0800 Subject: [PATCH 1/2] different OSes have different messages, and that's not what the test is about anyway --- Zend/tests/bug30998.phpt | 4 ++-- Zend/tests/bug60909_1.phpt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zend/tests/bug30998.phpt b/Zend/tests/bug30998.phpt index d0ace9fa16d..032da3d3bcc 100644 --- a/Zend/tests/bug30998.phpt +++ b/Zend/tests/bug30998.phpt @@ -15,7 +15,7 @@ $f = fopen("/tmp/blah", "r"); ?> ===DONE=== --EXPECTF-- -fopen(/tmp/blah): failed to open stream: No such file or directory (2) in %s:%d +fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d -Warning: fopen(/tmp/blah): failed to open stream: No such file or directory in %s on line %d +Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d ===DONE=== diff --git a/Zend/tests/bug60909_1.phpt b/Zend/tests/bug60909_1.phpt index 5150dfc025c..cfe42892870 100644 --- a/Zend/tests/bug60909_1.phpt +++ b/Zend/tests/bug60909_1.phpt @@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){ require 'notfound.php'; --EXPECTF-- -error(require(notfound.php): failed to open stream: No such file or directory) +error(require(notfound.php): failed to open stream: %s) Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5 Stack trace: #0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array) From 1a96fe0b3260b4b63627cf69d71a5b350ad3163f Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 13 Jan 2013 17:08:52 -0800 Subject: [PATCH 2/2] fix bug #63982: isset() inconsistently produces a fatal error on protected property --- NEWS | 2 ++ Zend/tests/bug63982.phpt | 15 +++++++++++++++ Zend/zend_object_handlers.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug63982.phpt diff --git a/NEWS b/NEWS index cfc0fa994b7..28040f7262f 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2012, PHP 5.4.12 - Core: + . Fixed bug #63982 (isset() inconsistently produces a fatal error on + protected property). (Stas) . Fixed bug #63943 (Bad warning text from strpos() on empty needle). (Laruence) . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry) diff --git a/Zend/tests/bug63982.phpt b/Zend/tests/bug63982.phpt new file mode 100644 index 00000000000..31294f33e8d --- /dev/null +++ b/Zend/tests/bug63982.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #63982 (isset() inconsistently produces a fatal error on protected property) +--FILE-- +protectedProperty)); +var_dump(isset($test->protectedProperty->foo)); +--EXPECTF-- +bool(false) +bool(false) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 3881c0e8708..2c2a45d7267 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -435,7 +435,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li #endif /* make zend_get_property_info silent if we have getter - we may want to use it */ - property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC); + property_info = zend_get_property_info_quick(zobj->ce, member, silent || (zobj->ce->__get != NULL), key TSRMLS_CC); if (UNEXPECTED(!property_info) || ((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&