This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -215,11 +215,14 @@ final class Array<T> implements ArrayAccess<Int, T> implements IteratorAggregate
@:noCompletion @:keep
@:php.attribute('\\ReturnTypeWillChange')
function offsetGet(offset:Int):Ref<T> {
try {
return arr[offset];
} catch (e:Dynamic) {
return null;
if(offset < 0 || offset >= length) {
//This var is required in generated php code
//because only variables can be returned by reference.
final result = null;
Syntax.keepVar(result);
return result;
}
return arr[offset];
}
@:noCompletion @:keep