note 62070 added to control-structures.continue

From: Date: Sat, 18 Feb 2006 20:24:22 +0000
Subject: note 62070 added to control-structures.continue
Groups: php.notes 
Request: Send a blank email to php-notes+get-103995@lists.php.net to get a copy of this message
(only) the reason that is given on the "Continue with missing semikolon" example is wrong. the script will output "2" because the missing semikolon causes that the "print"-call is executed only if the "if" statement is true. It has nothing to to with "what" the "print"-call would return or not return, but the returning value can cause to skip to the end of higher level Loops if any call is used that will return a bigger number than 1. <?php continue print "$i\n"; ?> because of the optional argument, the script will not run into a "unexpected T_PRINT" error. It will not run into an error, too, if the call after continue does return anything but a number. i suggest to change it from: because the return value of the print() call is int(1), and it will look like the optional numeric argument mentioned above. to because the print() call will look like the optional numeric argument mentioned above. ---- Server IP: 217.13.201.10 Probable Submitter: 83.129.13.225 ---- Manual Page -- http://www.php.net/manual/en/control-structures.continue.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62070 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62070&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62070&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103995) next »