What potential issue is causing the "Fatal error: Cannot use object of type stdClass as array" on line 20 of the PHP script?

The issue causing "Fatal error: Cannot use object of type stdClass as array" on line 20 is trying to access an object property as if it were an array. To solve this, you need to access object properties using the arrow (->) notation instead of square brackets ([]).

// Incorrect usage causing the error
$property = $object['property'];

// Correct usage to access object property
$property = $object->property;