Why can't I use a constant in a php object?

Posted by Raa00 on Stack Overflow See other posts from Stack Overflow or by Raa00
Published on 2010-03-13T12:46:31Z Indexed on 2010/03/13 12:55 UTC
Read the original article Hit count: 253

Filed under:
|
|

Why doesn't this work?

define("STR_TEST", "qwerty");

class Test
{
    public $arrTest = array(
        "test"=>"Bla bla bla ".STR_TEST
    );
}

$objTest = new Test();

print($objTest->arrTest["test"]);

© Stack Overflow or respective owner

Related posts about php

Related posts about object