php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4762 while() exits when substr() returns 0
Submitted: 2000-06-01 19:57 UTC Modified: 2000-06-01 20:22 UTC
From: babbos at silom dot delta dot edu dot gr Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0.16 OS: Win 98SE
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: babbos at silom dot delta dot edu dot gr
New email:
PHP Version: OS:

 

 [2000-06-01 19:57 UTC] babbos at silom dot delta dot edu dot gr
in a string check routin whitch checks the validity
of characters entered in a POST field i used
while () with substr(). If the string that substr() 
parses has 0 (zero) in it, while() exits while it should
not.

e.g.
$i=0;
while ($ch=substr($field_name,$i)
{
print"$ch";
$i++;
}

if $field_name has a 0 in it, while() exits while it
should exit with another false signal other than 0 (null maybe?)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-01 20:22 UTC] stas at cvs dot php dot net
Maybe, but this is not php bug, this is your bug. while exits when condition is false, and 0 means false.
And for sure this is not performance problem. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 04:01:38 2025 UTC