This is an error 404
There are `0` results
preferences:
153.95 ms | 1403 KiB | 7 Q<?php
class FooSingleton extends BarSingleton
{
private $foo_instance;
public static function getInstance()
{
if (!self::$foo_instance) {
self::$foo_instance = new self;
}
}
}
class BarSingleton
{
private $bar_instance;
public static function getInstance()
{
if (!self::$bar_instance) {
// Defer to FooSingleton
self::$bar_instance = parent::getInstance();
}
}
}
$foo = FooSingleton::getInstance();
$bar = BarSingleton::getInstance();
// This should be true
var_dump($foo === $bar);