PHP 函数名称是否区分大小写?[已关闭]
2022-08-30 15:36:12
我来自Java背景。在Java中,每个方法在调用时都区分大小写。但在PHP中,我在调用函数时没有看到区分大小写的函数名称。
class Sample {
...
...
function sampleFunction() {
....
....
}
}
$obj = new Sample();
$obj->sampleFunction(); /* Proper call with function name */
$obj->samplefunction(); /* It should show undefined function error but it also calls sampleFunction() */
任何人都可以澄清我的疑问,为什么这也被称为甚至不区分大小写的函数名称。请告诉我如何在PHP中限制?
提前致谢。