Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Created August 15, 2019 05:54
Show Gist options
  • Save dotherightthing/ac87437a08983bef8e9a809fd62f5d51 to your computer and use it in GitHub Desktop.
Save dotherightthing/ac87437a08983bef8e9a809fd62f5d51 to your computer and use it in GitHub Desktop.
[-> vs =>] #php

-> vs =>

=>

The double arrow operator is used to access the value of an array item.

<?php
$myArray = array(
 0 => 'Big'
);
?>

->

The object operator, is used in object scope to access methods and properties of an object.

$json = {
  "foo": "bar"
};

echo $json->{'foo'}; // "bar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment