File: version_errors.phpt

package info (click to toggle)
php-ast 1.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 632 kB
  • sloc: ansic: 2,173; xml: 621; php: 319; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Version errors
--FILE--
<?php

try {
    ast\parse_code('<?php ...');
} catch (LogicException $e) {
    echo $e->getMessage(), "\n";
}

try {
    ast\parse_code('<?php ...', $version=10000);
} catch (LogicException $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECTF--
No version specified. Current version is %d. All versions (including experimental): {%d, %s}
Unknown version 10000. Current version is %d. All versions (including experimental): {%d, %s}