-
-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathUpperCaseConstantUnitTest.inc.fixed
More file actions
124 lines (98 loc) · 2.24 KB
/
UpperCaseConstantUnitTest.inc.fixed
File metadata and controls
124 lines (98 loc) · 2.24 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
// True
function myFunction($arg1, $arg2=TRUE)
{
}
function myFunction($arg1, $arg2=TRUE)
{
}
function myFunction($arg1, $arg2=TRUE)
{
}
if ($variable === TRUE) { }
if ($variable === TRUE) { }
if ($variable === TRUE) { }
// False
function myFunction($arg1, $arg2=FALSE)
{
}
function myFunction($arg1, $arg2=FALSE)
{
}
function myFunction($arg1, $arg2=FALSE)
{
}
if ($variable === FALSE) { }
if ($variable === FALSE) { }
if ($variable === FALSE) { }
// Null
function myFunction($arg1, $arg2=NULL)
{
}
function myFunction($arg1, $arg2=NULL)
{
}
function myFunction($arg1, $arg2=NULL)
{
}
if ($variable === NULL) { }
if ($variable === NULL) { }
if ($variable === NULL) { }
$x = new stdClass();
$x->null = 7;
use Zend\Log\Writer\Null as NullWriter;
new \Zend\Log\Writer\Null();
namespace False;
class True extends Null implements False {}
use True\Something;
use Something\True;
class MyClass
{
public function myFunction()
{
$var = array('foo' => new True());
}
}
$x = $f?FALSE:TRUE;
$x = $f? FALSE:TRUE;
class MyClass
{
// Spice things up a little.
const true = FALSE;
}
var_dump(MyClass::true);
function true() {}
// Issue #3332 - ignore type declarations, but not default values.
class TypedThings {
const MYCONST = FALSE;
public int|false $int = FALSE;
public Type|null $int = new MyObj(NULL);
private function typed(int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null
{
if (TRUE === FALSE) {
return NULL;
}
}
}
$cl = function (int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : string|false|null {};
class SkipOverPHP82DNFTypes {
protected (\FullyQualified&Partially\Qualified)|false $propertyC;
}
class SkipOverPHP84FinalProperties {
final MyType|false $propA;
private static final null|MyClass $propB;
}
// PHP 8.4 asymmetric visibility
class WithAsym {
private(set) null|true $asym1 = TRUE;
public private(set) ?bool $asym2 = FALSE;
protected(set) false|string|null $asym3 = NULL;
public protected(set) Type|null|bool $asym4 = TRUE;
}
abstract class SkipOverPHP84AbstractProperties {
abstract MyType|true $propA {get;}
protected abstract null|MyClass $propB {set;}
}
$a = \NULL;
$a = \FALSE;
$a = \TRUE;