Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Trying to retrieve an array element with "false" as index should raise an error in strict mode

Open
#275 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
devtools

Research direction

Start with the PHPStan playground example linked in the issue and inspect how the strict rules handle array access. Determine where a false index is analyzed, then verify that strict mode reports an error for this case without changing non-strict behavior.

Written by the indexing model from the issue text.

Description

Feature request

Hello,

It would be nice that PHPStan raise an erreur in strict mode when trying to access an array element with "false" as index.

See
https://phpstan.org/r/1f14913d-366e-4b45-9b4b-e747fc48b7dd

Best regards,
Eric

Did PHPStan help you today? Did it make you happy in any way?

No response

Dominant language
PHP
Stars
711
Forks
62
Avg merge
3d 14h
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpstan/phpstan-strict-rules

All issues in phpstan/phpstan-strict-rules

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.