|
1 | 1 | <?php |
2 | 2 |
|
3 | | -require_once __DIR__ . '/array.txt'; |
4 | | -require_once __DIR__ . '/confdata.txt'; |
5 | | -require_once __DIR__ . '/crypto.txt'; |
6 | | -require_once __DIR__ . '/error.txt'; |
7 | | -require_once __DIR__ . '/file.txt'; |
8 | | -require_once __DIR__ . '/hash.txt'; |
9 | | -require_once __DIR__ . '/job-workers.txt'; |
10 | | -require_once __DIR__ . '/rpc.txt'; |
11 | | -require_once __DIR__ . '/serialize.txt'; |
12 | | -require_once __DIR__ . '/string.txt'; |
13 | | -require_once __DIR__ . '/server.txt'; |
14 | | -require_once __DIR__ . '/system.txt'; |
15 | | -require_once __DIR__ . '/kphp-toggles.txt'; |
16 | | -require_once __DIR__ . '/kphp_internal.txt'; |
17 | | -require_once __DIR__ . '/math.txt'; |
18 | | -require_once __DIR__ . '/time.txt'; |
19 | | -require_once __DIR__ . '/regex.txt'; |
20 | | -require_once __DIR__ . '/vkext.txt'; |
21 | | - |
22 | | -/** defined in runtime-core.h **/ |
23 | | -function likely ($x ::: bool) ::: bool; |
24 | | -function unlikely ($x ::: bool) ::: bool; |
25 | | - |
26 | 3 | define('TODO', -1); |
27 | 4 | define('TODO_OVERLOAD', -1); |
28 | 5 |
|
29 | | -define('PHP_INT_MAX', 9223372036854775807); |
30 | | -define('PHP_INT_MIN', -9223372036854775808); |
31 | | -define('PHP_INT_SIZE', 8); |
32 | | -define('PHP_EOL', "\n"); |
| 6 | +require_once __DIR__ . '/core/core-functions.txt'; |
| 7 | +require_once __DIR__ . '/core/kphp_internal.txt'; |
| 8 | +require_once __DIR__ . '/stdlib/array-functions.txt'; |
| 9 | +require_once __DIR__ . '/stdlib/component-functions.txt'; |
| 10 | +require_once __DIR__ . '/stdlib/confdata-functions.txt'; |
| 11 | +require_once __DIR__ . '/stdlib/crypto-functions.txt'; |
| 12 | +require_once __DIR__ . '/stdlib/curl-functions.txt'; |
| 13 | +require_once __DIR__ . '/stdlib/diagnostic.txt'; |
| 14 | +require_once __DIR__ . '/stdlib/error.txt'; |
| 15 | +require_once __DIR__ . '/stdlib/file-functions.txt'; |
| 16 | +require_once __DIR__ . '/stdlib/fork-functions.txt'; |
| 17 | +require_once __DIR__ . '/stdlib/job-workers.txt'; |
| 18 | +require_once __DIR__ . '/stdlib/kml-functions.txt'; |
| 19 | +require_once __DIR__ . '/stdlib/kphp-toggles.txt'; |
| 20 | +require_once __DIR__ . '/stdlib/kphp-tracing.txt'; |
| 21 | +require_once __DIR__ . '/stdlib/math-functions.txt'; |
| 22 | +require_once __DIR__ . '/stdlib/memcache.txt'; |
| 23 | +require_once __DIR__ . '/stdlib/output-functions.txt'; |
| 24 | +require_once __DIR__ . '/stdlib/regex-functions.txt'; |
| 25 | +require_once __DIR__ . '/stdlib/rpc.txt'; |
| 26 | +require_once __DIR__ . '/stdlib/serialize-functions.txt'; |
| 27 | +require_once __DIR__ . '/stdlib/server-functions.txt'; |
| 28 | +require_once __DIR__ . '/stdlib/spl.txt'; |
| 29 | +require_once __DIR__ . '/stdlib/string-functions.txt'; |
| 30 | +require_once __DIR__ . '/stdlib/system-functions.txt'; |
| 31 | +require_once __DIR__ . '/stdlib/time-functions.txt'; |
| 32 | +require_once __DIR__ . '/stdlib/uberh3.txt'; |
| 33 | +require_once __DIR__ . '/stdlib/vkext-functions.txt'; |
| 34 | +require_once __DIR__ . '/stdlib/zlib-functions.txt'; |
33 | 35 |
|
34 | 36 | if (0) { |
35 | 37 | define('PHP_SAPI', php_sapi_name());//"Defined in source code" |
36 | 38 | } |
37 | | - |
38 | | -/** @var mixed $_SERVER */ |
39 | | -global $_SERVER; |
40 | | -/** @var mixed $_GET */ |
41 | | -global $_GET; |
42 | | -/** @var mixed $_POST */ |
43 | | -global $_POST; |
44 | | -/** @var mixed $_FILES */ |
45 | | -global $_FILES; |
46 | | -/** @var mixed $_COOKIE */ |
47 | | -global $_COOKIE; |
48 | | -/** @var mixed $_REQUEST */ |
49 | | -global $_REQUEST; |
50 | | -/** @var mixed $_ENV */ |
51 | | -global $_ENV; |
52 | | -/** @var mixed $argc */ |
53 | | -global $argc; |
54 | | -/** @var mixed $argv */ |
55 | | -global $argv; |
56 | | - |
57 | | -function boolval ($v ::: any) ::: bool; |
58 | | -function intval ($v ::: mixed) ::: int; |
59 | | -function floatval ($v ::: mixed) ::: float; |
60 | | -function strval ($v ::: mixed) ::: string; |
61 | | - |
62 | | -/** |
63 | | - * @kphp-no-return |
64 | | - * @kphp-extern-func-info interruptible |
65 | | - */ |
66 | | -function exit($code = 0) ::: void; |
67 | | - |
68 | | -/** |
69 | | - * @kphp-no-return |
70 | | - * @kphp-extern-func-info interruptible |
71 | | - */ |
72 | | -function die($code = 0) ::: void; |
73 | | - |
74 | | -function ob_clean() ::: void; |
75 | | -function ob_end_clean() ::: bool; |
76 | | -function ob_get_clean() ::: string | false; |
77 | | -function ob_get_contents() ::: string; |
78 | | -function ob_start ($x ::: string = "") ::: void; |
79 | | -function ob_flush () ::: void; |
80 | | -function ob_end_flush () ::: bool; |
81 | | -function ob_get_flush () ::: string | false; |
82 | | -function ob_get_length () ::: int | false; |
83 | | -function ob_get_level () ::: int; |
84 | | - |
85 | | -function print_r ($v ::: any, $buffered ::: bool = false) ::: string; |
86 | | -function var_export ($v ::: any, $buffered ::: bool = false) ::: string; |
87 | | -function print ($v ::: string) ::: int; |
88 | | -function echo ($v ::: string) ::: void; |
89 | | -function dbg_echo ($v ::: string) ::: void; |
90 | | -function var_dump ($v ::: any) ::: void; |
91 | | - |
92 | | -function empty ($val ::: any) ::: bool; |
93 | | -function count ($val ::: any) ::: int; |
94 | | -function sizeof ($val ::: any) ::: int; |
95 | | -function gettype ($v ::: any) ::: string; |
96 | | -function is_scalar ($v ::: any) ::: bool; |
97 | | -function is_numeric ($v ::: mixed) ::: bool; |
98 | | -function is_null ($v ::: any) ::: bool; |
99 | | -function is_bool ($v ::: mixed) ::: bool; |
100 | | -function is_int ($v ::: mixed) ::: bool; |
101 | | -function is_integer ($v ::: mixed) ::: bool; |
102 | | -function is_long ($v ::: mixed) ::: bool; |
103 | | -function is_float ($v ::: mixed) ::: bool; |
104 | | -function is_double ($v ::: mixed) ::: bool; |
105 | | -function is_real ($v ::: mixed) ::: bool; |
106 | | -function is_string ($v ::: mixed) ::: bool; |
107 | | -function is_array ($v ::: any) ::: bool; |
108 | | -function is_object ($v ::: any) ::: bool; |
109 | | -function get_class ($v ::: any) ::: string; |
110 | | -function get_hash_of_class (object $klass) ::: int; |
111 | | - |
112 | | -function strlen ($str ::: string) ::: int; |
113 | | - |
114 | | -// === Future ===================================================================================== |
115 | | - |
116 | | -function get_running_fork_id() ::: future <void>; |
117 | | - |
118 | | -/** @kphp-extern-func-info can_throw interruptible cpp_template_call */ |
119 | | -function wait(future<any> | false $id, float $timeout = -1.0) ::: ^1[*] | null; |
120 | | - |
121 | | -/** @kphp-extern-func-info interruptible */ |
122 | | -function wait_concurrently ($id ::: future<any>): bool; |
123 | | - |
124 | | -/** @kphp-extern-func-info interruptible can_throw cpp_template_call */ |
125 | | -function wait_multi (future<any>[] $resumables) ::: (^1[*][*] | null)[]; |
126 | | - |
127 | | -// === Fork ======================================================================================= |
128 | | - |
129 | | -/** @kphp-extern-func-info interruptible */ |
130 | | -function sched_yield() ::: void; |
131 | | - |
132 | | -/** @kphp-extern-func-info interruptible */ |
133 | | -function sched_yield_sleep($duration ::: float) ::: void; |
134 | | - |
135 | | -// === Component ================================================================================== |
136 | | - |
137 | | -final class ComponentQuery { |
138 | | - private function __construct() ::: \ComponentQuery; |
139 | | -} |
140 | | - |
141 | | -/** @kphp-extern-func-info interruptible */ |
142 | | -function component_client_send_request($name ::: string, $message ::: string) ::: ComponentQuery; |
143 | | - |
144 | | -/** @kphp-extern-func-info interruptible */ |
145 | | -function component_client_fetch_response($query ::: ComponentQuery) ::: string; |
146 | | - |
147 | | -/** @kphp-extern-func-info interruptible */ |
148 | | -function component_server_accept_query() ::: ComponentQuery; |
149 | | - |
150 | | -/** @kphp-extern-func-info interruptible */ |
151 | | -function component_server_fetch_request($query ::: ComponentQuery) ::: string; |
152 | | - |
153 | | -/** @kphp-extern-func-info interruptible */ |
154 | | -function component_server_send_response($query ::: ComponentQuery, $message ::: string) ::: void; |
155 | | - |
156 | | -// === Misc ======================================================================================= |
157 | | - |
158 | | -/** @kphp-extern-func-info cpp_template_call */ |
159 | | -function instance_cast(any $instance, $to_type ::: string) ::: instance<^2>; |
160 | | - |
161 | | -function make_clone ($x ::: any) ::: ^1; |
162 | | - |
163 | | -function check_shutdown() ::: void; |
164 | | - |
165 | | -function warning($message ::: string) ::: void; |
166 | | -/** @kphp-no-return */ |
167 | | -function critical_error($message ::: string) ::: void; |
168 | | - |
169 | | -/** @kphp-extern-func-info interruptible */ |
170 | | -function set_timer(int $timeout, callable():void $callback) ::: void; |
171 | | - |
172 | | -// builtin that allows to store objects inside a mixed |
173 | | -function to_mixed(object $instance) ::: mixed; |
174 | | - |
175 | | -// === Unsupported ======================================================================================= |
176 | | - |
177 | | -require_once __DIR__ . '/unsupported-functions.txt'; |
178 | | - |
179 | | -/** @kphp-required */ |
180 | | -interface ArrayAccess { |
181 | | - public function offsetExists(mixed $offset): bool; |
182 | | - public function offsetGet(mixed $offset): mixed; |
183 | | - public function offsetSet(mixed $offset, mixed $value); |
184 | | - public function offsetUnset(mixed $offset); |
185 | | -} |
0 commit comments