Skip to content

Commit ccce826

Browse files
committed
Remove simple type specialization
1 parent edac779 commit ccce826

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

Zend/zend_exceptions_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static zend_class_entry *register_class_Exception(zend_class_entry *class_entry_
245245
zval property_previous_default_value;
246246
ZVAL_NULL(&property_previous_default_value);
247247
zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1);
248-
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 1, 0));
248+
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 0, MAY_BE_NULL));
249249
zend_string_release(property_previous_name);
250250

251251
return class_entry;
@@ -309,7 +309,7 @@ static zend_class_entry *register_class_Error(zend_class_entry *class_entry_Thro
309309
zval property_previous_default_value;
310310
ZVAL_NULL(&property_previous_default_value);
311311
zend_string *property_previous_name = zend_string_init("previous", sizeof("previous") - 1, 1);
312-
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 1, 0));
312+
zend_declare_typed_property(class_entry, property_previous_name, &property_previous_default_value, ZEND_ACC_PRIVATE, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_previous_class_Throwable, 0, MAY_BE_NULL));
313313
zend_string_release(property_previous_name);
314314

315315
return class_entry;

build/gen_stub.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,16 +1067,10 @@ function (Expr $expr) use (&$defaultValueConstant) {
10671067
$code .= "\tzend_type property_{$propertyName}_type = ZEND_TYPE_INIT_PTR(property_{$propertyName}_type_list, _ZEND_TYPE_LIST_BIT, 0, $typeMaskCode);\n";
10681068
$typeCode = "property_{$propertyName}_type";
10691069
} else {
1070-
$simpleType = $this->type->tryToSimpleType();
1071-
10721070
$className = $arginfoType->classTypes[0]->name;
10731071
$code .= "\tzend_string *property_{$propertyName}_class_{$className} = zend_string_init(\"$className\", sizeof(\"$className\")-1, 1);\n";
10741072

1075-
if ($simpleType) {
1076-
$typeCode = "(zend_type) ZEND_TYPE_INIT_CLASS(property_{$propertyName}_class_{$className}, " . ((int)$this->type->isNullable()) . ", 0)";
1077-
} else {
1078-
$typeCode = "(zend_type) ZEND_TYPE_INIT_CLASS(property_{$propertyName}_class_{$className}, 0, " . $arginfoType->toTypeMask() . ")";
1079-
}
1073+
$typeCode = "(zend_type) ZEND_TYPE_INIT_CLASS(property_{$propertyName}_class_{$className}, 0, " . $arginfoType->toTypeMask() . ")";
10801074
}
10811075
} else {
10821076
$typeCode = "(zend_type) ZEND_TYPE_INIT_MASK(" . $arginfoType->toTypeMask() . ")";

ext/zend_test/test_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static zend_class_entry *register_class__ZendTestClass(zend_class_entry *class_e
201201
zval property_classProp_default_value;
202202
ZVAL_NULL(&property_classProp_default_value);
203203
zend_string *property_classProp_name = zend_string_init("classProp", sizeof("classProp") - 1, 1);
204-
zend_declare_typed_property(class_entry, property_classProp_name, &property_classProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classProp_class_stdClass, 1, 0));
204+
zend_declare_typed_property(class_entry, property_classProp_name, &property_classProp_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_CLASS(property_classProp_class_stdClass, 0, MAY_BE_NULL));
205205
zend_string_release(property_classProp_name);
206206

207207
zend_string *property_classUnionProp_class_stdClass = zend_string_init("stdClass", sizeof("stdClass") - 1, 1);

0 commit comments

Comments
 (0)