|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78659 导入全局类
Submitted: 2019-10-10 08:09 UTC Modified: 2019-10-10 19:29 UTC
From: 513335394 at qq dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 7.3.10 OS: liunx
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: 513335394 at qq dot com
New email:
PHP Version: OS:


 [2019-10-10 08:09 UTC] 513335394 at qq dot com
From manual page:

$a = new ArrayObject(array(1)); // 实例化 ArrayObject 对象
// 如果不使用 "use \ArrayObject" ,则实例化一个 foo\ArrayObject 对象

Test script:
use \ArrayObject 
use ArrayObject


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-10 08:16 UTC] 513335394 at qq dot com
use ArrayObject;
use \ArrayObject;
 [2019-10-10 19:29 UTC]
-Status: Open +Status: Not a bug -Package: PHP Language Specification +Package: Scripting Engine problem
 [2019-10-10 19:29 UTC]
I think I can get this...

两者都被允许. "use ArrayObject" == "use \ArrayObject"
"use ArrayObject" 或 "new \ArrayObject" 是标准做法.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 18 06:01:23 2021 UTC