G
YouTube TikTok Games
Skip to content

Reject count() on statically known scalar types - #1716

Open
localzet wants to merge 1 commit into
VKCOM:masterfrom
localzet:fix-count-non-countable-types-77
Open

localzet wants to merge 1 commit into
VKCOM:masterfrom
localzet:fix-count-non-countable-types-77

Conversation

@localzet

Copy link
Copy Markdown

Related to #77.

Reject statically known scalar arguments to count() and
sizeof() during compilation instead of emitting runtime warnings.

Use get_real_ptype() to account for the internal representation
of null and false.

Preserve existing behavior for arrays, tuples and mixed values.

Add regression tests covering invalid scalar arguments,
null, false, sizeof() and valid array arguments.

PHP fixture syntax checks passed. The KPHP test suite
has not been run locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant