What is the call signature of an object literal type and how can they be used with generic types?

Functions can have properties, that’s what the object literal syntax is for: it allows to define a call signature and additional properties. Your two examples are equivalent because the second doesn’t define additional properties on the object literal. You can read more on that in the section on hybrid types. Additionally, the object literal allows …

Read more

PHP object literal

As BoltClock mentioned there is no object literal in PHP however you can do this by simply type casting the arrays to objects: $testArray = array( (object)array(“name” => “John”, “hobby” => “hiking”), (object)array(“name” => “Jane”, “hobby” => “dancing”) ); echo “Person 1 Name: “.$testArray[0]->name; echo “Person 2 Hobby: “.$testArray[1]->hobby;