php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10467 static array doesn't evaluate defined keys
Submitted: 2001-04-23 17:19 UTC Modified: 2001-07-16 07:38 UTC
From: tbannister at mpathix dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Solaris
Private report: No CVE-ID: None
 [2001-04-23 17:19 UTC] tbannister at mpathix dot com
The following script doesn't work correctly.  It should
print "My Message: Hello World\nArray ( [1] => Hello [2] =>
World )".  Instead it prints "My Message: \nArray ( [FIRST]
=> Hello [SECOND] => World )".

<?
  define("FIRST", 1);
  define("SECOND", 2);

  static $myArray = array(FIRST => "Hello", SECOND => "World");

  print("My Message:". $myArray[FIRST] ." ".
$myArray[SECOND] ."<BR>\n");
  print_r($myArray);
 ?>
   

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-16 07:38 UTC] zeev@php.net
This is now fixed in CVS, and will be a part of 4.0.7.  Thanks for the reproducing script!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 11:01:29 2024 UTC