blob: 94620f6569c1435bb7b11f574de18c4ebeeb6a65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--TEST--
testing static access for methods and properties in anon classes
--FILE--
<?php
$anonClass = new class("cats", "dogs") {
public static $foo;
private static $bar;
public function __construct($foo, $bar) {
static::$foo = $foo;
static::$bar = $bar;
}
public static function getBar() {
return static::$bar;
}
};
var_dump($anonClass::$foo);
var_dump($anonClass::getBar());
?>
--EXPECT--
string(4) "cats"
string(4) "dogs"
|