Page MenuHomePhabricator

Undeclared variable lint doesn't work at top-level scope
Open, NormalPublic

Description

No linter errors are raised for the following code:

<?php
echo $x;

Event Timeline

joshuaspence claimed this task.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Lint.
joshuaspence added a subscriber: joshuaspence.

In the general case, there are approximately one hundred trillion PHP files out there which do this:

<?php

include 'lib.php';
echo $g_coolGlobal;

...so we should consider require/include to be scope poison (i.e., make following scope unknowable) if we don't already.

It seems that LINT_NAMING_CONVENTIONS doesn't work at the top level scope either.