bug74657.phpt 438 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #74657 (Undefined constants in array properties result in broken properties)
  3. --FILE--
  4. <?php
  5. interface I {
  6. }
  7. class C {
  8. const FOO = I::FOO;
  9. public $options = [self::FOO => "bar"];
  10. }
  11. try {
  12. var_dump((new C)->options);
  13. } catch (Throwable $e) {}
  14. var_dump((new C)->options);
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Uncaught Error: Undefined constant I::FOO in %s:%d
  18. Stack trace:
  19. #0 {main}
  20. thrown in %sbug74657.php on line %d