[PR][php-src][#1150][master] - Limit use to top of block
| From: | noreply@php.net | Date: | Thu, 05 Mar 2015 19:28:28 +0000 |
| Subject: | [PR][php-src][#1150][master] - Limit use to top of block | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2589@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1150
Pull Request Description:
Currently,
use declarations can happen in any top level code (top or inside of
block-mode namespace declarations). This can result in weird situations like:
<?php
namespace Foo;
var_dump(new Test); // Foo\Test
use Bar\Test;
var_dump(new Test); // Bar\Test
This PR adds a compile time check to ensure that use statements occur at the top of the block (file,
or immediately following a namespace declaration). The only other non-use symbols allowed before it
are Namespace declarations and declare calls.