Skip to content

Fix dynamic key bug

Pre-release
Pre-release
Compare
Choose a tag to compare
@alwaysblank alwaysblank released this 21 May 16:34
· 1 commit to v2.0 since this release
6bef94f

This fixes a fairly serious bug where the following would happens:

$b = Brief::make([]);
$b->some_key = "some value";
echo $b->some_key; // "some value"
echo $b->literally_any_key_not_already_set; // "some value" <-- uh oh

This was the result of bad handling of collapsing alias chains on new dynamic keys. It had no effect on Briefs that were instantiated w/ a full array and didn't dynamically set keys, but for ones that did the result was clearly not desirable.

Additionally this release includes some formatting updates to the code that have no effect on functionality or behavior.