php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37549 continue with while/do-while
Submitted: 2006-05-22 13:55 UTC Modified: 2006-05-22 15:54 UTC
From: violetphp at yahoo dot co dot jp Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.4 OS: windowsXP
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: violetphp at yahoo dot co dot jp
New email:
PHP Version: OS:

 

 [2006-05-22 13:55 UTC] violetphp at yahoo dot co dot jp
Description:
------------
Cannot use continue keyword with while/do-while.


Reproduce code:
---------------
$a = 0;
do{
	if($a == 5)
		continue;
	print "$a";
	$a++;
}while($a < 10);

//OR

$b = 0;
while($b < 10){
	if($b == 5)
		continue;
	print "$b";
	$b++;
}

Expected result:
----------------
012346789012346789

Actual result:
--------------
Timeout...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-22 13:59 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Maybe you want \"break\" isntead of \"continue\".
 [2006-05-22 14:20 UTC] violetphp at yahoo dot co dot jp
Thank you for your reply,Johannes!

I know 'break',of course.
But,'break' means the other.
Can't I continue the loop?

Thanks.

Best Regards.
 [2006-05-22 15:14 UTC] mgf@php.net
Of course you can -- and you are. The behaviour you are getting is expected. This is a support issue, not a bug, so try asking in the php-general list (but, hint: think about when your ++ increment is happening).
 [2006-05-22 15:54 UTC] violetphp at yahoo dot co dot jp
Dear mgf and Johannes.

Thank you so.
I understood why.
It is just my mistake...

Best wishes.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 16:01:37 2025 UTC