503f75d08b
These names don't make sense now that we run both suites the same way.
38 linhas
533 B
PHP
38 linhas
533 B
PHP
<?
|
|
|
|
class MyClass {
|
|
public static $x;
|
|
public static function foo() {
|
|
echo "in static method foo()\n";
|
|
}
|
|
};
|
|
|
|
function clsFact() {
|
|
return new MyClass();
|
|
}
|
|
|
|
// Cls :: [ String ] -> [ Class ]
|
|
MyClass::$x = 1;
|
|
|
|
// Any way to coerce the [ Obj ] -> [ Class ] variety?
|
|
$foo = new MyClass();
|
|
$varname = 'foo';
|
|
${$varname}::$x = 1;
|
|
|
|
// ClsH
|
|
$refs[] = clsFact();
|
|
$refs[] = 'MyClass';
|
|
$s = 'MyClass';
|
|
|
|
foreach($refs as $r) {
|
|
$r::foo();
|
|
}
|
|
|
|
$refs2[] = &$s;
|
|
$obj = clsFact();
|
|
$refs2[] = &$obj;
|
|
|
|
foreach($refs2 as $r) {
|
|
$r::foo();
|
|
}
|