xref: /PHP-5.4/sapi/cgi/tests/006.phpt (revision 555b177c)
1--TEST--
2syntax check
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--INI--
6display_errors=stdout
7--FILE--
8<?php
9include "include.inc";
10
11$php = get_cgi_path();
12reset_env_vars();
13
14$filename = dirname(__FILE__)."/006.test.php";
15
16$code = '
17<?php
18
19$test = "var";
20
21class test {
22	private $var;
23}
24
25echo test::$var;
26
27?>
28';
29
30file_put_contents($filename, $code);
31
32var_dump(`"$php" -n -l "$filename"`);
33var_dump(`"$php" -n -l some.unknown`);
34
35$code = '
36<?php
37
38class test
39	private $var;
40}
41
42?>
43';
44
45file_put_contents($filename, $code);
46
47var_dump(`"$php" -n -l "$filename" 2>/dev/null`);
48
49@unlink($filename);
50
51echo "Done\n";
52?>
53--EXPECTF--
54string(%d) "No syntax errors detected in %s006.test.php
55"
56string(%d) "No input file specified.
57"
58string(%d) "<br />
59<b>Parse error</b>: %s expecting %s{%s in <b>%s006.test.php</b> on line <b>5</b><br />
60Errors parsing %s006.test.php
61"
62Done
63