Skip to content

Commit f9170fc

Browse files
bjoriderickr
authored andcommitted
Get the zend_string value
1 parent e8ba12b commit f9170fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bson.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void object_to_bson(zval *object, php_phongo_bson_flags_t flags, const char *key
760760
if (Z_TYPE(obj_data) != IS_ARRAY && !(Z_TYPE(obj_data) == IS_OBJECT && instanceof_function(Z_OBJCE(obj_data), zend_standard_class_def TSRMLS_CC))) {
761761
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC,
762762
"Expected %s::%s() to return an array or stdClass, %s given",
763-
Z_OBJCE_P(object)->name,
763+
Z_OBJCE_P(object)->name->val,
764764
BSON_SERIALIZE_FUNC_NAME,
765765
(Z_TYPE(obj_data) == IS_OBJECT
766766
? Z_OBJCE(obj_data)->name->val
@@ -1016,7 +1016,11 @@ PHONGO_API void zval_to_bson(zval *data, php_phongo_bson_flags_t flags, bson_t *
10161016
#endif
10171017
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC,
10181018
"Expected %s::%s() to return an array or stdClass, %s given",
1019-
Z_OBJCE_P(data)->name,
1019+
#if PHP_VERSION_ID >= 70000
1020+
Z_OBJCE_P(data)->name->val,
1021+
#else
1022+
Z_OBJCE_P(data)->name->val,
1023+
#endif
10201024
BSON_SERIALIZE_FUNC_NAME,
10211025
#if PHP_VERSION_ID >= 70000
10221026
(Z_TYPE(obj_data) == IS_OBJECT

0 commit comments

Comments
 (0)