Skip to content

Instantly share code, notes, and snippets.

@tim-cotten
Created March 4, 2021 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tim-cotten/d3b6662feb4b7445ec5aa768597c7bd5 to your computer and use it in GitHub Desktop.
Save tim-cotten/d3b6662feb4b7445ec5aa768597c7bd5 to your computer and use it in GitHub Desktop.
PHP Bugs: Confusing Non-Objects for Objects (Example D: Order Structure)
// Order structure example
Order Object
(
  [id] => 44274002
  [delivery_date] => 2021–03–05
  [delivery_location_type] => Home
  [occasion] => Just Because
  [fulfillment_type] => 3
  [fulfillment_location] => 12
[product] => Product Object
(
[id] => 5232009
  [type] => 4
  [name] => Candy Hearts (5 lbs)
  [price] =>; 29.99
)
  [customer] => Customer Object
 (
  [email] => tim@cotten.io
  [name_first] => Tim
  [name_last] => Cotten
  [address] => 123 Somewhere
  [city] => Washington
  [state] => DC
  [postalcode] => 20008
  [country] => US
  [phone] => 555-555-5555
)
[recipient] => Recipient Object
(
[name_first] => Amy
  [name_last] => Cotten
  [address_1] => 123 Somewhere
  [city] => Washington
  [state] => DC
  [postalcode] => 20008
  [country] => US
  [phone] => 555-867-5309
)
[fees] => Array
(
[taxes] => 1.95
  [fee_ship_ground] => 10.00
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment