|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-12 01:59 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 18:00:02 2026 UTC |
When one forgets to the closing curly bracket ("}") in a switch statement, php gives an error of: Parse error: parse error, unexpected $ in /home/kims/switch.php on line n (where n is the numer of lines in the script). This error is completely unhelpful. The error should, at a minimum, report that the problem is an "unterminated switch" or a "missing }". Even better, would be "unterminated switch (starting on line n)", or "missing } after last case" or something. Here's a script that causes this error: <? switch ('foo') { default: echo "Hello World!\n"; /* uncomment to make this work */ // } ?>