HomePhabricator

Add a linter rule to prevent the __lambda_func function from being redeclared

Description

Add a linter rule to prevent the __lambda_func function from being redeclared

Summary:
See http://phpsadness.com/sad/39. Declaring a function named __lambda_func prevents the create_function function from working. This is because create_function eval-declares the function __lambda_func, then modifies the symbol table so that the function is instead named "\0lambda_".(++$i), and returns that name.

NOTE: Personally, I don't think that anyone should use create_function. However, despite this, I think it is reasonable that no function is named __lambda_func in case some external library relies on create_function.

Test Plan: Added test case.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12870