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
 [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

Add a Patch

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: Fri Mar 29 11:01:29 2024 UTC