Skip to content

gen_stub.php does not correctly handle @not-serializable + final for legacy-arginfo #18506

Closed
@TimWolla

Description

@TimWolla

Description

The following code:

<?php
    /**
 * @generate-class-entries static
 * @generate-legacy-arginfo 80000
 * @undocumentable
 */
    /**
     * @not-serializable
     */
    final class Test {

    }

Resulted in this output:

static zend_class_entry *register_class_Test(void)
{
	zend_class_entry ce, *class_entry;

	INIT_CLASS_ENTRY(ce, "Test", NULL);
#if (PHP_VERSION_ID >= 80400)
	class_entry = zend_register_internal_class_with_flags(&ce, NULL, #if (PHP_VERSION_ID >= 80100)
ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE#elif (PHP_VERSION_ID >= 80000)
ZEND_ACC_FINAL#endif
);
#else
	class_entry = zend_register_internal_class_ex(&ce, NULL);
	class_entry->ce_flags |= #if (PHP_VERSION_ID >= 80100)
ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE#elif (PHP_VERSION_ID >= 80000)
ZEND_ACC_FINAL#endif
;
#endif

	return class_entry;
}

But I expected this output instead: Valid C code.

PHP Version

n/a

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions