Bug #77086 [Opn->Nab]: method_exists doesn't support camel case ?

From: Date: Wed, 31 Oct 2018 04:03:33 +0000
Subject: Bug #77086 [Opn->Nab]: method_exists doesn't support camel case ?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217766@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77086&edit=1 ID: 77086 Updated by: requinix@php.net Reported by: dany at timoshka-lab dot co dot jp Summary: method_exists doesn't support camel case ? -Status: Open +Status: Not a bug Type: Bug Package: Class/Object related Operating System: CentOS 6.8 PHP Version: 7.2.11 Block user comment: N Private report: N New Comment: Like he said. Previous Comments: ------------------------------------------------------------------------ [2018-10-31 03:55:09] spam2 at rhsoft dot net besides the subject makes no sense function names in PHP are *NOT* case-sensitive - so why should method_exists? <?php class test_class { public function test() { echo "test\n"; } } $test = new test_class; $test->TEST(); $test->test(); ------------------------------------------------------------------------ [2018-10-31 03:49:19] dany at timoshka-lab dot co dot jp Description: ------------ I think method_exists function should check method name with '===' operator. Please take a look for sample code below. Thanks, Best Regards Test script: --------------- <?php class A { public function testMethod() { } } $a = new A(); var_dump( method_exists($a, 'testmethod') ); Expected result: ---------------- false Actual result: -------------- true ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77086&edit=1

« previous php.bugs (#217766) next »