php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76425 Import Grouping from Multiple Namespaces
Submitted: 2018-06-07 15:34 UTC Modified: 2018-06-07 15:42 UTC
Votes:8
Avg. Score:3.9 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:3 (60.0%)
From: jwillfiji at gmail dot com Assigned:
Status: Open Package: *Programming Data Structures
PHP Version: 7.2.5 OS:
Private report: No CVE-ID: None
 [2018-06-07 15:34 UTC] jwillfiji at gmail dot com
Description:
------------
As of PHP 7.0, grouping items when important from namespaces became allowed, however this seems to be only when everything is from one namespace, and precludes allowing the shortened format if pulling multiple items from multiple namespaces. It is unclear if this was intended behavior, or if this is a bug. If this was intended, please change to request for this proposed functionality.

Test script:
---------------
namespace Foo;
class f1{}
class f2{}

namespace Bar;
class b1{}
class b2{}

namespace main;
use Foo\{f1,f2}, Bar\{b1,b2};

>> PHP Parse error: Syntax error, unexpected ',', expecting ';' on line 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-07 15:40 UTC] jwillfiji at gmail dot com
-PHP Version: 7.0.30 +PHP Version: 7.2.5
 [2018-06-07 15:40 UTC] jwillfiji at gmail dot com
For what it's worth, I am running PHP 7.2.5-1 on Ubuntu 16.04.1. My guess is this effects all version from 7.0 onward.
 [2018-06-07 15:42 UTC] nikic@php.net
-Type: Bug +Type: Feature/Change Request
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 08:01:29 2024 UTC