call_user_func_002.phpt 928 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Testing call_user_func() with autoload and passing invalid params
  3. --FILE--
  4. <?php
  5. function __autoload($class) {
  6. var_dump($class);
  7. }
  8. call_user_func(array('foo', 'bar'));
  9. call_user_func(array('', 'bar'));
  10. call_user_func(array($foo, 'bar'));
  11. call_user_func(array($foo, ''));
  12. ?>
  13. --EXPECTF--
  14. %unicode|string%(3) "foo"
  15. Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d
  16. Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d
  17. Notice: Undefined variable: foo in %s on line %d
  18. Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
  19. Notice: Undefined variable: foo in %s on line %d
  20. Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d