php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28406 New string offset syntax
Submitted: 2004-05-14 22:55 UTC Modified: 2004-05-15 19:59 UTC
From: solace at ezmail dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0RC2 OS: WinXP
Private report: No CVE-ID: None
 [2004-05-14 22:55 UTC] solace at ezmail dot ru
Description:
------------
Here is an example from ZendEngine-2.0.pdf (from zend.com):

An example of the new functionality:
$str1 = $str2 = ??;
$str1{0} = ?a?;
$str2[0] = ?a?;
The result will be $str1 being the string ?a?

But we still get array, just as for [].

Reproduce code:
---------------
$str1 = "";
$str1{0} = 'a';
var_dump($str1);


Expected result:
----------------
string(1) "a"

Actual result:
--------------
array(1) {
  [0]=>
  string(1) "a"
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-15 19:59 UTC] derick@php.net
That PDF is not authorative.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 05:01:31 2024 UTC