public override PhpAlias EnsureItemAlias(ref PhpValue me, PhpValue index, bool quiet) { var arr = new PhpArray(); me = PhpValue.Create(arr); return(Operators.EnsureItemAlias(arr, index, quiet)); }
public override PhpAlias EnsureItemAlias(ref PhpValue me, PhpValue index, bool quiet) { var arr = me.Object as IPhpArray; if (arr != null) { return(Operators.EnsureItemAlias(arr, index, quiet)); } // TODO: Err throw new NotSupportedException(); }
public override PhpAlias EnsureItemAlias(ref PhpValue me, PhpValue index, bool quiet) { if (me.Object is IPhpArray arr) { return(Operators.EnsureItemAlias(arr, index, quiet)); } if (!quiet) // NOTE: PHP does not report this error (?) { PhpException.Throw(PhpError.Error, Resources.ErrResources.object_used_as_array, me.Object.GetPhpTypeInfo().Name); } return(new PhpAlias(PhpValue.Null)); }
public override PhpValue GetArrayItem(ref PhpValue me, PhpValue index, bool quiet) => me.Array.GetItemValue(index); // , quiet); public override PhpAlias EnsureItemAlias(ref PhpValue me, PhpValue index, bool quiet) => Operators.EnsureItemAlias(me.Array, index, quiet);