~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to src/lint/linter/__tests__/xhpast/conditional-usage.lint-test

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-11-01 23:20:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20141101232006-mvlnp0cil67tsboe
Tags: upstream-0~git20141101/arcanist
Import upstream version 0~git20141101, component arcanist

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
if (function_exists('array_column')) {
 
4
  array_column(array(), '');
 
5
  json_last_error_msg();
 
6
} else {
 
7
  array_column(array(), '');
 
8
}
 
9
 
 
10
if (class_exists('CURLFile')) {
 
11
  new CURLFile('');
 
12
  new DateTimeImmutable();
 
13
}
 
14
 
 
15
if (function_exists('json_last_error_msg'))
 
16
  json_last_error_msg();
 
17
 
 
18
// These shouldn't fatal.
 
19
if (SomeClass::someStaticMethod($param)) {}
 
20
$var = 'some_func';
 
21
if ($var()) {}
 
22
~~~~~~~~~~
 
23
error:5:3
 
24
error:7:3
 
25
error:12:7
 
26
~~~~~~~~~~
 
27
~~~~~~~~~~
 
28
{"config": {"xhpast.php-version": "5.3.0"}}