php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16658 substr seems to alter the script when used on large strings
Submitted: 2002-04-17 08:42 UTC Modified: 2002-04-17 08:51 UTC
From: druid at evectors dot it Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.2.0 OS: Linux 2.2.20
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: druid at evectors dot it
New email:
PHP Version: OS:

 

 [2002-04-17 08:42 UTC] druid at evectors dot it
Here is my first bug report ever, so please don't be so rude if I forgot something or reported something already known :)

When I first use the function substr() to extract the first chars from the beginning of a large string (around 50 kb) that is a HTML page and when I print the whole string the script seems to stop. In example, I have a script that has basically this calls:

  printpage();
  debuginfo();

Into printpage() is located the substr(); substr() is conditioned by an "if" condition, so is not used every time; if it is used then debuginfo() is not called or prints only few lines of debug, depending of the size of the string that was "substr()ed". My personal workaround is like

  $debugstr=debuginfo();
  $htmlpage=printpage();
  $finalpage=$htmlpage.$debugstr;
  print $finalpage;

this works, but is not so elegant.
Hope you can solve this :)

Best regards
             Daniele Duca, Evectors srl

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-17 08:51 UTC] cynic@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Dec 16 02:01:24 2019 UTC