Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22417243
undeclared-variables.lint-test
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
undeclared-variables.lint-test
View Options
<?php
function () use ($c) {
$c++;
};
function f($a, $b) {
static $c, $d;
global $e, $f;
$g = $h = x();
list($i, list($j, $k)) = y();
foreach (q() as $l => $m) {
}
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
$g++;
$h++;
$i++;
$j++;
$k++;
$l++;
$m++;
$this++;
$n++; // Only one that isn't declared.
extract(z());
$o++;
}
function g($q) {
$$q = x();
$r = y();
}
class C {
public function m() {
$a++;
x($b);
$c[] = 3;
$d->v = 4;
$a = $f;
}
}
function worst() {
global $$x;
$y++;
}
function superglobals() {
$GLOBALS[$_FILES[$_POST[$this]]]++;
}
function ref_foreach($x) {
foreach ($x as &$z) {
}
$z++;
}
function has_default($x = 0) {
$x++;
}
function declparse(
$a,
Q $b,
Q &$c,
Q $d = null,
Q &$e = null,
$f,
$g = null,
&$h,
&$i = null) {
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
$g++;
$h++;
$i++;
$j++;
}
function declparse_a(Q $a) { $a++; }
function declparse_b(Q &$a) { $a++; }
function declparse_c(Q $a = null) { $a++; }
function declparse_d(Q &$a = null) { $a++; }
function declparse_e($a) { $a++; }
function declparse_f(&$a) { $a++; }
function declparse_g($a = null) { $a++; }
function declparse_h(&$a = null) { $a++; }
function static_class() {
SomeClass::$x;
}
function instance_class() {
$a = $this->$x;
}
function exception_vars() {
try {
} catch (Exception $y) {
$y++;
}
}
function nonuse() {
isset($x);
empty($y);
$x++;
}
function twice() {
$y++;
$y++;
}
function more_exceptions() {
try {
} catch (Exception $a) {
$a++;
} catch (Exception $b) {
$b++;
}
}
class P {
abstract public function q();
}
function x() {
$lib = $_SERVER['PHP_ROOT'].'/lib/titan/display/read/init.php';
require_once($lib);
f(((($lib)))); // Tests for paren expressions.
f(((($lub))));
}
class A {
public function foo($a) {
$im_service = foo($a);
if ($im_servce === false) {
return 1;
}
return 2;
}
}
~~~~~~~~~~
error:30:3
error:32:3
error:38:3
error:44:5
error:45:7
error:46:5
error:47:5
error:48:10
error:53:10 worst ever
error:91:3 This stuff is basically testing the lexer/parser for function decls.
error:108:15 Variables in instance derefs should be checked, static should not.
error:121:3 isset() and empty() should not trigger errors.
error:125:3 Should only warn once in this function.
error:146:8
error:152:9
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 02:03 (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1217879
Default Alt Text
undeclared-variables.lint-test (2 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline