Page MenuHomePhabricator

Detect the use of undefined magic constants
Closed, ResolvedPublic

Description

PHP has a bunch of magic constants (such as __FILE__ and __DIR__). The use of these constants can possibly cause issues if the magic constant does not exist in the targeted PHP version. For example, __DIR__ wasn't introduced until PHP 5.3.0 but there is no linter step which checks whether __DIR__ is used in rP, rARC or rPHU (all of which target PHP 5.2.3).

It should be reasonably straight-forward to add these magic constants to resources/php_compat_info.json (which lives in rPHU) so that we can detect this stuff during linting.

Revisions and Commits

Restricted Differential Revision

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 subscriber: joshuaspence.
joshuaspence triaged this task as Wishlist priority.Oct 12 2014, 8:11 PM
joshuaspence added a revision: Restricted Differential Revision.Jan 14 2015, 11:56 AM
joshuaspence closed this task as Resolved by committing Restricted Diffusion Commit.Jan 14 2015, 7:56 PM
joshuaspence added a commit: Restricted Diffusion Commit.