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
 [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: Fri May 03 05:01:29 2024 UTC