forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcache_slot.phpt
58 lines (47 loc) · 963 Bytes
/
cache_slot.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--TEST--
Cache slot test
--EXTENSIONS--
xmlreader
--FILE--
<?php
class Test1 {
function __construct(public string $localName) {}
}
#[AllowDynamicProperties]
class Test2 extends XMLReader {
}
function readLocalName($obj) {
for ($i = 0; $i < 2; $i++)
var_dump($obj->localName);
}
function readTestProp($obj) {
for ($i = 0; $i < 2; $i++)
var_dump($obj->testProp);
}
$reader = XMLReader::fromString("<root/>");
$reader->read();
$test1 = new Test1("hello");
readLocalName($reader);
readLocalName($test1);
readLocalName($reader);
$test2 = new Test2;
$test2->testProp = 1;
readTestProp($test2);
readTestProp($reader);
readTestProp($test2);
?>
--EXPECTF--
string(4) "root"
string(4) "root"
string(5) "hello"
string(5) "hello"
string(4) "root"
string(4) "root"
int(1)
int(1)
Warning: Undefined property: XMLReader::$testProp in %s on line %d
NULL
Warning: Undefined property: XMLReader::$testProp in %s on line %d
NULL
int(1)
int(1)