예제 #1
0
        public PhpValue getConstant(Context ctx, string name)
        {
            var p = _tinfo.GetDeclaredConstant(name);

            if (p != null)
            {
                return(p.GetValue(ctx, null));
            }

            //
            return(PhpValue.False);
        }
예제 #2
0
        public static Expression BindClassConstant(PhpTypeInfo type, Type classCtx, string constName, Expression ctx)
        {
            var p = type.GetDeclaredConstant(constName);

            if (p != null && p.IsVisible(classCtx))
            {
                return(p.Bind(ctx, null));
            }

            //
            return(null);
        }