1--TEST--
2Testing call_user_func() with autoload and passing invalid params
3--FILE--
4<?php
5
6spl_autoload_register(function ($class) {
7    var_dump($class);
8});
9
10try {
11    call_user_func(array('foo', 'bar'));
12} catch (TypeError $e) {
13    echo $e->getMessage(), "\n";
14}
15try {
16    call_user_func(array('', 'bar'));
17} catch (TypeError $e) {
18    echo $e->getMessage(), "\n";
19}
20try {
21    call_user_func(array($foo, 'bar'));
22} catch (TypeError $e) {
23    echo $e->getMessage(), "\n";
24}
25try {
26    call_user_func(array($foo, ''));
27} catch (TypeError $e) {
28    echo $e->getMessage(), "\n";
29}
30
31?>
32--EXPECTF--
33string(3) "foo"
34call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found
35call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found
36
37Warning: Undefined variable $foo in %s on line %d
38call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
39
40Warning: Undefined variable $foo in %s on line %d
41call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object
42