HaxeFoundation/hscript

[PHP] array access modifies array if access out of bounds

filt3rek opened this issue · 0 comments

Hej,

This code modifies a when acessing it on PHP :

var expr	= 'var a = [];
a[ 0 ];  // access here makes "a" becomes [ null ] on PHP
a;';
var parser = new hscript.Parser();
var ast = parser.parseString(expr);
var interp = new hscript.Interp();
trace(interp.execute(ast)); // [ null ] on PHP