__call_005.phpt 830 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. When __call() is invoked via ::, ensure private implementation of __call() in superclass is accessed without error.
  3. --FILE--
  4. <?php
  5. class A {
  6. private function __call($strMethod, $arrArgs) {
  7. echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n";
  8. var_dump($this);
  9. }
  10. }
  11. class B extends A {
  12. function test() {
  13. A::test1(1,'a');
  14. B::test2(1,'a');
  15. self::test3(1,'a');
  16. parent::test4(1,'a');
  17. }
  18. }
  19. $b = new B();
  20. $b->test();
  21. ?>
  22. --EXPECTF--
  23. Warning: The magic method A::__call() must have public visibility in %s__call_005.php on line 3
  24. In A::__call(test1, array(1,a))
  25. object(B)#1 (0) {
  26. }
  27. In A::__call(test2, array(1,a))
  28. object(B)#1 (0) {
  29. }
  30. In A::__call(test3, array(1,a))
  31. object(B)#1 (0) {
  32. }
  33. In A::__call(test4, array(1,a))
  34. object(B)#1 (0) {
  35. }