Archive: Namaste PHP AMQP framework v1.0 (2017-2020)

952 days continuous production uptime, 40k+ tp/s single node.
Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
2026-04-05 09:49:30 -07:00
commit 373ebc8c93
1284 changed files with 409372 additions and 0 deletions

41
stubs/testSingleton.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/**
* point of this stub is to show that explicit return values have no impact in static singleton class instantiation
*/
class foo {
private $bar = 0;
private static $instance;
private function __construct($_which)
{
static::$instance = null;
switch ($_which) {
case 1 :
return true;
break;
case 2 :
return false;
break;
default :
return null;
break;
}
}
public static function getInstance($_w)
{
if (static::$instance === null) {
$c = __CLASS__;
static::$instance = new $c($_w);
}
return(static::$instance);
}
}
$bar = foo::getInstance(1);
var_export($bar);
$bar = foo::getInstance(2);
var_export($bar);
$bar = foo::getInstance(0);
var_export($bar);