Page MenuHomePhabricator

Add a linter rule for detecting redeclared functions
Closed, InvalidPublic

Description

The following code does not raise any errors in linting:

<?php

function array_key_exists($key, array $array) {
    return true;
}

Running this code, however, will throw a fatal error:

PHP Fatal error:  Cannot redeclare array_key_exists()

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence triaged this task as Low priority.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

Simiarly:

<?php

function foo() {}
function foo() {}
joshuaspence claimed this task.

Actually, arc liberate can detect this already.