php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67897 Closure definition affects output with relative constants
Submitted: 2014-08-24 06:45 UTC Modified: 2016-07-14 11:17 UTC
Votes:3
Avg. Score:2.3 ± 1.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: elliotlevin at hotmail dot com Assigned: dmitry (profile)
Status: Assigned Package: Scripting Engine problem
PHP Version: Irrelevant 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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
27 + 7 = ?
Subscribe to this entry?

 
 [2014-08-24 06:45 UTC] elliotlevin at hotmail dot com
Description:
------------
When the closure is defined should not affect the output in this script.
HHVM operates as one would expect, but all versions of PHP supporting namespaces do not return the correct constant if the closure is defined before the relative constant is.

Test script:
---------------
http://3v4l.org/6loRa

Expected result:
----------------
string(19) "IN GLOBAL NAMESPACE"
string(21) "IN RELATIVE NAMESPACE"
string(21) "IN RELATIVE NAMESPACE"

Actual result:
--------------
string(19) "IN GLOBAL NAMESPACE"
string(19) "IN GLOBAL NAMESPACE"
string(21) "IN RELATIVE NAMESPACE"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-14 11:17 UTC] dmitry@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 23:01:29 2024 UTC