|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77086 method_exists doesn't support camel case ?
Submitted: 2018-10-31 03:49 UTC Modified: 2018-10-31 04:03 UTC
From: dany at timoshka-lab dot co dot jp Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 7.2.11 OS: CentOS 6.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dany at timoshka-lab dot co dot jp
New email:
PHP Version: OS:


 [2018-10-31 03:49 UTC] dany at timoshka-lab dot co dot jp
I think method_exists function should check method name with '===' operator.
Please take a look for sample code below.

Best Regards

Test script:

class A {
    public function testMethod()

$a = new A();

var_dump( method_exists($a, 'testmethod') );

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-31 03:55 UTC] spam2 at rhsoft dot net
besides the subject makes no sense function names in PHP are *NOT* case-sensitive - so why should method_exists?

class test_class
 public function test()
  echo "test\n";

$test = new test_class;
 [2018-10-31 04:03 UTC]
-Status: Open +Status: Not a bug
 [2018-10-31 04:03 UTC]
Like he said.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Jun 07 08:03:39 2023 UTC