1--TEST-- 2Test to ensure semi reserved words allow deference 3--FILE-- 4<?php 5 6class Foo { 7 const use = 'yay'; 8 9 public static function new() { 10 echo __METHOD__, PHP_EOL; 11 return new static(); 12 } 13 14 public function self() { 15 echo __METHOD__, PHP_EOL; 16 return $this; 17 } 18} 19 20Foo::new()::new()::new(); 21 22var_dump( 23 (new Foo)->self()::new()->self()->self()::use 24); 25 26Foo::{'new'}(); 27 28var_dump(Foo::use); 29 30echo "\nDone\n"; 31--EXPECTF-- 32Foo::new 33Foo::new 34Foo::new 35Foo::self 36Foo::new 37Foo::self 38Foo::self 39string(3) "yay" 40Foo::new 41string(3) "yay" 42 43Done 44