Merge pull request #6 from yuan-dian/fix/union-type-arginfo-escape

fix(gen_stub): use toVarEscapedName for union type ZEND_TYPE_INIT_CLASS
master
韩天峰 1 week ago committed by GitHub
commit 4a9b918e7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      src/gen_stub.php

@ -2913,8 +2913,8 @@ abstract class VariableLike
$code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n"; $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->num_types = $classTypeCount;\n";
foreach ($arginfoType->classTypes as $k => $classType) { foreach ($arginfoType->classTypes as $k => $classType) {
$escapedClassName = $classType->toEscapedName(); $varEscapedClassName = $classType->toVarEscapedName();
$code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$escapedClassName}, 0, 0);\n"; $code .= "\t{$variableLikeType}_{$variableLikeName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS({$variableLikeType}_{$variableLikeName}_class_{$varEscapedClassName}, 0, 0);\n";
} }
$typeMaskCode = $this->type->toArginfoType()->toTypeMask(); $typeMaskCode = $this->type->toArginfoType()->toTypeMask();

Loading…
Cancel
Save