Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
PHP
/
Data types
A function is declared in a file that has strict_types=1, but a non-strict file calls it …
from Data types
PHP 8.3.33
intermediate
1 min
A function is declared in a file that has strict_types=1, but a non-strict file calls it with numeric strings for int parameters. Which rule applies?
The caller's coercive rule applies, so the strings may be converted before entry.
The declaration file forces strict arguments for every caller.
strict_types affects return values only.
PHP ignores scalar declarations across files.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the quantity parser
Spot the bug
A new version is available
Reload