ID:               47100
 Comment by:       crrodriguez at opensuse dot org
 Reported By:      dreadlabs at gmail dot com
 Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Ubuntu
 PHP Version:      5.2.8
 New Comment:

Interesting.. in reality it IMHO should abort with a fatal error when
classes are named __construct, __destruct, __call, __callStatic, __get,
__set, __isset, __unset, __sleep, __wakeup, __toString, __set_state and
__clone.


Previous Comments:
------------------------------------------------------------------------

[2009-01-14 15:11:04] dreadlabs at gmail dot com

Description:
------------
I created a class named __call, within that class i created the magic
method __call. I then instantiated the __call class and tried to call a
non-existent method. I then got a missing argument error from PHP,
instead of it using the __call method.

Reproduce code:
---------------
<?php

class __call {

        public function __call($method, $args){
                echo $method."\n";
        }

}

$obj = new __call;
$obj->test();

?>

Expected result:
----------------
test

Actual result:
--------------
Warning: Missing argument 1 for __call::__call(), called in
/home/tam/test.php on line 15 and defined in /home/tam/test.php on line
5

Warning: Missing argument 2 for __call::__call(), called in
/home/tam/test.php on line 15 and defined in /home/tam/test.php on line
5


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47100&edit=1

Reply via email to