php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1544 Array in return of function bug
Submitted: 1999-06-15 10:53 UTC Modified: 1999-06-15 16:46 UTC
From: aulbach at unter dot franken dot de Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.8 OS: Linux 2.0.36
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: aulbach at unter dot franken dot de
New email:
PHP Version: OS:

 

 [1999-06-15 10:53 UTC] aulbach at unter dot franken dot de
<?

function bla() {
        $r="16% Bla";
        $r[x]=0.16;
        return($r);
}


echo bla();

?>

Returns:

06% Bla

(very strange!)

I have other examples, where the first char is e.g. a '.'. Think there will
be something mixed up.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-15 11:48 UTC] rasmus at cvs dot php dot net
Not strange at all.  When you define a string like you did 
with $r, then $r[0] is the first character in that string.
All strings can be accessed like that.
 [1999-06-15 16:46 UTC] aulbach at unter dot franken dot de
where is this mentioned in the manual? Hummm...
I'm at the second place of the manual authors
but I can't find it. :-) 

There is only a sentence in the "changes" about that the behaviour
of php3 has changed, but there is nothing what this really means.
I'm coming from php2, there the above construct works.

I think big parts of the manual has to be totally rewritten. I need a time
doubler. :-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 18:01:29 2024 UTC