[PHP-BUG] Bug #52064 [NEW]: while loop does not meet conditions

2010-06-12 Thread developers at proneticas dot net
From: 
Operating system: FreeBSD
PHP version:  5.3.2
Package:  *General Issues
Bug Type: Bug
Bug description:while loop does not meet conditions

Description:

I am seeing a bug in PHP 5.3 where the WHILE LOOP is not meeting all of the
conditions. The same code was working great in PHP 5.2 but broke after a
PHP upgrade. I reviewed the PHP 5.3 change-log and nothing is mentioned for
changes in WHILE LOOP conditions.



Test script:
---
 0)) {

$rlength--;

}

if ($rlength== 0) {

return substr($string, 0, $setlength);

} else {

return substr($string, 0, $rlength).'.';

}

}else {

return $string;

}

}



$mstr = 'ProNeticas has released a visual rapid database design tool. This
allows you to generate online programs in rapid time, without any
programming.';



print cutTextPer( (String)$mstr, 52);



?>



[OUTPUT IN PHP 5.2]

ProNeticas has released a visual rapid database design tool.



[OUTPUT IN PHP 5.3]

ProNeticas has released a visual rapid database de



Expected result:

ProNeticas has released a visual rapid database design tool.

Actual result:
--
ProNeticas has released a visual rapid database de

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52064&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52064&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52064&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52064&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52064&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52064&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52064&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52064&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52064&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52064&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52064&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52064&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52064&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52064&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52064&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52064&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52064&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52064&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52064&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52064&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52064&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52064&r=mysqlcfg



Bug #52064 [Com]: while loop does not meet conditions

2010-06-12 Thread developers at proneticas dot net
Edit report at http://bugs.php.net/bug.php?id=52064&edit=1

 ID:   52064
 Comment by:   developers at proneticas dot net
 Reported by:  developers at proneticas dot net
 Summary:  while loop does not meet conditions
 Status:   Feedback
 Type: Bug
 Package:  *General Issues
 Operating System: FreeBSD
 PHP Version:  5.3.2

 New Comment:

Well really any version of 5.2 was working correctly, but for the sake
of debugging, the last version of 5.2 installed was 5.2.12.


Previous Comments:

[2010-06-12 18:36:10] fel...@php.net

Which 5.2 release are you refering to?


[2010-06-12 12:51:58] developers at proneticas dot net

Description:

I am seeing a bug in PHP 5.3 where the WHILE LOOP is not meeting all of
the conditions. The same code was working great in PHP 5.2 but broke
after a PHP upgrade. I reviewed the PHP 5.3 change-log and nothing is
mentioned for changes in WHILE LOOP conditions.



Test script:
---
 0)) {

$rlength--;

}

if ($rlength== 0) {

return substr($string, 0, $setlength);

} else {

return substr($string, 0, $rlength).'.';

}

}else {

return $string;

}

}



$mstr = 'ProNeticas has released a visual rapid database design tool.
This allows you to generate online programs in rapid time, without any
programming.';



print cutTextPer( (String)$mstr, 52);



?>



[OUTPUT IN PHP 5.2]

ProNeticas has released a visual rapid database design tool.



[OUTPUT IN PHP 5.3]

ProNeticas has released a visual rapid database de



Expected result:

ProNeticas has released a visual rapid database design tool.

Actual result:
--
ProNeticas has released a visual rapid database de






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52064&edit=1