|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-10-31 03:49 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 06:00:02 2025 UTC |
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();