php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41506 reassining string index to '' doesn't cause string length update
Submitted: 2007-05-26 10:14 UTC Modified: 2007-05-26 12:26 UTC
From: shugotenshi at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.2 OS: Linux (Ubuntu 7.04)
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: shugotenshi at gmail dot com
New email:
PHP Version: OS:

 

 [2007-05-26 10:14 UTC] shugotenshi at gmail dot com
Description:
------------
PHP Version 5.2.1 (form wouldn't let me select this version)

Reassigning a string index to ''
doesn't modify the string's length.

Reproduce code:
---------------
$ php -r '$str = "foo"; $str{0} = ""; var_dump($str);'

Expected result:
----------------
string(2) "oo"

Actual result:
--------------
string(3) "oo"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-26 12:26 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The first character will be a Null-Byte after that operation which is not shown by your terminal/browser/... 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 18:02:35 2024 UTC