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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Mon Mar 02 15:00:01 2026 UTC