Permalink
Browse files

fix bug #63982: isset() inconsistently produces a fatal error on prot…

…ected property
  • Loading branch information...
1 parent c6203da commit 1a96fe0b3260b4b63627cf69d71a5b350ad3163f @smalyshev smalyshev committed Jan 14, 2013
Showing with 18 additions and 1 deletion.
  1. +2 −0 NEWS
  2. +15 −0 Zend/tests/bug63982.phpt
  3. +1 −1 Zend/zend_object_handlers.c
View
@@ -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)
@@ -0,0 +1,15 @@
+--TEST--
+Bug #63982 (isset() inconsistently produces a fatal error on protected property)
+--FILE--
+<?php
+class Test {
+ protected $protectedProperty;
+}
+
+$test = new Test();
+
+var_dump(isset($test->protectedProperty));
+var_dump(isset($test->protectedProperty->foo));
+--EXPECTF--
+bool(false)
+bool(false)
@@ -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) &&

0 comments on commit 1a96fe0

Please sign in to comment.