ID: 6608 Updated by: sbergmann Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Performance problem Assigned To: Comments: Could you please test your script with either the PHP 4.0.4pl1 release, the latest PHP 4.0.5 RC or a current CVS snapshot from http://snaps.php.net/? Thanks. Previous Comments: --------------------------------------------------------------------------- [2000-09-07 13:01:24] [EMAIL PROTECTED] The following code performed well under 3.0.16. for ($i=0; $i < sizeof($teacherarray); $i++) { $a=$teacher_array[$i]; if ($a->teacher_id==$teacher_id) { break; } } However, under php 4.0.2 it is extrememly slow and causes cpu util for the httpd process to hit 90%. $teacherarray is not being modified during the loop so the condition isn't changing. BTW: Changing to the following code works ok. $numteachers = sizeof($teacherarray); for ($i=0; $i < $numteachers; $i++) { $a=$teacher_array[$i]; if ($a->teacher_id==$teacher_id) { break; } } Either the sizeof function has had a serious decrease in its speed or something is awry.. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=6608&edit=2 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]