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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 14:01:33 2024 UTC