File size: 735 Bytes
1e94262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
--TEST--
Bug #43344.1 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
use Error;

function f1($a=bar) {
    return $a;
}
function f2($a=array(bar)) {
    return $a[0];
}
function f3($a=array(bar=>0)) {
    reset($a);
    return key($a);
}

try {
    echo bar."\n";
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    echo f1()."\n";
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    echo f2()."\n";
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    echo f3()."\n";
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"
Undefined constant "Foo\bar"