php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77412 PHP5 namespace PHP Fatal error, can not use ? as ? because the name is already
Submitted: 2019-01-05 02:19 UTC Modified: 2019-01-05 09:25 UTC
From: im dot lyb at qq dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.6.39 OS: osx/ubuntu14.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-01-05 02:19 UTC] im dot lyb at qq dot com
Description:
------------
PHP Fatal error:  Cannot use app\model\ServiceA as ServiceA because the name is already in use in /app/service/ServiceB.php on line 11


Under php5

In a directory, when use a class, if the directory has a same class name(not include namespace pre) and has been included before, will trigger a error.

PHP7 is ok!

code sample: https://github.com/liuyibao/php5-namespace-bug-report

Test script:
---------------
Under php5

In a directory, when use a class, if the directory has a same class name(not include namespace pre) and has been included before, will trigger a error.

PHP7 is ok!

code sample: https://github.com/liuyibao/php5-namespace-bug-report


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-05 09:25 UTC] nikic@php.net
-Status: Open +Status: Wont fix -Package: PHP Language Specification +Package: Scripting Engine problem
 [2019-01-05 09:25 UTC] nikic@php.net
Name conflict rules have been relaxed at some point during PHP 7 to allow such usages. This will not be changed on PHP 5 though, because PHP 5 is no longer supported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC