Z_TRY_ADDREF_P(prop_value);
doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
- zend_type_copy_ctor(&property_info->type, /* persistent */ 0);
- new_prop = zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, property_info->type);
+ zend_type type = property_info->type;
+ zend_type_copy_ctor(&type, /* persistent */ 0);
+ new_prop = zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, type);
if (property_info->attributes) {
new_prop->attributes = property_info->attributes;
--- /dev/null
+--TEST--
+Various tests that need an opcache_compile_file() indirected preload file
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.preload={PWD}/preload_ind.inc
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
+?>
+--FILE--
+OK
+--EXPECTF--
+Warning: Can't preload class C with unresolved property types in %s on line %d
+OK