php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52641 scrambled class name passed by call_user_func on non existing methods
Submitted: 2010-08-19 03:27 UTC Modified: 2013-02-18 00:34 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: admin dot windows at gmail dot com Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.2.13 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
18 + 23 = ?
Subscribe to this entry?

 
 [2010-08-19 03:27 UTC] 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
                        )

                )

        )

)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-19 03:56 UTC] 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 04:05 UTC] 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 04:08 UTC] 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:27 UTC] admin dot windows at gmail dot com
-Operating System: ALL +Operating System: Linux -PHP Version: 5.2.14 +PHP Version: 5.2.13
 [2010-08-19 04:27 UTC] 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-20 08:04 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2010-08-20 08:04 UTC] aharvey@php.net
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.)
 [2010-08-20 08:19 UTC] admin dot windows at gmail dot com
Here is output of get_loaded_extensions() on my local system PHP v 5.3.2, WIN 7 
64bit.
Array
(
    [0] => Core
    [1] => com_dotnet
    [2] => ctype
    [3] => date
    [4] => ereg
    [5] => filter
    [6] => ftp
    [7] => hash
    [8] => iconv
    [9] => json
    [10] => session
    [11] => openssl
    [12] => pcre
    [13] => Reflection
    [14] => standard
    [15] => SPL
    [16] => mysqlnd
    [17] => zlib
    [18] => libxml
    [19] => dom
    [20] => PDO
    [21] => pdo_sqlite
    [22] => SimpleXML
    [23] => xml
    [24] => cgi-fcgi
    [25] => bcmath
    [26] => bz2
    [27] => calendar
    [28] => curl
    [29] => exif
    [30] => gd
    [31] => gettext
    [32] => imap
    [33] => ldap
    [34] => mbstring
    [35] => mcrypt
    [36] => mysql
    [37] => mysqli
    [38] => pdo_mysql
    [39] => pdo_pgsql
    [40] => pgsql
    [41] => soap
    [42] => sockets
    [43] => tidy
    [44] => tokenizer
    [45] => xsl
    [46] => zip
    [47] => intl
    [48] => SQLite
    [49] => xmlreader
    [50] => xmlwriter
    [51] => fileinfo
    [52] => Phar
    [53] => win32service
    [54] => oci8
    [55] => PDO_OCI
    [56] => xmlrpc
    [57] => Zend Data Cache
    [58] => Zend Job Queue
    [59] => Zend Session Clustering
    [60] => Zend Utils
    [61] => Zend Optimizer+
    [62] => Zend Code Tracing
    [63] => Zend Monitor
    [64] => Zend Debugger
    [65] => Zend Monitor UI
)

One of my hosting with version 5.2.11, Cent OS
Array
(
    [0] => date
    [1] => libxml
    [2] => openssl
    [3] => pcre
    [4] => zlib
    [5] => bcmath
    [6] => calendar
    [7] => ctype
    [8] => curl
    [9] => dom
    [10] => hash
    [11] => filter
    [12] => ftp
    [13] => gd
    [14] => gettext
    [15] => gmp
    [16] => session
    [17] => iconv
    [18] => standard
    [19] => json
    [20] => ldap
    [21] => mbstring
    [22] => mcrypt
    [23] => mhash
    [24] => ming
    [25] => mysql
    [26] => SimpleXML
    [27] => pgsql
    [28] => posix
    [29] => pspell
    [30] => Reflection
    [31] => imap
    [32] => SPL
    [33] => mysqli
    [34] => soap
    [35] => SQLite
    [36] => exif
    [37] => tidy
    [38] => tokenizer
    [39] => xml
    [40] => xmlreader
    [41] => xmlrpc
    [42] => xmlwriter
    [43] => xsl
    [44] => zip
    [45] => cgi-fcgi
    [46] => mailparse
    [47] => memcache
    [48] => PDO
    [49] => pdo_mysql
    [50] => pdo_pgsql
    [51] => pdo_sqlite
    [52] => uploadprogress
    [53] => ionCube Loader
    [54] => Zend Optimizer
)

As you can see this behaviour was reproduced on 5.2.11, 5.2.13, 5.3.2 versions 
of php

For reference you can see this event live here:
http://ajaxtech.webfactional.com/test.php
 [2010-08-20 08:46 UTC] aharvey@php.net
Do you still get the problem if the various Zend and ionCube extensions aren't loaded?
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 09:01:27 2024 UTC