<?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;
  };
}

function some_func($x, $y) {
  $func = function ($z) use ($x) {
    echo "$x/$y/$z";
  };
}
~~~~~~~~~~
error:28:3
error:42:5
error:43:7
error:44:5
error:45:5
error:46:10
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
error:185:14
