Skip to content

Commit 6331ace

Browse files
committed
Merge branch 'v2.x' into fix_foreach
2 parents 3b4f176 + 85bd361 commit 6331ace

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

php_phongo.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ zend_object_handlers* phongo_get_std_object_handlers(void);
111111
zend_hash_init(props, 0, NULL, ZVAL_PTR_DTOR, 0); \
112112
_intern_extractor(zobj)->php_properties = props; \
113113
} \
114-
return zend_hash_find(props, member); \
114+
zval* ret = zend_hash_find(props, member); \
115+
if (ret) { \
116+
return ret; \
117+
} \
118+
return &EG(uninitialized_zval); \
115119
} \
116120
\
117121
static zval* php_phongo_##_name##_write_property(zend_object* zobj, zend_string* name, zval* value, void** cache_slot) \

tests/bson/bug2505_2.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PHPC-2505: Setting and unsetting a property may interfere with using foreach to
44
<?php
55
require_once __DIR__ . "/../utils/basic.inc";
66

7+
ini_set("error_reporting", E_ALL & ~E_DEPRECATED);
8+
79
$tests = [
810
[ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ],
911
[ 'dbpointer' => createDBPointer() ],

tests/bson/bug2505_3.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PHPC-2505: Setting and unsetting a property may interfere with using foreach to
44
<?php
55
require_once __DIR__ . "/../utils/basic.inc";
66

7+
ini_set("error_reporting", E_ALL & ~E_DEPRECATED);
8+
79
$tests = [
810
[ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ],
911
[ 'dbpointer' => createDBPointer() ],

0 commit comments

Comments
 (0)