1// Create a new instance of MyObject into $obj
2$obj = new MyObject();
3// Set a property in the $obj object called thisProperty
4$obj->thisProperty = 'Fred';
5// Call a method of the $obj object named getProperty
6$obj->getProperty();
1PHP =>
2 //The double arrow operator, =>
3 //Used as an access mechanism for arrays.
4 //The left side will have a corresponding value on the right side in array.
5 //This can be used to set values into a corresponding index of an array.
6 //The index can be a string or number.
7$myArray = array(
8 0 => 'Red',
9 1 => 'Orange',
10 2 => 'Yellow',
11 3 => 'Green'
12);
1$tab = array(); // empty tab
2$tab = array("0" => "Hello", "1" => "world"); // $tab[0]="hello" and $tab[1]="world"
1// Create a new instance of MyObject into $obj
2$obj = new MyObject();
3// Set a property in the $obj object called thisProperty
4$obj->thisProperty = 'Fred';
5// Call a method of the $obj object named getProperty
6$obj->getProperty();
7