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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 20 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 18:01:30 2024 UTC