|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-12-12 06:20 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 03:00:01 2026 UTC |
When writing switch statements the documentation specifies that the different case statements should be terminated by : (colon), but a ; (semicolon) is also accepted. The code below writes 'Hello world' to the client. I believe it should instead have produced a parse error on the case 'bar'; line. $foo = "bar"; switch ($foo) { case 'bar'; echo 'Hello world\n'; break; default: echo 'Hit the default\n'; break; } Best regards, Jesper Juhl juhl@eisenstein.dk