Skip to content

Instantly share code, notes, and snippets.

@sreed-ontraport
Created August 1, 2013 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sreed-ontraport/6134324 to your computer and use it in GitHub Desktop.
Save sreed-ontraport/6134324 to your computer and use it in GitHub Desktop.
PHP Bug - Segfault in gc_zval_possible_root
<?php
class ParentClass
{
private static $_OBJECTS;
public static function Get()
{
self::$_OBJECTS[1] = new ChildClass();
return self::$_OBJECTS[1];
}
}
class ChildClass extends ParentClass
{
public $Manager;
function __construct()
{
$this->Manager = $this;
}
public static function &GetCurrent()
{
return ChildClass::Get();
}
public static function &Get()
{
return parent::Get();
}
}
$staff = ChildClass::GetCurrent();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment