|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #434 ".=" is very slow
Submitted: 1998-06-03 18:05 UTC Modified: 1998-06-03 20:10 UTC
From: sam at daemoninc dot com Assigned: rasmus (profile)
Status: Closed Package: Performance problem
PHP Version: 3.0 Release Candidate 5 OS: Solaris 2.5.1
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sam at daemoninc dot com
New email:
PHP Version: OS:


 [1998-06-03 18:05 UTC] sam at daemoninc dot com
".=" operation seems to get slower and slower as string gets longer.
Maybe some linear operation is being done on the string each time.
Reproduce with:

for ($i = 0; $i <= 100000; ++$i) {
    $o .= "x";
I control-C'ed this after 135 seconds of run time.

Similar perl code runs in about one second on the same system.
Perl code is:
for ($i = 0; $i < 100000; ++$i) {
    $o .= "x";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-03 20:10 UTC] rasmus
This is unlikely to get fixed in 3.0.  We might be able to do something for 3.1.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 06:03:32 2021 UTC