php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26536 constant() should accept an Array in ZE2
Submitted: 2003-12-06 04:37 UTC Modified: 2005-05-02 11:24 UTC
From: rauh at onlinehome dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.0.0b2 (beta2) OS:
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rauh at onlinehome dot de
New email:
PHP Version: OS:

 

 [2003-12-06 04:37 UTC] rauh at onlinehome dot de
Description:
------------
I think since ZE2 and Class - Constants, constant() should accept an Array like call_user_func does.

Reproduce code:
---------------
$bar = 'aConstant';
echo constant(array('FooClass', $bar))
echo constant(array(new FooClass, $bar))

Expected result:
----------------
The Value of FooClass::aConstant

Actual result:
--------------
Array to String Conversion.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-02 11:24 UTC] andrey@php.net
use ReflectionClass::hasConstant() from the reflection API :
http://php.net/manual/en/language.oop5.reflection.php

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 19:01:30 2024 UTC