Skip to content

Instantly share code, notes, and snippets.

@tim-cotten
Created March 5, 2021 19:17
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/2c2a37f7cb3e0d5c6791305b7716cf49 to your computer and use it in GitHub Desktop.
Save tim-cotten/2c2a37f7cb3e0d5c6791305b7716cf49 to your computer and use it in GitHub Desktop.
PHP Bugs: Property Problems (Example E)
<?php
// ... $desc should be a JSON string ...
if (!empty($desc)) {
$desc_obj = json_decode($desc);
$action = $desc_obj->action;
$reasons = explode(',', $desc_obj->reasons);
// ... parsing logic for $reasons ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment