예제 #1
0
            public override PhpValue GetValue(Context ctx, object instance)
            {
                var runtime_fields = ContainingType.GetRuntimeFields(instance);

                // (instance)._runtime_fields[_name]
                if (runtime_fields != null && runtime_fields.TryGetValue(_name, out var value))
                {
                    return(value);
                }
                else
                {
                    PhpException.UndefinedProperty(ContainingType.Name, _name.ToString());
                    return(PhpValue.Null);
                }
            }
예제 #2
0
 /// <summary>
 /// Outputs error: Undefined offset ({0}).
 /// </summary>
 public static void UndefinedOffset(IntStringKey key)
 {
     Throw(PhpError.Error, string.Format(ErrResources.undefined_offset, key.ToString()));
 }
예제 #3
0
 public override bool Remove(IntStringKey key)
 {
     state.Remove(key.ToString());
     return true;
 }