2
use Exception as My_Exception, foo\bar, baz;
7
define('VALID_NAME', true);
8
define('invalidName', true);
9
define("VALID_NAME", true);
10
define("invalidName", true);
12
class TestClass extends MyClass, YourClass
15
const const1 = 'hello';
16
const CONST2 = 'hello';
20
echo constant('VALID_NAME');
25
echo constant('invalidName');
31
echo constant("VALID_NAME");
32
echo constant("invalidName");
34
echo 'Hello', VALID_NAME;
35
echo 'Hello', invalidName;
37
// These might look like constants to
38
// poorly written code.
47
function myFunc(PHP_CodeSniffer &$blah) {}
48
function myFunc(PHP_CodeSniffer $blah) {}
56
if (($object instanceof Some_Class) === false) {
58
This is some heredoc text.
59
This is some heredoc text.
60
This is some heredoc text.
62
This is some heredoc text.
63
This is some heredoc text.
64
This is some heredoc text.
69
This is some heredoc text.
70
This is some heredoc text.
71
This is some heredoc text.
73
This is some heredoc text.
74
This is some heredoc text.
75
This is some heredoc text.
78
throw new InvalidSomethingException;
81
foreach ($var as $bit) {
86
$binary = (binary) $string;
89
$foo->getBar()->define('foo');
91
// This is allowed as it is required for PHPUnit.
92
if (PHPUnit_MAIN_METHOD == 'PHP_Shell_AllTests::main') {
93
PHP_Shell_AllTests::main();
98
public function __construct() {
99
echo constant('self::TESTER');
100
echo constant('self::tester');
105
public static function constant($x) {}
108
A::constant('anything-not-in-uppercase');
115
function ConstTest() {
125
$a = 2 * ${x} - ${minus};
127
class Object implements IObject
131
TReflected::reflect insteadof TProperties;