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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 14:01:29 2024 UTC