|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-08 10:33 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
Description: ------------ <pre> file NumericVarName.php <?php $TestVar = 8888; $$TestVar = 'See the KEY\'s type...'; $SeeThis = get_defined_vars(); function MyEcho($_Msg) {echo '<script>alert(\'' . $_Msg . '\');</script>';} isset($$TestVar) && MyEcho('Case A!'); isset($SeeThis[8888]) && MyEcho('Case B!'); isset($SeeThis['8888']) && MyEcho('Case C!'); foreach ($SeeThis as $_Ui => $_Uk) { ($_Ui === 8888) && $_Temp = 'Case B too!'; ($_Ui === '8888') && $_Temp = 'Case C too!'; isset($_Temp) && MyEcho($_Temp); } ?> ------------------------------------------------------------------------------ My English is poor.Just explain my question shortly: The output contains "Case A!" & "Case C too!", but why not contain "Case C!" before "Case C too!" ? ------------------------------------------------------------------------------ Hope you can analyse what I've talk about, maybe something not expect comes such as: - syntax-parser do not check "$$var" when "$var" is numeric. - do "foreach array" with get_defined_vars()'s return has a shortcoming. - ... Wish PHP better & better... </pre>