a common operation in PHP into a single instruction <?php if ( isset($myArray[$key])) { echo $myArray[$key]; } if fetch value, myArray[key] { echo value; }
have return type hints namespace App; class MyClass { public function getSomeData() -> string { // This method must be return string value } public function getApp() -> <App\MyInterface> { // This method must be return object // does implement App\MyInterface } }
modified inside the method namespace App; class MyClass { // "a" is read-only public function getSomeData(const string a) { // this will throw a compiler exception let a = "hello"; } }