php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7453 echo still not handling double scripted arrays
Submitted: 2000-10-25 12:12 UTC Modified: 2000-10-26 07:14 UTC
From: pwoneill at email dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.3pl1 OS: WinNT, Redhat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pwoneill at email dot com
New email:
PHP Version: OS:

 

 [2000-10-25 12:12 UTC] pwoneill at email dot com
This was originally posted in Bug #1859, which is closed, saying it was fixed in PHP 4.0, but I have been having a similar problem

Example Code:
---------------------
<?php

  $people = array(
    array("Name" => "Bill", "Age" => "20"),
    array("Name" => "Bob", "Age" => "30")
  );

  echo ("using echo embedded, $people[0][Name]\n");
  echo ("using echo non-embedded, " . $people[0][Name] . "\n");
  printf("using printf, %s\n", $people[0][Name]);
?>

Output:
-------------------------

using echo embedded, Array[Name]
using echo non-embedded, Bill
using printf, Bill

It seems the variables-in-quotes expansion isn't working at least in this case of PHP 4.0.3pl1.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-26 07:14 UTC] joey@php.net
I'm not sure why Jim said that. I've never seen this work
any other way...it's just a know limitation. Instead do:
$tmp = $array[0]["somekey"];
print $tmp;

I doubt this will change soon.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 02:01:28 2024 UTC