track total size of static array and Unit/Class/Func
[hiphop-php.git] / hphp / runtime / base / strings.h
blob0b124c561a518317a0d5bdb7fee9317d8ddc0a78
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_STRINGS_H_
18 #define incl_HPHP_STRINGS_H_
20 namespace HPHP {
21 namespace Strings {
23 constexpr char FATAL_NULL_THIS[] = "$this is null";
24 constexpr char WARN_NULL_THIS[] = "Undefined variable: this";
25 constexpr char FUNCTION_ALREADY_DEFINED[] = "Function already defined: %s";
26 constexpr char CONSTANT_ALREADY_DEFINED[] = "Constant %s already defined";
27 constexpr char DIVISION_BY_ZERO[] =
28 "Division by zero";
29 constexpr char INTEGER_OVERFLOW[] = "Integer overflow";
30 constexpr char UNDEFINED_VARIABLE[] = "Undefined variable: %s";
31 constexpr char UNKNOWN_CLASS[] = "Class undefined: %s";
32 constexpr char UNKNOWN_RECORD[] = "Record undefined: %s";
33 constexpr char CANT_ACCESS_SELF[] =
34 "Cannot access self:: when no class scope is active";
35 constexpr char CANT_ACCESS_PARENT_WHEN_NO_CLASS[] =
36 "Cannot access parent:: when no class scope is active";
37 constexpr char CANT_ACCESS_PARENT_WHEN_NO_PARENT[] =
38 "Cannot access parent:: when current class scope has no parent";
39 constexpr char CANT_ACCESS_STATIC[] =
40 "Cannot access static:: when no class scope is active";
41 constexpr char THIS_OUTSIDE_CLASS[] =
42 "Cannot use 'this' outside of a class";
43 constexpr char CANNOT_USE_SCALAR_AS_ARRAY[] =
44 "Cannot use a scalar value as an array";
45 constexpr char CREATING_DEFAULT_OBJECT[] =
46 "Creating default object from empty value";
47 constexpr char SET_PROP_NON_OBJECT[] =
48 "Setting a property on a non-object";
49 constexpr char NULLSAFE_PROP_WRITE_ERROR[] =
50 "?-> is not allowed in write context";
51 constexpr char FUNCTION_NAME_MUST_BE_STRING[] =
52 "Function name must be a string";
53 constexpr char METHOD_NAME_MUST_BE_STRING[] =
54 "Method name must be a string";
55 constexpr char CANT_UNSET_STRING[] =
56 "Cannot unset string offsets";
57 constexpr char OP_NOT_SUPPORTED_STRING[] =
58 "Operator not supported for strings";
59 constexpr char OP_NOT_SUPPORTED_FUNC[] =
60 "Operator not supported for funcs";
61 constexpr char OP_NOT_SUPPORTED_RECORD[] =
62 "Operator not supported for records";
63 constexpr char OP_NOT_SUPPORTED_CLASS[] =
64 "Operator not supported for classes";
65 constexpr char TRAITS_UNKNOWN_TRAIT[] =
66 "Unknown trait '%s'";
67 constexpr char TRAITS_UNKNOWN_TRAIT_METHOD[] =
68 "Unknown trait method '%s'";
69 constexpr char METHOD_IN_MULTIPLE_TRAITS[] =
70 "Method '%s' declared in multiple traits (%s)";
71 constexpr char TRAIT_REDECLARED_METHOD_INCONSISTENT_ATTRIBUTES[] =
72 "Redeclaration of trait method '%s::%s' is inconsistent about '%s'";
73 auto constexpr TRAIT_REDECLARED_FINAL_METHOD=
74 "Redeclaration of final trait method '%s::%s' must also be final";
75 constexpr char TRAIT_REQ_EXTENDS[] =
76 "Class '%s' required to extend class '%s'"
77 " by trait '%s'";
78 constexpr char TRAIT_REQ_IMPLEMENTS[] =
79 "Class '%s' required to implement interface '%s'"
80 " by trait '%s'";
81 constexpr char TRAIT_BAD_REQ_EXTENDS[] =
82 "Trait '%s' requires extension of '%s', but %s "
83 "is not an extendable class";
84 constexpr char TRAIT_BAD_REQ_IMPLEMENTS[] =
85 "Trait '%s' requires implementations of '%s', but %s "
86 "is not an interface";
87 constexpr char INCONSISTENT_INSTEADOF[] =
88 "Inconsistent insteadof definition. The method %s is to be used from %s, "
89 "but %s is also on the exclude list";
90 constexpr char MULTIPLY_EXCLUDED[] =
91 "Failed to evaluate a trait precedence (%s). Method of trait %s was defined "
92 "to be excluded multiple times";
93 constexpr char REDECLARE_BUILTIN[] = "Cannot redeclare %s()";
94 constexpr char HACKARR_COMPAT_ARR_HACK_ARR_CMP[] =
95 "Comparing PHP array with Hack array";
96 constexpr char HACKARR_COMPAT_VEC_IS_ARR[] = "is_array() called on vec";
97 constexpr char HACKARR_COMPAT_DICT_IS_ARR[] = "is_array() called on dict";
98 constexpr char HACKARR_COMPAT_KEYSET_IS_ARR[] = "is_array() called on keyset";
99 constexpr char HACKARR_COMPAT_VARR_IS_VEC[] = "is_vec() called on varray";
100 constexpr char HACKARR_COMPAT_VEC_IS_VARR[] = "is_varray() called on vec";
101 constexpr char HACKARR_COMPAT_DARR_IS_DICT[] = "is_dict() called on darray";
102 constexpr char HACKARR_COMPAT_DICT_IS_DARR[] = "is_darray() called on dict";
103 constexpr char DATATYPE_SPECIALIZED_DVARR[] =
104 "Dataype-specialized array currently unsupported";
105 constexpr char FUNCTION_CALLED_DYNAMICALLY_WITHOUT_ATTRIBUTE[] =
106 "'%s' called dynamically but is not __DynamicallyCallable";
107 constexpr char FUNCTION_CALLED_DYNAMICALLY_WITH_ATTRIBUTE[] =
108 "'%s' called dynamically without using a function pointer";
109 constexpr char CLASS_CONSTRUCTED_DYNAMICALLY[] = "'%s' constructed dynamically";
110 constexpr char NEW_STATIC_ON_REIFIED_CLASS[] =
111 "Cannot call new static since class %s has reified generics";
112 constexpr char RECORD_NOT_SUPPORTED[] =
113 "Records are not supported here";
114 constexpr char CALL_ILLFORMED_FUNC[] =
115 "calling an ill-formed function pointer without resolved "
116 "class/object pointer";
117 constexpr char RFUNC_NOT_SUPPORTED[] =
118 "Reified functions not supported";
120 constexpr char CLSMETH_COMPAT_IS_ARR[] = "is_array() called on clsmeth";
121 constexpr char CLSMETH_COMPAT_IS_VEC[] = "is_vec() called on clsmeth";
122 constexpr char CLSMETH_COMPAT_IS_VARR[] = "is_varray() called on clsmeth";
123 constexpr char CLSMETH_COMPAT_IS_ANY_ARR[] = "is_any_array() called on clsmeth";
124 constexpr char CLSMETH_COMPAT_IS_SHAPE[] = "is_shape() called on clsmeth";
125 constexpr char CLSMETH_COMPAT_IS_TUPLE[] = "is_tuple() called on clsmeth";
126 constexpr char CLSMETH_COMPAT_VEC_CMP[] = "Comparing clsmeth with vec";
127 constexpr char CLSMETH_COMPAT_NON_CLSMETH_REL_CMP[] =
128 "Comparing clsmeth with non-clsmeth relationally";
130 constexpr char FUNC_TO_STRING_IMPLICIT[] =
131 "Implicit Func to string conversion for type-hint";
132 constexpr char FUNC_TO_STRING[] = "Func to string conversion";
133 constexpr char CLASS_TO_STRING_IMPLICIT[] =
134 "Implicit Class to string conversion for type-hint";
135 constexpr char CLASS_TO_STRING[] = "Class to string conversion";
136 constexpr char ARRAY_MARK_LEGACY_VEC[] = "array_mark_legacy() called on vec";
137 constexpr char ARRAY_MARK_LEGACY_DICT[] = "array_mark_legacy() called on dict";
138 constexpr char NONEXHAUSTIVE_SWITCH[] =
139 "The switch statement failed to match any of the cases";
141 } // namespace Strings
142 } // namespace HPHP
144 #endif // incl_HPHP_STRINGS_H_