Language: class_alias allows internal class originals like Zend (#29084) - #29106
Merged
Merged
Conversation
Remove the over-broad ValueError from #18300 so aliasing stdClass/Exception matches php-src; duplicate names still warn and return false. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
class_alias('stdClass', $fresh)/Exceptionreturntrueand instantiate correctly (php-srczif_class_alias).ValueErrorfrom Stdlib: class_alias('stdClass','stdClass') ValueError not Warning (#18290) #18300 inContext::registerClassAliasand JITObject_::registerClassAlias.class_alias('stdClass', 'stdClass')now matches Zend: Warning +false(not ValueError).Test plan
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/issue_29084_class_alias_internal.php'bin/jit.phpvendor/bin/phpunit test/unit/ClassAliasInternal29084Test.php→ OK (2 tests)class_alias_internal,class_alias_internal_duplicate, warnings, enum TypeError viabin/vm.phpVMTestdata-provider is currently broken on master by unrelated--EXTENSIONS--PHPTs (method_property_exists_string_autoload_jit,is_a_subclass_string_autoload_jit); compliance.phptfiles updated for when that clears.php-src
Zend/zend_builtin_functions.c—PHP_FUNCTION(class_alias)Gate snapshot (pre-claim)
bootstrap-selfhost-link: partial — stale gen-0 drivers, fell back to Zend gen-0 compile ofcompiler_minimal(long-running; stopped after recording symptom).--checkexit 0.Made with Cursor