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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Oct 31 23:01:28 2024 UTC