Add sub-controls for Hack array compat runtime checks
[hiphop-php.git] / hphp / runtime / base / strings.h
blob35e386a84ec31ae6fa6259670c6c3cce5bab981e
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 const char* const FATAL_NULL_THIS = "$this is null";
24 const char* const WARN_NULL_THIS = "Undefined variable: this";
25 const char* const ASSIGN_THIS_ERROR = "Cannot re-assign $this";
26 const char* const FUNCTION_ALREADY_DEFINED = "Function already defined: %s";
27 const char* const CONSTANT_ALREADY_DEFINED = "Constant %s already defined";
28 const char* const CONSTANTS_MUST_BE_SCALAR =
29 "Constants may only evaluate to scalar values or arrays";
30 const char* const CONSTANTS_CASE_SENSITIVE =
31 "Case insensitive constant names are not supported in HipHop";
32 const char* const MODULO_BY_ZERO = "Modulo by zero";
33 const char* const DIVISION_BY_ZERO =
34 "Division by zero";
35 const char* const NEGATIVE_SHIFT = "Bit shift by negative number";
36 const char* const UNDEFINED_CONSTANT =
37 "Use of undefined constant %s - assumed '%s'";
38 const char* const UNDEFINED_VARIABLE = "Undefined variable: %s";
39 const char* const UNKNOWN_CLASS = "Class undefined: %s";
40 const char* const CANT_ACCESS_SELF =
41 "Cannot access self:: when no class scope is active";
42 const char* const CANT_ACCESS_PARENT_WHEN_NO_CLASS =
43 "Cannot access parent:: when no class scope is active";
44 const char* const CANT_ACCESS_PARENT_WHEN_NO_PARENT =
45 "Cannot access parent:: when current class scope has no parent";
46 const char* const CANT_ACCESS_STATIC =
47 "Cannot access static:: when no class scope is active";
48 const char* const UNDEFINED_INDEX =
49 "Undefined index: %s";
50 const char* const CANNOT_USE_SCALAR_AS_ARRAY =
51 "Cannot use a scalar value as an array";
52 const char* const CREATING_DEFAULT_OBJECT =
53 "Creating default object from empty value";
54 const char* const SET_PROP_NON_OBJECT =
55 "Setting a property on a non-object";
56 const char* const NULLSAFE_PROP_WRITE_ERROR =
57 "?-> is not allowed in write context";
58 const char* const NULLSAFE_THIS_BASE_ERROR = "?-> is not allowed with $this";
59 const char* const FUNCTION_NAME_MUST_BE_STRING =
60 "Function name must be a string";
61 const char* const METHOD_NAME_MUST_BE_STRING =
62 "Method name must be a string";
63 const char* const MISSING_ARGUMENT_EXCEPTION =
64 "Too few arguments to function %s(), %d passed and %s %d expected";
65 const char* const MISSING_ARGUMENT =
66 "%s() expects %s 1 parameter, %d given";
67 const char* const MISSING_ARGUMENTS =
68 "%s() expects %s %d parameters, %d given";
69 const char* const CANT_UNSET_STRING =
70 "Cannot unset string offsets";
71 const char* const OP_NOT_SUPPORTED_STRING =
72 "Operator not supported for strings";
73 const char* const ASYNC_WITHOUT_BODY =
74 "Cannot declare %s method %s::%s() async; async is only meaningful"
75 " when it modifies a method body";
76 const char* const PICK_ACCESS_MODIFIER =
77 "Multiple access type modifiers are not allowed";
78 const char* const TRAITS_UNKNOWN_TRAIT =
79 "Unknown trait '%s'";
80 const char* const TRAITS_UNKNOWN_TRAIT_METHOD =
81 "Unknown trait method '%s'";
82 const char* const METHOD_IN_MULTIPLE_TRAITS =
83 "Method '%s' declared in multiple traits";
84 const char* const TRAIT_REQ_EXTENDS =
85 "Class '%s' required to extend class '%s'"
86 " by trait '%s'";
87 const char* const TRAIT_REQ_IMPLEMENTS =
88 "Class '%s' required to implement interface '%s'"
89 " by trait '%s'";
90 const char* const TRAIT_BAD_REQ_EXTENDS =
91 "Trait '%s' requires extension of '%s', but %s "
92 "is not an extendable class";
93 const char* const TRAIT_BAD_REQ_IMPLEMENTS =
94 "Trait '%s' requires implementations of '%s', but %s "
95 "is not an interface";
96 const char* const INCONSISTENT_INSTEADOF =
97 "Inconsistent insteadof definition. The method %s is to be used from %s, "
98 "but %s is also on the exclude list";
99 const char* const MULTIPLY_EXCLUDED =
100 "Failed to evaluate a trait precedence (%s). Method of trait %s was defined "
101 "to be excluded multiple times";
102 const char* const REDECLARE_BUILTIN = "Cannot redeclare %s()";
103 const char* const DISALLOWED_DYNCALL = "%s should not be called dynamically";
104 const char* const HACKARR_COMPAT_ARR_MIXEDCMP =
105 "Comparing array with non-array";
106 const char* const HACKARR_COMPAT_VARR_IS_ARR = "is_array() called on varray";
107 const char* const HACKARR_COMPAT_DARR_IS_ARR = "is_array() called on darray";
108 const char* const FUNCTION_CALLED_DYNAMICALLY = "'%s' called dynamically";
110 } // namespace Strings
111 } // namespace HPHP
113 #endif // incl_HPHP_STRINGS_H_