bug23384.phpt 442 B

123456789101112131415161718192021222324252627282930
  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. static 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. --EXPECT--
  20. Array
  21. (
  22. [100] => ten
  23. )
  24. Array
  25. (
  26. [10] => ten
  27. )
  28. 100100