1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 08:59:46 +01:00
PHP-Parser/test/code/parser/stmt/namespace/outsideStmtInvalid.test
Nikita Popov 0731b47655 Don't distinguish test-fail / test
With error recovery this is fluid. Using .test for everything.
2015-04-30 17:45:36 +02:00

20 lines
397 B
Plaintext

There (mostly) can't be statements outside of namespaces
-----
<?php
echo 1;
namespace A;
-----
Namespace declaration statement has to be the very first statement in the script on line 3
-----
<?php
namespace A {}
echo 1;
-----
No code may exist outside of namespace {} on line 3
-----
<?php
namespace A {}
declare(ticks=1);
namespace B {}
-----
No code may exist outside of namespace {} on line 3