Repository navigation
Language: resource as array subject matches Zend dim semantics (#30028) - #30038
Merged
Merged
Conversation
Dim read warns and yields null, write raises the scalar-as-array Error, and isset/empty stay soft — not "Cannot use object of type Resource as array". Co-authored-by: Cursor <cursoragent@cursor.com>
Wire Warning+null reads, scalar-as-array write Errors, and soft isset/empty for Resource containers. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
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
Resourcecontainer emits Zend's Warning (Trying to access array offset on resourceunder PROFILE≥8.3) and yieldsnull, instead ofError: Cannot use object of type Resource as array.Cannot use a scalar value as an array;isset/emptystay soft (false/true).lib/VM.php,ErrorReporter, andVmEmptyDimension— no newruntime/C.Closes #30028
Test plan
export PHP_COMPILER_PROFILE=8.4 php -d error_reporting=E_ALL -d display_errors=1 bin/vm.php /tmp/res_dim.php php -d error_reporting=E_ALL -d display_errors=1 bin/jit.php /tmp/res_dim.phpNULL→Error:Cannot use a scalar value as an array→false/truephp vendor/bin/phpunit test/unit/ResourceDimFetchTest.phpphp vendor/bin/phpunit test/compliance/ResourceDimFetch30028VMTest.phpphp vendor/bin/phpunit test/compliance/ResourceDimFetch30028JITTest.phpci-local/ compliance suite / differential-sweepMade with Cursor