bug35509.phpt 498 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Bug #35509 (string constant as array key has different behavior inside object)
  3. --FILE--
  4. <?php
  5. class mytest
  6. {
  7. const classConstant = '01';
  8. private $classArray = array( mytest::classConstant => 'value' );
  9. public function __construct()
  10. {
  11. print_r($this->classArray);
  12. }
  13. }
  14. $classtest = new mytest();
  15. define( "normalConstant", '01' );
  16. $normalArray = array( normalConstant => 'value' );
  17. print_r($normalArray);
  18. ?>
  19. --EXPECT--
  20. Array
  21. (
  22. [01] => value
  23. )
  24. Array
  25. (
  26. [01] => value
  27. )