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
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: solace at ezmail dot ru
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

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