|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-02-07 20:54 UTC] mail at mkharitonov dot net
Description: ------------ Manual page: http://www.php.net/manual/en/functions.user-defined.php Actual text: "Function names are case-insensitive, ...". Expected text: "Function names are case-insensitive for A-Z chars and case-sensitive for chars with codes from 127 through 255 (0x7f-0xff), ...". Test script: --------------- <?php /* File charset is "windows-1251" */ function english() { print 'ok '; } english(); ENGLISH(); function кириллица() { print 'ok '; } кириллица(); КИРИЛЛИЦА(); Expected result: ---------------- ok ok ok ok Actual result: -------------- ok ok ok Fatal error: Call to undefined function КИРИЛЛИЦА() in ... on line 9 PatchesUserDefinedFunctions_doc_patch (last revision 2019-09-25 21:29 UTC by shetty dot bhavya345 at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
I can't actually reproduce the described behavior, because it triggers a syntax error on my setup. Anyway, character sets can't be auto-magically guessed (not to mention that they can be mixed), so you can't expect case-sensitivity to work out of the box like that. However, the following should work: <?php declare(encoding='WINDOWS-1251'); // assuming this is the file character set function тест() { echo "ok\n"; } тест(); ТЕСТ(); It doesn't. As I said - it triggers a syntax error for me and doesn't recognize the characters at all.