Bug #60022 [Com]: "use statement [...] has no effect" depends on leading backslash
| From: | david dot macek dot 0 at gmail dot com | Date: | Fri, 18 Mar 2016 08:46:25 +0000 |
| Subject: | Bug #60022 [Com]: "use statement [...] has no effect" depends on leading backslash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199914@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60022&edit=1
ID: 60022
Comment by: david dot macek dot 0 at gmail dot com
Reported by: nikic@php.net
Summary: "use statement [...] has no effect" depends on
leading backslash
Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: *
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Just wanted to say this patch broke one of our systems. I would argue that such changes belong into
a minor release rather than a patch release.
Previous Comments:
------------------------------------------------------------------------
[2015-04-06 20:10:29] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=cc70a46525f72340061107ced390eba3be1bf12a
Log: Fix bug #60022
------------------------------------------------------------------------
[2014-07-15 11:12:09] yohgaki@php.net
This exists in all versions
http://3v4l.org/SCXWd
------------------------------------------------------------------------
[2011-10-16 11:08:05] nikic@php.net
Only thing this could "break" is that the "You seem to be trying to use a different
language..." message would be triggered for "use \strict;" too. If that's a
problem I can modify the patch to not throw in that case.
------------------------------------------------------------------------
[2011-10-11 09:04:08] nikic@php.net
The following patch has been added/updated:
Patch Name: patch.txt
Revision: 1318323848
URL: https://bugs.php.net/patch-display.php?bug=60022&patch=patch.txt&revision=1318323848
------------------------------------------------------------------------
[2011-10-09 17:27:35] nikic@php.net
Description:
------------
The "The use statement with non-compound name '%s' has no effect" warning is
only thrown when the use statement doesn't have a leading backslash. It should be thrown in
both cases as they are semantically equivalent.
(Patch is trivial: Get rid of the is_global arg altogether.)
Test script:
---------------
<?php
namespace {
use Exception;
}
namespace {
use \Exception;
}
// http://codepad.viper-7.com/vN34cx
Expected result:
----------------
Two warnings.
Actual result:
--------------
One warning.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60022&edit=1