1
0
mirror of https://github.com/php/php-src.git synced 2026-04-01 21:22:13 +02:00

Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix bug #63982: isset() inconsistently produces a fatal error on protected property
  different OSes have different messages, and that's not what the test is about anyway
This commit is contained in:
Stanislav Malyshev
2013-01-13 17:27:05 -08:00
4 changed files with 19 additions and 4 deletions

View File

@@ -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===

View File

@@ -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)

15
Zend/tests/bug63982.phpt Normal file
View File

@@ -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)

View File

@@ -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) &&