bug23384.phpt 577 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Bug #23384 (use of class constants in statics)
  3. --INI--
  4. error_reporting=4095
  5. --FILE--
  6. <?php
  7. define('TEN', 10);
  8. class Foo {
  9. const HUN = 100;
  10. function test($x = Foo::HUN) {
  11. static $arr2 = array(TEN => 'ten');
  12. static $arr = array(Foo::HUN => 'ten');
  13. print_r($arr);
  14. print_r($arr2);
  15. print_r($x);
  16. }
  17. }
  18. Foo::test();
  19. echo Foo::HUN."\n";
  20. ?>
  21. --EXPECTF--
  22. Strict Standards: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d
  23. Array
  24. (
  25. [100] => ten
  26. )
  27. Array
  28. (
  29. [10] => ten
  30. )
  31. 100100