- Fixed bug #50152 (ReflectionClass::hasProperty hehaves like isset() not
property_exists). (Felipe)
+- Fixed bug #50146 (property_exists: Closure object cannot have properties).
+ (Felipe)
- Fixed bug #50073 (parse_url() incorrect when ? in fragment). (Ilia)
- Fixed bug #50023 (pdo_mysql doesn't use PHP_MYSQL_UNIX_SOCK_ADDR). (Ilia)
- Fixed bug #49908 (throwing exception in __autoload crashes when interface
--- /dev/null
+--TEST--
+Bug #50146 (property_exists: Closure object cannot have properties)
+--FILE--
+<?php
+
+$obj = function(){};
+
+var_dump(property_exists($obj,'foo'));
+
+$ref = new ReflectionObject($obj);
+var_dump($ref->hasProperty('b'));
+
+var_dump(isset($obj->a));
+
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+
+Catchable fatal error: Closure object cannot have properties in %s on line %d
static int zend_closure_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
{
- ZEND_CLOSURE_PROPERTY_ERROR();
+ if (has_set_exists != 2) {
+ ZEND_CLOSURE_PROPERTY_ERROR();
+ }
return 0;
}
/* }}} */