Page MenuHomePhabricator

Evaluation order of array indexing is flipped
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Run:

a := [1];
a[b] := (b := 0);
true

Actual Results:

The filter can be evaluated fine with AbuseFilterCachingParser due to https://phabricator.wikimedia.org/diffusion/EABF/browse/master/includes/parser/AbuseFilterCachingParser.php$304. However, it has an unbound id in the original abusefilter.

Expected Results:

I think that the original abusefilter is more well-behaved. In particular, we should try to evaluate things from left to right to keep surprise at minimum.

Event Timeline

Change 547724 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Evaluate left-to-right when adding elements to array

https://gerrit.wikimedia.org/r/547724

Nullzero renamed this task from Evaluation order doesn't make sense to Evaluation order of array indexing is flipped.Nov 4 2019, 5:46 AM

Change 547724 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Evaluate left-to-right when adding elements to array

https://gerrit.wikimedia.org/r/547724