Skip to content

Commit 86803e5

Browse files
8.5 take 1
1 parent 9c0b48e commit 86803e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

custom_cast.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,27 @@ static void ensure_class_has_interface(zend_class_entry *scope) {
375375
scope->interface_names = newInterfaceSet;
376376
}
377377

378+
#if PHP_VERSION_ID < 80500
378379
static void validate_custom_castable(
379380
zend_attribute *attr, uint32_t target, zend_class_entry *scope)
381+
#else
382+
static zend_string *validate_custom_castable(
383+
zend_attribute *attr, uint32_t target, zend_class_entry *scope)
384+
#endif
380385
{
381386
const char *error = require_user_class(scope->ce_flags);
382387
if (error != NULL) {
388+
#if PHP_VERSION_ID < 80500
383389
zend_error_noreturn(E_ERROR, error);
390+
#else
391+
return zend_string_init(error, strlen(error), 0);
392+
#endif
384393
}
385394
ensure_class_has_interface(scope);
386395
scope->default_object_handlers = &custom_cast_obj_handlers;
396+
#if PHP_VERSION_ID >= 80500
397+
return NULL;
398+
#endif
387399
}
388400

389401
static void setup_CustomCastable_as_attribute(zend_class_entry *class_entry) {

0 commit comments

Comments
 (0)