Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22422507
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();
}
final 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 = null,
$g = null,
&$h = null,
&$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 {
// This is intentionally left blank.
} catch (Exception $y) {
$y++;
}
}
function nonuse() {
isset($x);
empty($y);
$x++;
}
function twice() {
$y++;
$y++;
}
function more_exceptions() {
try {
// This is intentionally left blank.
} catch (Exception $a) {
$a++;
} catch (Exception $b) {
$b++;
}
}
abstract 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))));
}
final class A {
public function foo($a) {
$im_service = foo($a);
if ($im_servce === false) {
return 1;
}
return 2;
}
}
function arrow($o, $x) {
echo $o->{$x->{$x->{$x.$x->{$x}}.$x}};
}
function strings() {
$a = 1;
echo "$a";
echo "$b";
}
function catchy() {
try {
dangerous();
} catch (Exception $ex) {
$y->z();
}
}
function some_func($x, $y) {
$func = function ($z) use ($x) {
echo $x;
echo $y;
echo $z;
};
}
~~~~~~~~~~
error:28:3
error:30:3
error:36:3
error:42:5
error:43:7
error:44:5
error:45:5
error:46:10
error:51:10 worst ever
warning:61:3
error:87:3 This stuff is basically testing the lexer/parser for function decls.
error:104:15 Variables in instance derefs should be checked, static should not.
error:118:3 isset() and empty() should not trigger errors.
error:122:3 Should only warn once in this function.
error:144:8
error:150:9
error:164:9
error:171:5
error:178:10
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 03:23 (15 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1221781
Default Alt Text
undeclared-variables.lint-test (2 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline