xref: /PHP-5.5/ext/opcache/tests/bug69038.phpt (revision d508ff96)
1--TEST--
2Bug #69038 (switch(SOMECONSTANT) misbehaves)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11function a($a = "bad") {
12
13	switch (PHP_OS) {
14	case "LALALALA" : return "LALALAL";
15	case PHP_OS: return "okey";
16	default:   break;
17	}
18
19	return $a;
20}
21
22var_dump(a());
23
24
25function b($b = "bad") {
26	switch (PHP_OS) {
27	case "LALALAL": return "bad";
28	case PHP_OS:
29		switch (PHP_OS) {
30		case "FOO": break;
31		case PHP_OS: return "okey";
32		default :
33			break;
34		}
35		break;
36	default:
37		break;
38	}
39	return $b;
40}
41var_dump(b());
42
43function c() {
44	switch (PHP_OS) {
45		default: return "bad";
46		case PHP_OS: return "okey";
47	}
48}
49
50var_dump(c());
51?>
52--EXPECT--
53string(4) "okey"
54string(4) "okey"
55string(4) "okey"
56