Bug #52641 [Opn->Fbk]: scrambled class name passed by call_user_func on non existing methods
Edit report at http://bugs.php.net/bug.php?id=52641&edit=1
ID: 52641
Updated by: aharvey@php.net
Reported by: admin dot windows at gmail dot com
Summary: scrambled class name passed by call_user_func on non
existing methods
-Status: Open
+Status: Feedback
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: 5.2.13
Block user comment: N
New Comment:
I've gone back as far as 5.2.11 and I can't reproduce this either --
every version I've tested gives the same (valid) warning as Felipe got.
What does "php -m" output? (If you don't have CLI access, then the
output of var_dump(get_loaded_extensions()) would suffice.)
Previous Comments:
------------------------------------------------------------------------
[2010-08-19 04:27:33] admin dot windows at gmail dot com
I don't have 5.2.14 installed on my hosting to confirm that it works on
this
version. However I have uploaded this script on other hosting accounts
that with
5.2.11 and 5.2.13 version installed.
------------------------------------------------------------------------
[2010-08-19 04:08:23] felipe@php.net
Hi, I am using 5.2 SVN.
(PHP 5.2.14RC4-dev (cli) (built: Jul 31 2010 13:23:04) (DEBUG))
------------------------------------------------------------------------
[2010-08-19 04:05:24] admin dot windows at gmail dot com
Hi Felipe, you are probably using version >=5.3. This bug related to
version below
5.3 and it was reproduced on server running 5.2.13
------------------------------------------------------------------------
[2010-08-19 03:56:22] felipe@php.net
I cannot reproduce this.
I got the message "Warning:
call_user_func(experimental::non_existing_method): First argument is
expected to be a valid callback"
------------------------------------------------------------------------
[2010-08-19 03:27:39] admin dot windows at gmail dot com
Description:
------------
I have discovered weird call_user_func behaviour while calling non
existing method
of the class. Instead of throwing some type of warning it tries to call
non
existing class with scrambled name.
Test script:
---------------
<?php
class experimental{}
function __autoload($class_name)
{
echo sprintf('<pre>%s</pre>',print_r(debug_backtrace(),true));
}
call_user_func(array('experimental','non_existing_method'));
?>
Expected result:
----------------
some king of warning or error
Actual result:
--------------
Array
(
[0] => Array
(
[function] => __autoload
[args] => Array
(
[0] => zybplbn6ps6m
)
)
[1] => Array
(
[file] => /www/test.php
[line] => 13
[function] => call_user_func
[args] => Array
(
[0] => Array
(
[0] => experimental
[1] => non_existing_method
)
)
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52641&edit=1
Thread (9 messages)