|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-06 09:56 UTC] gschlossnagle@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Seems the magic __call() function used with the overload extension is converting the name of the function called (the first argument of __call()) to lowercase. Best summarized with a script; <?php class Test { function Test () { echo ('Test constructed<br />'); } function __call($method,$args) { echo ( 'Method called: '.$method.'<br />' ); switch ( $method ) { case 'testa': echo ('testa('.$args[0].') success<br />'); break; case 'TestB': echo ('TestB('.$args[0].') success<br />'); break; case 'TESTC': echo ('TESTC('.$args[0].') success<br />'); break; default: echo ('Method unknown<br />'); break; } } } overload('Test'); $o=new Test(); $o->testa(1); $o->TestA(2); $o->TESTA(3); $o->testb(1); $o->TestB(2); $o->TESTB(3); $o->testc(1); $o->TestC(2); $o->TESTC(3); ?> Output of above script; Test constructed Method called: testa testa(1) success Method called: testa testa(2) success Method called: testa testa(3) success Method called: testb Method unknown Method called: testb Method unknown Method called: testb Method unknown Method called: testc Method unknown Method called: testc Method unknown Method called: testc Method unknown