php-src/sapi/cli/tests/011.phpt

59 lines
774 B
Plaintext
Raw Normal View History

2006-11-24 13:33:38 +00:00
--TEST--
syntax check
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
$php = $_ENV['TEST_PHP_EXECUTABLE'];
$filename = dirname(__FILE__)."/011.test.php";
$code = '
<?php
$test = "var";
class test {
private $var;
}
echo test::$var;
?>
';
file_put_contents($filename, $code);
var_dump(`"$php" -l "$filename"`);
var_dump(`"$php" -l some.unknown`);
$code = '
<?php
class test
private $var;
}
?>
';
file_put_contents($filename, $code);
var_dump(`"$php" -l "$filename"`);
@unlink($filename);
echo "Done\n";
?>
--EXPECTF--
string(%d) "No syntax errors detected in %s011.test.php
"
Could not open input file: some.unknown
NULL
string(%d) "
2006-11-24 13:40:43 +00:00
Parse error: %s error, unexpected T_PRIVATE, expecting '{' in %s on line %d
2006-11-24 13:33:38 +00:00
Errors parsing %s011.test.php
"
Done