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
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: tbannister at mpathix dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 28 09:01:28 2024 UTC