HomePhorge

Fix static variable usage in Lisk

Description

Fix static variable usage in Lisk

Summary:
See comment.
This can reveal some pretty bad bugs but HPHP handles this correctly so we already know about them.

Test Plan:
Added phlog() to __call() and observed what is defined for each method (under PHP). Also:

class C {
  function __call($name, $args) {
    static $class;
    if (!$class) {
      $class = get_class($this);
    }
    return $class;
  }
}

class D extends C {
}

class E extends C {
}

$d = new D;
$e = new E;
var_dump($d->x());
var_dump($e->x()); // Prints D under PHP!

See also D3754.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1261

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

Details

Provenance
vranaAuthored on Oct 19 2012, 5:43 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP7b0c608df8f2: Fix symbol search in typeahead
Branches
Unknown
Tags
Unknown

Event Timeline