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

Pull Requests

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: Sat Dec 21 14:01:32 2024 UTC