-3

I need to declare two functions with different names (small 'i' and big "I").

function i() {
    echo 'Small i';
}

function I() {
    echo 'Big I';
}

PHP's output is:

PHP Fatal error:  Cannot redeclare I()

Why? Small "i" is not big "I".

I tested it in Linux and in Windows.

thirdknown
  • 13
  • 5

1 Answers1

2

PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions.

Note: Function names are case-insensitive, though it is usually good form to call functions as they appear in their declaration.

http://php.net/manual/en/functions.user-defined.php

Steve_B19
  • 538
  • 3
  • 10