php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70841 Group use declarations doesn't work for global symbols
Submitted: 2015-11-02 20:49 UTC Modified: 2015-11-02 21:12 UTC
From: david at grudl dot com Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.0RC6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2015-11-02 20:49 UTC] david at grudl dot com
Description:
------------
Group use declarations doesn't work for globals:

<?php
namespace Abc;

use \{SplStack, SplHeap};

// or 

use function \{is_array, is_int};


This generates Parse error: syntax error, unexpected '{', expecting identifier (T_STRING) in ...

Group use declarations for global functions should be really useful, because some functions (is_array, strlen, ...) are inlined in PHP7.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-02 21:12 UTC] nikic@php.net
-Status: Open +Status: Closed -Package: *Compile Issues +Package: Scripting Engine problem -Assigned To: +Assigned To: nikic
 [2015-11-02 21:12 UTC] nikic@php.net
You can simply use a normal use statement instead:

use SplStack, SplHeap;
// or
use function is_array, is_int;
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 16:02:26 2025 UTC