call_static_006.phpt 531 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Testing __callStatic
  3. --FILE--
  4. <?php
  5. class foo {
  6. public function aa() {
  7. print "ok\n";
  8. }
  9. static function __callstatic($a, $b) {
  10. var_dump($a);
  11. }
  12. }
  13. foo::aa();
  14. $b = 'AA';
  15. foo::$b();
  16. foo::__construct();
  17. ?>
  18. --EXPECTF--
  19. Deprecated: Non-static method foo::aa() should not be called statically in %s on line %d
  20. ok
  21. Deprecated: Non-static method foo::aa() should not be called statically in %s on line %d
  22. ok
  23. Fatal error: Uncaught Error: Cannot call constructor in %s:%d
  24. Stack trace:
  25. #0 {main}
  26. thrown in %s on line %d