php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66668 Function names are case-sensitive for chars with codes 127-255
Submitted: 2014-02-07 20:54 UTC Modified: 2020-04-13 16:03 UTC
Votes:2
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mail at mkharitonov dot net Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.5.9 OS: Mac OS X 10.8.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mail at mkharitonov dot net
New email:
PHP Version: OS:

 

 [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

Patches

UserDefinedFunctions_doc_patch (last revision 2019-09-25 21:29 UTC by shetty dot bhavya345 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-06 14:19 UTC] narf at devilix dot net
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.
 [2019-09-25 21:29 UTC] shetty dot bhavya345 at gmail dot com
The following patch has been added/updated:

Patch Name: UserDefinedFunctions_doc_patch
Revision:   1569446978
URL:        https://bugs.php.net/patch-display.php?bug=66668&patch=UserDefinedFunctions_doc_patch&revision=1569446978
 [2020-04-13 16:03 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349655
Log: Fix #66668: Function names are case-sensitive for chars with codes 127-255
 [2020-04-13 16:03 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-04-13 16:03 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-04-13 16:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=886599435a522e09c98b6a8374f8723c024b92e6
Log: Fix #66668: Function names are case-sensitive for chars with codes 127-255
 [2020-04-15 01:04 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349658
Log: Fix #66668: Function names are case-sensitive for chars with codes 127-255
 [2020-04-15 01:05 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=fd87294af8a96928e620d4ca4c7c5f58464a0ff1
Log: Fix #66668: Function names are case-sensitive for chars with codes 127-255
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=c9b6f0c07967b91f6085bc40dfb2d9e4d914a111
Log: Fix #66668: Function names are case-sensitive for chars with codes 127-255
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 00:01:41 2024 UTC