php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9008 define()-ed values as assoc array keys don't work
Submitted: 2001-01-30 14:44 UTC Modified: 2001-05-11 19:43 UTC
From: colin at easydns dot com Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.0 Latest CVS (30/01/2001) OS: RH 7.0
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: colin at easydns dot com
New email:
PHP Version: OS:

 

 [2001-01-30 14:44 UTC] colin at easydns dot com
Take this script:

    <?php
    define(TEST_VAR, 100 );
    class test_class {
            var $codes = array(
                    TEST_VAR        => "hello"
            );
    }

    $x = new test_class;  
    print_r($x->codes);
    ?>

This outputs:

    Array
    (
        [TEST_VAR] => hello
    )

whereas I figure it should output:

    Array
    (
        [100] => hello
    )

No?

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-31 15:46 UTC] torben@php.net
See bug #8141.
 [2001-01-31 15:53 UTC] colin at easydns dot com
D'oh!

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Sep 08 00:01:27 2024 UTC