summaryrefslogtreecommitdiff
path: root/Zend/tests/int_static_prop_name.phpt
blob: cb47bb6d0a83016f50045ec04ae2f4b2f3e4afa7 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--TEST--
Using an integer as a static property name
--FILE--
<?php

class Foo {
    public static $bar = 42;
}

$n = 42;

${42} = 24;
var_dump(${42});
var_dump(${(int) 42});
var_dump(${(int) $n});

try {
    var_dump(Foo::${42});
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

try {
    var_dump(Foo::${(int) 42});
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

try {
    var_dump(Foo::${(int) $n});
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
int(24)
int(24)
int(24)
Access to undeclared static property: Foo::$42
Access to undeclared static property: Foo::$42
Access to undeclared static property: Foo::$42