|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-23 23:58 UTC] sniper@php.net
[2005-03-24 00:27 UTC] tony2001@php.net
[2005-03-24 14:20 UTC] pasha dot zubkov at gmail dot com
[2005-03-29 07:49 UTC] pasha dot zubkov at gmail dot com
[2005-04-25 15:41 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 04:00:01 2025 UTC |
Description: ------------ See example. I can't use `if (method_exists()) {}` because it always return TRUE Reproduce code: --------------- <?php class TestClass { public function __construct() { var_dump(method_exists($this, 'test')); if (method_exists($this, 'test')) { $this->test(); } } public function __call($name, $args) { throw new Exception('Call to undefined method '.get_class($this).'::'.$name.'()'); } } try { $test = new TestClass; } catch (Exception $e) { exit($e->getMessage()); } ?> Expected result: ---------------- bool(false) Actual result: -------------- bool(true) Call to undefined method TestClass::test()