bug23384.phpt 539 B

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