blob: ab625d74b0e0741c96741dc89f774a3ff8061d5f (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
--TEST--
Bug #69038 (switch(SOMECONSTANT) misbehaves)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function a($a = "bad") {
switch (PHP_OS) {
case "LALALALA" : return "LALALAL";
case PHP_OS: return "okey";
default: break;
}
return $a;
}
var_dump(a());
function b($b = "bad") {
switch (PHP_OS) {
case "LALALAL": return "bad";
case PHP_OS:
switch (PHP_OS) {
case "FOO": break;
case PHP_OS: return "okey";
default :
break;
}
break;
default:
break;
}
return $b;
}
var_dump(b());
function c($b = "bad") {
switch (extension_loaded("standard")) {
case 0 : return "LALALAL";
case 1 : return "okey";
default : return "bad";
}
}
var_dump(c());
function d() {
switch (PHP_OS) {
default: return "bad";
case PHP_OS: return "okey";
}
}
var_dump(d());
?>
--EXPECT--
string(4) "okey"
string(4) "okey"
string(4) "okey"
string(4) "okey"
|