@@ -527,7 +527,7 @@ zend_object *ClassImpl::cloneObject(zval *val)
527
527
// a copy constructor). Because this function is directly called from the
528
528
// Zend engine, we can call zend_error() (which does a longjmp()) to throw
529
529
// an exception back to the Zend engine)
530
- if (!cpp) zend_error (E_ERROR, " Unable to clone %s" , entry->name );
530
+ if (!cpp) zend_error (E_ERROR, " Unable to clone %s" , entry->name -> val );
531
531
532
532
// store the object
533
533
auto *new_object = new ObjectImpl (entry, cpp, impl->objectHandlers (), 1 );
@@ -915,7 +915,7 @@ zval *ClassImpl::readProperty(zval *object, zval *name, int type, void **cache_s
915
915
* @param cache_slot The cache slot used
916
916
* @return zval
917
917
*/
918
- void ClassImpl::writeProperty (zval *object, zval *name, zval *value, void **cache_slot)
918
+ PHP_WRITE_PROP_HANDLER_TYPE ClassImpl::writeProperty (zval *object, zval *name, zval *value, void **cache_slot)
919
919
{
920
920
// retrieve the object and class
921
921
Base *base = ObjectImpl::find (object)->object ();
@@ -946,7 +946,13 @@ void ClassImpl::writeProperty(zval *object, zval *name, zval *value, void **cach
946
946
else
947
947
{
948
948
// check if it could be set
949
- if (iter->second ->set (base, value)) return ;
949
+ if (iter->second ->set (base, value)) {
950
+ #if PHP_VERSION_ID >= 70400
951
+ return value;
952
+ #else
953
+ return ;
954
+ #endif
955
+ }
950
956
951
957
// read-only property
952
958
zend_error (E_ERROR, " Unable to write to read-only property %s" , (const char *)key);
@@ -955,16 +961,30 @@ void ClassImpl::writeProperty(zval *object, zval *name, zval *value, void **cach
955
961
catch (const NotImplemented &exception )
956
962
{
957
963
// __set() function was not overridden by user, check if there is a default
958
- if (!std_object_handlers.write_property ) return ;
964
+ if (!std_object_handlers.write_property ) {
965
+ #if PHP_VERSION_ID >= 70400
966
+ return value;
967
+ #else
968
+ return ;
969
+ #endif
970
+ }
959
971
960
972
// call the default
961
973
std_object_handlers.write_property (object, name, value, cache_slot);
974
+ #if PHP_VERSION_ID >= 70400
975
+ return value;
976
+ #else
977
+ return ;
978
+ #endif
962
979
}
963
980
catch (Throwable &throwable)
964
981
{
965
982
// object was not caught by the extension, let it end up in user space
966
983
throwable.rethrow ();
967
984
}
985
+ #if PHP_VERSION_ID >= 70400
986
+ return value;
987
+ #endif
968
988
}
969
989
970
990
/* *
@@ -1150,7 +1170,7 @@ zend_object *ClassImpl::createObject(zend_class_entry *entry)
1150
1170
// report error on failure, because this function is called directly from the
1151
1171
// Zend engine, we can call zend_error() here (which does a longjmp() back to
1152
1172
// the Zend engine)
1153
- if (!cpp) zend_error (E_ERROR, " Unable to instantiate %s" , entry->name );
1173
+ if (!cpp) zend_error (E_ERROR, " Unable to instantiate %s" , entry->name -> val );
1154
1174
1155
1175
// create the object in the zend engine
1156
1176
auto *object = new ObjectImpl (entry, cpp, impl->objectHandlers (), 1 );
0 commit comments