026.phpt 381 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Nullsafe chain in static property / method name
  3. --FILE--
  4. <?php
  5. class Test {
  6. }
  7. $null = null;
  8. try {
  9. Test::${$null?->foo}->bar;
  10. } catch (Error $e) {
  11. echo $e->getMessage(), "\n";
  12. }
  13. try {
  14. Test::{$null?->foo}()->bar;
  15. } catch (Error $e) {
  16. echo $e->getMessage(), "\n";
  17. }
  18. ?>
  19. --EXPECT--
  20. Access to undeclared static property Test::$
  21. Method name must be a string