bug48533.phpt 716 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #48533 (__callStatic is not invoked for private/protected methods)
  3. --FILE--
  4. <?php
  5. class foo {
  6. private function a() {
  7. var_dump(1);
  8. }
  9. public function b() {
  10. var_dump(2);
  11. }
  12. protected function c() {
  13. var_dump(3);
  14. }
  15. static function __callstatic($a, $b) {
  16. var_dump('__callStatic::'. $a);
  17. }
  18. public function __call($a, $b) {
  19. var_dump('__call::'. $a);
  20. }
  21. }
  22. $x = new foo;
  23. $x->a();
  24. $x->b();
  25. $x->c();
  26. $x::a();
  27. $x::b();
  28. $x::c();
  29. ?>
  30. --EXPECTF--
  31. %unicode|string%(9) "__call::a"
  32. int(2)
  33. %unicode|string%(9) "__call::c"
  34. %unicode|string%(15) "__callStatic::a"
  35. Strict Standards: Non-static method foo::b() should not be called statically in %s on line %d
  36. int(2)
  37. %unicode|string%(15) "__callStatic::c"