basic_functions.stub.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941
  1. <?php
  2. /** @generate-class-entries */
  3. final class __PHP_Incomplete_Class
  4. {
  5. }
  6. class AssertionError extends Error
  7. {
  8. }
  9. /* main/main.c */
  10. function set_time_limit(int $seconds): bool {}
  11. /* main/SAPI.c */
  12. function header_register_callback(callable $callback): bool {}
  13. /* main/output.c */
  14. /** @param callable $callback */
  15. function ob_start($callback = null, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool {}
  16. function ob_flush(): bool {}
  17. function ob_clean(): bool {}
  18. function ob_end_flush(): bool {}
  19. function ob_end_clean(): bool {}
  20. /** @refcount 1 */
  21. function ob_get_flush(): string|false {}
  22. /** @refcount 1 */
  23. function ob_get_clean(): string|false {}
  24. function ob_get_contents(): string|false {}
  25. function ob_get_level(): int {}
  26. function ob_get_length(): int|false {}
  27. /**
  28. * @return array<int, string>
  29. * @refcount 1
  30. */
  31. function ob_list_handlers(): array {}
  32. /**
  33. * @return array<int|string, int|string|array>
  34. * @refcount 1
  35. */
  36. function ob_get_status(bool $full_status = false): array {}
  37. function ob_implicit_flush(bool $enable = true): void {}
  38. function output_reset_rewrite_vars(): bool {}
  39. function output_add_rewrite_var(string $name, string $value): bool {}
  40. /* main/streams/userspace.c */
  41. function stream_wrapper_register(string $protocol, string $class, int $flags = 0): bool {}
  42. /** @alias stream_wrapper_register */
  43. function stream_register_wrapper(string $protocol, string $class, int $flags = 0): bool {}
  44. function stream_wrapper_unregister(string $protocol): bool {}
  45. function stream_wrapper_restore(string $protocol): bool {}
  46. /* array.c */
  47. function array_push(array &$array, mixed ...$values): int {}
  48. /** @return true */
  49. function krsort(array &$array, int $flags = SORT_REGULAR): bool {}
  50. /** @return true */
  51. function ksort(array &$array, int $flags = SORT_REGULAR): bool {}
  52. function count(Countable|array $value, int $mode = COUNT_NORMAL): int {}
  53. /** @alias count */
  54. function sizeof(Countable|array $value, int $mode = COUNT_NORMAL): int {}
  55. function natsort(array &$array): bool {}
  56. function natcasesort(array &$array): bool {}
  57. /** @return true */
  58. function asort(array &$array, int $flags = SORT_REGULAR): bool {}
  59. /** @return true */
  60. function arsort(array &$array, int $flags = SORT_REGULAR): bool {}
  61. /** @return true */
  62. function sort(array &$array, int $flags = SORT_REGULAR): bool {}
  63. function rsort(array &$array, int $flags = SORT_REGULAR): bool {}
  64. /** @return true */
  65. function usort(array &$array, callable $callback): bool {}
  66. /** @return true */
  67. function uasort(array &$array, callable $callback): bool {}
  68. /** @return true */
  69. function uksort(array &$array, callable $callback): bool {}
  70. function end(array|object &$array): mixed {}
  71. function prev(array|object &$array): mixed {}
  72. function next(array|object &$array): mixed {}
  73. function reset(array|object &$array): mixed {}
  74. function current(array|object $array): mixed {}
  75. /** @alias current */
  76. function pos(array|object $array): mixed {}
  77. function key(array|object $array): int|string|null {}
  78. function min(mixed $value, mixed ...$values): mixed {}
  79. function max(mixed $value, mixed ...$values): mixed {}
  80. /** @return true */
  81. function array_walk(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {}
  82. /** @return true */
  83. function array_walk_recursive(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {}
  84. function in_array(mixed $needle, array $haystack, bool $strict = false): bool {}
  85. function array_search(mixed $needle, array $haystack, bool $strict = false): int|string|false {}
  86. /** @prefer-ref $array */
  87. function extract(array &$array, int $flags = EXTR_OVERWRITE, string $prefix = ""): int {}
  88. /**
  89. * @param array|string $var_name
  90. * @param array|string $var_names
  91. * @return array<string, mixed|ref>
  92. * @refcount 1
  93. */
  94. function compact($var_name, ...$var_names): array {}
  95. /** @return array<int, mixed> */
  96. function array_fill(int $start_index, int $count, mixed $value): array {}
  97. /** @refcount 1 */
  98. function array_fill_keys(array $keys, mixed $value): array {}
  99. /**
  100. * @param string|int|float $start
  101. * @param string|int|float $end
  102. */
  103. function range($start, $end, int|float $step = 1): array {}
  104. /** @return true */
  105. function shuffle(array &$array): bool {}
  106. function array_pop(array &$array): mixed {}
  107. function array_shift(array &$array): mixed {}
  108. function array_unshift(array &$array, mixed ...$values): int {}
  109. function array_splice(array &$array, int $offset, ?int $length = null, mixed $replacement = []): array {}
  110. function array_slice(array $array, int $offset, ?int $length = null, bool $preserve_keys = false): array {}
  111. function array_merge(array ...$arrays): array {}
  112. function array_merge_recursive(array ...$arrays): array {}
  113. /** @refcount 1 */
  114. function array_replace(array $array, array ...$replacements): array {}
  115. /** @refcount 1 */
  116. function array_replace_recursive(array $array, array ...$replacements): array {}
  117. /** @return array<int, int|string> */
  118. function array_keys(array $array, mixed $filter_value = UNKNOWN, bool $strict = false): array {}
  119. function array_key_first(array $array): int|string|null {}
  120. function array_key_last(array $array): int|string|null {}
  121. /** @return array<int, mixed|ref> */
  122. function array_values(array $array): array {}
  123. /**
  124. * @return array<int|string, int>
  125. * @refcount 1
  126. */
  127. function array_count_values(array $array): array {}
  128. /** @refcount 1 */
  129. function array_column(array $array, int|string|null $column_key, int|string|null $index_key = null): array {}
  130. /** @refcount 1 */
  131. function array_reverse(array $array, bool $preserve_keys = false): array {}
  132. function array_pad(array $array, int $length, mixed $value): array {}
  133. /**
  134. * @return array<int|string, int|string>
  135. * @refcount 1
  136. */
  137. function array_flip(array $array): array {}
  138. /** @refcount 1 */
  139. function array_change_key_case(array $array, int $case = CASE_LOWER): array {}
  140. function array_unique(array $array, int $flags = SORT_STRING): array {}
  141. /** @refcount 1 */
  142. function array_intersect_key(array $array, array ...$arrays): array {}
  143. /**
  144. * @param array|callable $rest
  145. * @refcount 1
  146. */
  147. function array_intersect_ukey(array $array, ...$rest): array {}
  148. /** @refcount 1 */
  149. function array_intersect(array $array, array ...$arrays): array {}
  150. /**
  151. * @param array|callable $rest
  152. * @refcount 1
  153. */
  154. function array_uintersect(array $array, ...$rest): array {}
  155. /** @refcount 1 */
  156. function array_intersect_assoc(array $array, array ...$arrays): array {}
  157. /**
  158. * @param array|callable $rest
  159. * @refcount 1
  160. */
  161. function array_uintersect_assoc(array $array, ...$rest): array {}
  162. /**
  163. * @param array|callable $rest
  164. * @refcount 1
  165. */
  166. function array_intersect_uassoc(array $array, ...$rest): array {}
  167. /**
  168. * @param array|callable $rest
  169. * @refcount 1
  170. */
  171. function array_uintersect_uassoc(array $array, ...$rest): array {}
  172. /** @refcount 1 */
  173. function array_diff_key(array $array, array ...$arrays): array {}
  174. /**
  175. * @param array|callable $rest
  176. * @refcount 1
  177. */
  178. function array_diff_ukey(array $array, ...$rest): array {}
  179. function array_diff(array $array, array ...$arrays): array {}
  180. /**
  181. * @param array|callable $rest
  182. * @refcount 1
  183. */
  184. function array_udiff(array $array, ...$rest): array {}
  185. /** @refcount 1 */
  186. function array_diff_assoc(array $array, array ...$arrays): array {}
  187. /**
  188. * @param array|callable $rest
  189. * @refcount 1
  190. */
  191. function array_diff_uassoc(array $array, ...$rest): array {}
  192. /**
  193. * @param array|callable $rest
  194. * @refcount 1
  195. */
  196. function array_udiff_assoc(array $array, ...$rest): array {}
  197. /**
  198. * @param array|callable $rest
  199. * @refcount 1
  200. */
  201. function array_udiff_uassoc(array $array, ...$rest): array {}
  202. /**
  203. * @param array $array
  204. * @param array|int $rest
  205. * @prefer-ref $array
  206. * @prefer-ref $rest
  207. */
  208. function array_multisort(&$array, &...$rest): bool {}
  209. /** @return int|string|array<int, int|string> */
  210. function array_rand(array $array, int $num = 1): int|string|array {}
  211. function array_sum(array $array): int|float {}
  212. function array_product(array $array): int|float {}
  213. function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {}
  214. function array_filter(array $array, ?callable $callback = null, int $mode = 0): array {}
  215. function array_map(?callable $callback, array $array, array ...$arrays): array {}
  216. /** @param string|int $key */
  217. function array_key_exists($key, array $array): bool {}
  218. /**
  219. * @param string|int $key
  220. * @alias array_key_exists
  221. */
  222. function key_exists($key, array $array): bool {}
  223. function array_chunk(array $array, int $length, bool $preserve_keys = false): array {}
  224. function array_combine(array $keys, array $values): array {}
  225. function array_is_list(array $array): bool {}
  226. /* base64.c */
  227. /** @refcount 1 */
  228. function base64_encode(string $string): string {}
  229. /** @refcount 1 */
  230. function base64_decode(string $string, bool $strict = false): string|false {}
  231. /* basic_functions.c */
  232. function constant(string $name): mixed {}
  233. function ip2long(string $ip): int|false {}
  234. /** @refcount 1 */
  235. function long2ip(int $ip): string|false {}
  236. /**
  237. * @return string|array<string, string>|false
  238. * @refcount 1
  239. */
  240. function getenv(?string $name = null, bool $local_only = false): string|array|false {}
  241. #ifdef HAVE_PUTENV
  242. function putenv(string $assignment): bool {}
  243. #endif
  244. /**
  245. * @param int $rest_index
  246. * @return array<int|string, string|array|false>|false
  247. * @refcount 1
  248. */
  249. function getopt(string $short_options, array $long_options = [], &$rest_index = null): array|false {}
  250. function flush(): void {}
  251. function sleep(int $seconds): int {}
  252. function usleep(int $microseconds): void {}
  253. #if HAVE_NANOSLEEP
  254. /**
  255. * @return array<string, int>|bool
  256. * @refcount 1
  257. */
  258. function time_nanosleep(int $seconds, int $nanoseconds): array|bool {}
  259. function time_sleep_until(float $timestamp): bool {}
  260. #endif
  261. /** @refcount 1 */
  262. function get_current_user(): string {}
  263. /** @return string|array<int|string, string|array>|false */
  264. function get_cfg_var(string $option): string|array|false {}
  265. function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $additional_headers = null): bool {}
  266. /**
  267. * @return array<string, int|string>|null
  268. * @refcount 1
  269. */
  270. function error_get_last(): ?array {}
  271. function error_clear_last(): void {}
  272. function call_user_func(callable $callback, mixed ...$args): mixed {}
  273. function call_user_func_array(callable $callback, array $args): mixed {}
  274. function forward_static_call(callable $callback, mixed ...$args): mixed {}
  275. function forward_static_call_array(callable $callback, array $args): mixed {}
  276. /** @return false|null */
  277. function register_shutdown_function(callable $callback, mixed ...$args): ?bool {}
  278. /** @refcount 1 */
  279. function highlight_file(string $filename, bool $return = false): string|bool {}
  280. /** @alias highlight_file */
  281. function show_source(string $filename, bool $return = false): string|bool {}
  282. /** @refcount 1 */
  283. function php_strip_whitespace(string $filename): string {}
  284. /** @refcount 1 */
  285. function highlight_string(string $string, bool $return = false): string|bool {}
  286. function ini_get(string $option): string|false {}
  287. /**
  288. * @return array<string, string|array|null>|false
  289. * @refcount 1
  290. */
  291. function ini_get_all(?string $extension = null, bool $details = true): array|false {}
  292. function ini_set(string $option, string|int|float|bool|null $value): string|false {}
  293. /** @alias ini_set */
  294. function ini_alter(string $option, string|int|float|bool|null $value): string|false {}
  295. function ini_restore(string $option): void {}
  296. /** @refcount 1 */
  297. function set_include_path(string $include_path): string|false {}
  298. /** @refcount 1 */
  299. function get_include_path(): string|false {}
  300. /** @refcount 1 */
  301. function print_r(mixed $value, bool $return = false): string|bool {}
  302. function connection_aborted(): int {}
  303. function connection_status(): int {}
  304. function ignore_user_abort(?bool $enable = null): int {}
  305. #if HAVE_GETSERVBYNAME
  306. function getservbyname(string $service, string $protocol): int|false {}
  307. #endif
  308. #if HAVE_GETSERVBYPORT
  309. /** @refcount 1 */
  310. function getservbyport(int $port, string $protocol): string|false {}
  311. #endif
  312. #if HAVE_GETPROTOBYNAME
  313. function getprotobyname(string $protocol): int|false {}
  314. #endif
  315. #if HAVE_GETPROTOBYNUMBER
  316. /** @refcount 1 */
  317. function getprotobynumber(int $protocol): string|false {}
  318. #endif
  319. function register_tick_function(callable $callback, mixed ...$args): bool {}
  320. function unregister_tick_function(callable $callback): void {}
  321. function is_uploaded_file(string $filename): bool {}
  322. function move_uploaded_file(string $from, string $to): bool {}
  323. /**
  324. * @return array<int|string, bool|int|float|string|array|null>|false
  325. * @refcount 1
  326. */
  327. function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
  328. /**
  329. * @return array<int|string, bool|int|float|string|array|null>|false
  330. * @refcount 1
  331. */
  332. function parse_ini_string(string $ini_string, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {}
  333. #if ZEND_DEBUG
  334. /**
  335. * @return array<string, string|array>
  336. * @refcount 1
  337. */
  338. function config_get_hash(): array {}
  339. #endif
  340. #ifdef HAVE_GETLOADAVG
  341. /**
  342. * @return array<int, float>|false
  343. * @refcount 1
  344. */
  345. function sys_getloadavg(): array|false {}
  346. #endif
  347. /* browscap.c */
  348. /**
  349. * @return object|array<string, mixed>|false
  350. * @refcount 1
  351. */
  352. function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {}
  353. /* crc32.c */
  354. function crc32(string $string): int {}
  355. /* crypt.c */
  356. /** @refcount 1 */
  357. function crypt(string $string, string $salt): string {}
  358. /* datetime.c */
  359. #if HAVE_STRPTIME
  360. /**
  361. * @return array<string, int|string>|false
  362. * @deprecated
  363. * @refcount 1
  364. */
  365. function strptime(string $timestamp, string $format): array|false {}
  366. #endif
  367. /* dns.c */
  368. #ifdef HAVE_GETHOSTNAME
  369. /** @refcount 1 */
  370. function gethostname(): string|false {}
  371. #endif
  372. /** @refcount 1 */
  373. function gethostbyaddr(string $ip): string|false {}
  374. /** @refcount 1 */
  375. function gethostbyname(string $hostname): string {}
  376. /**
  377. * @return array<int, string>|false
  378. * @refcount 1
  379. */
  380. function gethostbynamel(string $hostname): array|false {}
  381. #if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
  382. function dns_check_record(string $hostname, string $type = "MX"): bool {}
  383. /** @alias dns_check_record */
  384. function checkdnsrr(string $hostname, string $type = "MX"): bool {}
  385. /**
  386. * @param array $authoritative_name_servers
  387. * @param array $additional_records
  388. * @return array<int, array>|false
  389. * @refcount 1
  390. */
  391. function dns_get_record(string $hostname, int $type = DNS_ANY, &$authoritative_name_servers = null, &$additional_records = null, bool $raw = false): array|false {}
  392. /**
  393. * @param array $hosts
  394. * @param array $weights
  395. */
  396. function dns_get_mx(string $hostname, &$hosts, &$weights = null): bool {}
  397. /**
  398. * @param array $hosts
  399. * @param array $weights
  400. * @alias dns_get_mx
  401. */
  402. function getmxrr(string $hostname, &$hosts, &$weights = null): bool {}
  403. #endif
  404. /* net.c */
  405. #if defined(PHP_WIN32) || HAVE_GETIFADDRS || defined(__PASE__)
  406. function net_get_interfaces(): array|false {}
  407. #endif
  408. /* ftok.c */
  409. #if HAVE_FTOK
  410. function ftok(string $filename, string $project_id): int {}
  411. #endif
  412. /* hrtime.c */
  413. function hrtime(bool $as_number = false): array|int|float|false {}
  414. /* lcg.c */
  415. function lcg_value(): float {}
  416. /* md5.c */
  417. /** @refcount 1 */
  418. function md5(string $string, bool $binary = false): string {}
  419. /** @refcount 1 */
  420. function md5_file(string $filename, bool $binary = false): string|false {}
  421. /* pageinfo.c */
  422. function getmyuid(): int|false {}
  423. function getmygid(): int|false {}
  424. function getmypid(): int|false {}
  425. function getmyinode(): int|false {}
  426. function getlastmod(): int|false {}
  427. /* sha1.c */
  428. /** @refcount 1 */
  429. function sha1(string $string, bool $binary = false): string {}
  430. /** @refcount 1 */
  431. function sha1_file(string $filename, bool $binary = false): string|false {}
  432. /* syslog.c */
  433. #ifdef HAVE_SYSLOG_H
  434. function openlog(string $prefix, int $flags, int $facility): bool {}
  435. /** @return true */
  436. function closelog(): bool {}
  437. /** @return true */
  438. function syslog(int $priority, string $message): bool {} // TODO make return type void
  439. #endif
  440. #ifdef HAVE_INET_NTOP
  441. /** @refcount 1 */
  442. function inet_ntop(string $ip): string|false {}
  443. #endif
  444. #ifdef HAVE_INET_PTON
  445. /** @refcount 1 */
  446. function inet_pton(string $ip): string|false {}
  447. #endif
  448. /* metaphone.c */
  449. /** @refcount 1 */
  450. function metaphone(string $string, int $max_phonemes = 0): string {}
  451. /* {{{ head.c */
  452. function header(string $header, bool $replace = true, int $response_code = 0): void {}
  453. function header_remove(?string $name = null): void {}
  454. function setrawcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {}
  455. function setcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {}
  456. function http_response_code(int $response_code = 0): int|bool {}
  457. /**
  458. * @param string $filename
  459. * @param int $line
  460. */
  461. function headers_sent(&$filename = null, &$line = null): bool {}
  462. /**
  463. * @return array<int, string>
  464. * @refcount 1
  465. */
  466. function headers_list(): array {}
  467. /* {{{ html.c */
  468. /** @refcount 1 */
  469. function htmlspecialchars(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null, bool $double_encode = true): string {}
  470. function htmlspecialchars_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401): string {}
  471. function html_entity_decode(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null): string {}
  472. /** @refcount 1 */
  473. function htmlentities(string $string, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, ?string $encoding = null, bool $double_encode = true): string {}
  474. /**
  475. * @return array<string, string>
  476. * @refcount 1
  477. */
  478. function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = "UTF-8"): array {}
  479. /* }}} */
  480. /* assert.c */
  481. function assert(mixed $assertion, Throwable|string|null $description = null): bool {}
  482. function assert_options(int $option, mixed $value = UNKNOWN): mixed {}
  483. /* string.c */
  484. /** @refcount 1 */
  485. function bin2hex(string $string): string {}
  486. /** @refcount 1 */
  487. function hex2bin(string $string): string|false {}
  488. function strspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {}
  489. function strcspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {}
  490. #if HAVE_NL_LANGINFO
  491. /** @refcount 1 */
  492. function nl_langinfo(int $item): string|false {}
  493. #endif
  494. function strcoll(string $string1, string $string2): int {}
  495. function trim(string $string, string $characters = " \n\r\t\v\0"): string {}
  496. function rtrim(string $string, string $characters = " \n\r\t\v\0"): string {}
  497. /** @alias rtrim */
  498. function chop(string $string, string $characters = " \n\r\t\v\0"): string {}
  499. function ltrim(string $string, string $characters = " \n\r\t\v\0"): string {}
  500. /** @refcount 1 */
  501. function wordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false): string {}
  502. /**
  503. * @return array<int, string>
  504. * @refcount 1
  505. */
  506. function explode(string $separator, string $string, int $limit = PHP_INT_MAX): array {}
  507. function implode(string|array $separator, ?array $array = null): string {}
  508. /** @alias implode */
  509. function join(string|array $separator, ?array $array = null): string {}
  510. /** @refcount 1 */
  511. function strtok(string $string, ?string $token = null): string|false {}
  512. function strtoupper(string $string): string {}
  513. function strtolower(string $string): string {}
  514. /** @refcount 1 */
  515. function basename(string $path, string $suffix = ""): string {}
  516. /** @refcount 1 */
  517. function dirname(string $path, int $levels = 1): string {}
  518. /**
  519. * @return array<string, string>|string
  520. * @refcount 1
  521. */
  522. function pathinfo(string $path, int $flags = PATHINFO_ALL): array|string {}
  523. /** @refcount 1 */
  524. function stristr(string $haystack, string $needle, bool $before_needle = false): string|false {}
  525. /** @refcount 1 */
  526. function strstr(string $haystack, string $needle, bool $before_needle = false): string|false {}
  527. /** @alias strstr */
  528. function strchr(string $haystack, string $needle, bool $before_needle = false): string|false {}
  529. function strpos(string $haystack, string $needle, int $offset = 0): int|false {}
  530. function stripos(string $haystack, string $needle, int $offset = 0): int|false {}
  531. function strrpos(string $haystack, string $needle, int $offset = 0): int|false {}
  532. function strripos(string $haystack, string $needle, int $offset = 0): int|false {}
  533. /** @refcount 1 */
  534. function strrchr(string $haystack, string $needle): string|false {}
  535. function str_contains(string $haystack, string $needle): bool {}
  536. function str_starts_with(string $haystack, string $needle): bool {}
  537. function str_ends_with(string $haystack, string $needle): bool {}
  538. /** @refcount 1 */
  539. function chunk_split(string $string, int $length = 76, string $separator = "\r\n"): string {}
  540. function substr(string $string, int $offset, ?int $length = null): string {}
  541. /** @return string|array<int|string, string> */
  542. function substr_replace(array|string $string, array|string $replace, array|int $offset, array|int|null $length = null): string|array {}
  543. /** @refcount 1 */
  544. function quotemeta(string $string): string {}
  545. function ord(string $character): int {}
  546. /** @refcount 1 */
  547. function chr(int $codepoint): string {}
  548. function ucfirst(string $string): string {}
  549. function lcfirst(string $string): string {}
  550. /** @refcount 1 */
  551. function ucwords(string $string, string $separators = " \t\r\n\f\v"): string {}
  552. function strtr(string $string, string|array $from, ?string $to = null): string {}
  553. /** @refcount 1 */
  554. function strrev(string $string): string {}
  555. /** @param float $percent */
  556. function similar_text(string $string1, string $string2, &$percent = null): int {}
  557. function addcslashes(string $string, string $characters): string {}
  558. function addslashes(string $string): string {}
  559. /** @refcount 1 */
  560. function stripcslashes(string $string): string {}
  561. /** @refcount 1 */
  562. function stripslashes(string $string): string {}
  563. /**
  564. * @param int $count
  565. * @return string|array<int|string, string>
  566. */
  567. function str_replace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {}
  568. /**
  569. * @param int $count
  570. * @return string|array<int|string, string>
  571. */
  572. function str_ireplace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {}
  573. /** @refcount 1 */
  574. function hebrev(string $string, int $max_chars_per_line = 0): string {}
  575. function nl2br(string $string, bool $use_xhtml = true): string {}
  576. /** @refcount 1 */
  577. function strip_tags(string $string, array|string|null $allowed_tags = null): string {}
  578. /**
  579. * @param array|string $locales
  580. * @param string $rest
  581. */
  582. function setlocale(int $category, $locales, ...$rest): string|false {}
  583. /** @param array $result */
  584. function parse_str(string $string, &$result): void {}
  585. /**
  586. * @return array<int, string|null>
  587. * @refcount 1
  588. */
  589. function str_getcsv(string $string, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array {}
  590. /** @refcount 1 */
  591. function str_repeat(string $string, int $times): string {}
  592. /**
  593. * @return array<int, int>|string
  594. * @refcount 1
  595. */
  596. function count_chars(string $string, int $mode = 0): array|string {}
  597. function strnatcmp(string $string1, string $string2): int {}
  598. /**
  599. * @return array<string, int|string|array>
  600. * @refcount 1
  601. */
  602. function localeconv(): array {}
  603. function strnatcasecmp(string $string1, string $string2): int {}
  604. function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length = null): int {}
  605. function str_pad(string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT): string {}
  606. /**
  607. * @return array<int, mixed>|int|null
  608. * @refcount 1
  609. */
  610. function sscanf(string $string, string $format, mixed &...$vars): array|int|null {}
  611. /** @refcount 1 */
  612. function str_rot13(string $string): string {}
  613. /** @refcount 1 */
  614. function str_shuffle(string $string): string {}
  615. /**
  616. * @return array<int, string>|int
  617. * @refcount 1
  618. */
  619. function str_word_count(string $string, int $format = 0, ?string $characters = null): array|int {}
  620. /**
  621. * @return array<int, string>
  622. * @refcount 1
  623. */
  624. function str_split(string $string, int $length = 1): array {}
  625. /** @refcount 1 */
  626. function strpbrk(string $string, string $characters): string|false {}
  627. function substr_compare(string $haystack, string $needle, int $offset, ?int $length = null, bool $case_insensitive = false): int {}
  628. /** @refcount 1 */
  629. function utf8_encode(string $string): string {}
  630. /** @refcount 1 */
  631. function utf8_decode(string $string): string {}
  632. /* dir.c */
  633. /**
  634. * @param resource|null $context
  635. * @return resource|false
  636. */
  637. function opendir(string $directory, $context = null) {}
  638. /**
  639. * @param resource|null $context
  640. * @refcount 1
  641. */
  642. function dir(string $directory, $context = null): Directory|false {}
  643. /** @param resource|null $dir_handle */
  644. function closedir($dir_handle = null): void {}
  645. function chdir(string $directory): bool {}
  646. #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
  647. function chroot(string $directory): bool {}
  648. #endif
  649. /** @refcount 1 */
  650. function getcwd(): string|false {}
  651. /** @param resource|null $dir_handle */
  652. function rewinddir($dir_handle = null): void {}
  653. /**
  654. * @param resource|null $dir_handle
  655. * @refcount 1
  656. */
  657. function readdir($dir_handle = null): string|false {}
  658. /**
  659. * @param resource|null $context
  660. * @return array<int, string>|false
  661. * @refcount 1
  662. */
  663. function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array|false {}
  664. #ifdef HAVE_GLOB
  665. /**
  666. * @return array<int, string>|false
  667. * @refcount 1
  668. */
  669. function glob(string $pattern, int $flags = 0): array|false {}
  670. #endif
  671. /* exec.c */
  672. /**
  673. * @param array $output
  674. * @param int $result_code
  675. * @refcount 1
  676. */
  677. function exec(string $command, &$output = null, &$result_code = null): string|false {}
  678. /**
  679. * @param int $result_code
  680. * @refcount 1
  681. */
  682. function system(string $command, &$result_code = null): string|false {}
  683. /**
  684. * @param int $result_code
  685. * @return false|null
  686. */
  687. function passthru(string $command, &$result_code = null): ?bool {}
  688. /** @refcount 1 */
  689. function escapeshellcmd(string $command): string {}
  690. /** @refcount 1 */
  691. function escapeshellarg(string $arg): string {}
  692. /** @refcount 1 */
  693. function shell_exec(string $command): string|false|null {}
  694. #ifdef HAVE_NICE
  695. function proc_nice(int $priority): bool {}
  696. #endif
  697. /* file.c */
  698. /**
  699. * @param resource $stream
  700. * @param int $would_block
  701. */
  702. function flock($stream, int $operation, &$would_block = null): bool {}
  703. /**
  704. * @return array<string, string>|false
  705. * @refcount 1
  706. */
  707. function get_meta_tags(string $filename, bool $use_include_path = false): array|false {}
  708. /** @param resource $handle */
  709. function pclose($handle): int {}
  710. /**
  711. * @return resource|false
  712. * @refcount 1
  713. */
  714. function popen(string $command, string $mode) {}
  715. /** @param resource|null $context */
  716. function readfile(string $filename, bool $use_include_path = false, $context = null): int|false {}
  717. /** @param resource $stream */
  718. function rewind($stream): bool {}
  719. /** @param resource|null $context */
  720. function rmdir(string $directory, $context = null): bool {}
  721. function umask(?int $mask = null): int {}
  722. /** @param resource $stream */
  723. function fclose($stream): bool {}
  724. /** @param resource $stream */
  725. function feof($stream): bool {}
  726. /** @param resource $stream */
  727. function fgetc($stream): string|false {}
  728. /**
  729. * @param resource $stream
  730. * @refcount 1
  731. */
  732. function fgets($stream, ?int $length = null): string|false {}
  733. /**
  734. * @param resource $stream
  735. * @refcount 1
  736. */
  737. function fread($stream, int $length): string|false {}
  738. /**
  739. * @param resource|null $context
  740. * @return resource|false
  741. * @refcount 1
  742. */
  743. function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) {}
  744. /**
  745. * @param resource $stream
  746. * @return array<int, mixed>|int|false|null
  747. * @refcount 1
  748. */
  749. function fscanf($stream, string $format, mixed &...$vars): array|int|false|null {}
  750. /** @param resource $stream */
  751. function fpassthru($stream): int {}
  752. /** @param resource $stream */
  753. function ftruncate($stream, int $size): bool {}
  754. /**
  755. * @param resource $stream
  756. * @return array<int|string, int>|false
  757. * @refcount 1
  758. */
  759. function fstat($stream): array|false {}
  760. /** @param resource $stream */
  761. function fseek($stream, int $offset, int $whence = SEEK_SET): int {}
  762. /** @param resource $stream */
  763. function ftell($stream): int|false {}
  764. /** @param resource $stream */
  765. function fflush($stream): bool {}
  766. /** @param resource $stream */
  767. function fsync($stream): bool {}
  768. /** @param resource $stream */
  769. function fdatasync($stream): bool {}
  770. /** @param resource $stream */
  771. function fwrite($stream, string $data, ?int $length = null): int|false {}
  772. /**
  773. * @param resource $stream
  774. * @alias fwrite
  775. */
  776. function fputs($stream, string $data, ?int $length = null): int|false {}
  777. /** @param resource|null $context */
  778. function mkdir(string $directory, int $permissions = 0777, bool $recursive = false, $context = null): bool {}
  779. /** @param resource|null $context */
  780. function rename(string $from, string $to, $context = null): bool {}
  781. /** @param resource|null $context */
  782. function copy(string $from, string $to, $context = null): bool {}
  783. /** @refcount 1 */
  784. function tempnam(string $directory, string $prefix): string|false {}
  785. /**
  786. * @return resource|false
  787. * @refcount 1
  788. */
  789. function tmpfile() {}
  790. /**
  791. * @param resource|null $context
  792. * @return array<int, string>|false
  793. * @refcount 1
  794. */
  795. function file(string $filename, int $flags = 0, $context = null): array|false {}
  796. /**
  797. * @param resource|null $context
  798. * @refcount 1
  799. */
  800. function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $length = null): string|false {}
  801. /** @param resource|null $context */
  802. function unlink(string $filename, $context = null): bool {}
  803. /** @param resource|null $context */
  804. function file_put_contents(string $filename, mixed $data, int $flags = 0, $context = null): int|false {}
  805. /** @param resource $stream */
  806. function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\", string $eol = "\n"): int|false {}
  807. /**
  808. * @param resource $stream
  809. * @return array<int, string|null>|false
  810. * @refcount 1
  811. */
  812. function fgetcsv($stream, ?int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false {}
  813. /** @refcount 1 */
  814. function realpath(string $path): string|false {}
  815. #ifdef HAVE_FNMATCH
  816. function fnmatch(string $pattern, string $filename, int $flags = 0): bool {}
  817. #endif
  818. /** @refcount 1 */
  819. function sys_get_temp_dir(): string {}
  820. /* filestat.c */
  821. function fileatime(string $filename): int|false {}
  822. function filectime(string $filename): int|false {}
  823. function filegroup(string $filename): int|false {}
  824. function fileinode(string $filename): int|false {}
  825. function filemtime(string $filename): int|false {}
  826. function fileowner(string $filename): int|false {}
  827. function fileperms(string $filename): int|false {}
  828. function filesize(string $filename): int|false {}
  829. /** @refcount 1 */
  830. function filetype(string $filename): string|false {}
  831. function file_exists(string $filename): bool {}
  832. function is_writable(string $filename): bool {}
  833. /** @alias is_writable */
  834. function is_writeable(string $filename): bool {}
  835. function is_readable(string $filename): bool {}
  836. function is_executable(string $filename): bool {}
  837. function is_file(string $filename): bool {}
  838. function is_dir(string $filename): bool {}
  839. function is_link(string $filename): bool {}
  840. /**
  841. * @return array<int|string, bool|int|string>|false
  842. * @refcount 1
  843. */
  844. function stat(string $filename): array|false {}
  845. /**
  846. * @return array<int|string, bool|int|string>|false
  847. * @refcount 1
  848. */
  849. function lstat(string $filename): array|false {}
  850. function chown(string $filename, string|int $user): bool {}
  851. function chgrp(string $filename, string|int $group): bool {}
  852. #if HAVE_LCHOWN
  853. function lchown(string $filename, string|int $user): bool {}
  854. function lchgrp(string $filename, string|int $group): bool {}
  855. #endif
  856. function chmod(string $filename, int $permissions): bool {}
  857. #if HAVE_UTIME
  858. function touch(string $filename, ?int $mtime = null, ?int $atime = null): bool {}
  859. #endif
  860. function clearstatcache(bool $clear_realpath_cache = false, string $filename = ""): void {}
  861. function disk_total_space(string $directory): float|false {}
  862. function disk_free_space(string $directory): float|false {}
  863. /** @alias disk_free_space */
  864. function diskfreespace(string $directory): float|false {}
  865. /**
  866. * @return array<string, array>
  867. * @refcount 1
  868. */
  869. function realpath_cache_get(): array {}
  870. function realpath_cache_size(): int {}
  871. /* formatted_print.c */
  872. /** @refcount 1 */
  873. function sprintf(string $format, mixed ...$values): string {}
  874. function printf(string $format, mixed ...$values): int {}
  875. function vprintf(string $format, array $values): int {}
  876. /** @refcount 1 */
  877. function vsprintf(string $format, array $values): string {}
  878. /** @param resource $stream */
  879. function fprintf($stream, string $format, mixed ...$values): int {}
  880. /** @param resource $stream */
  881. function vfprintf($stream, string $format, array $values): int {}
  882. /* fsock.c */
  883. /**
  884. * @param int $error_code
  885. * @param string $error_message
  886. * @return resource|false
  887. * @refcount 1
  888. */
  889. function fsockopen(string $hostname, int $port = -1, &$error_code = null, &$error_message = null, ?float $timeout = null) {}
  890. /**
  891. * @param int $error_code
  892. * @param string $error_message
  893. * @return resource|false
  894. */
  895. function pfsockopen(string $hostname, int $port = -1, &$error_code = null, &$error_message = null, ?float $timeout = null) {}
  896. /* http.c */
  897. /** @refcount 1 */
  898. function http_build_query(array|object $data, string $numeric_prefix = "", ?string $arg_separator = null, int $encoding_type = PHP_QUERY_RFC1738): string {}
  899. /* image.c */
  900. /** @refcount 1 */
  901. function image_type_to_mime_type(int $image_type): string {}
  902. /** @refcount 1 */
  903. function image_type_to_extension(int $image_type, bool $include_dot = true): string|false {}
  904. /**
  905. * @param array $image_info
  906. * @return array<int|string, int|string>|false
  907. * @refcount 1
  908. */
  909. function getimagesize(string $filename, &$image_info = null): array|false {}
  910. /**
  911. * @param array $image_info
  912. * @return array<int|string, int|string>|false
  913. * @refcount 1
  914. */
  915. function getimagesizefromstring(string $string, &$image_info = null): array|false {}
  916. /* info.c */
  917. /** @return true */
  918. function phpinfo(int $flags = INFO_ALL): bool {} // make return type void
  919. /** @refcount 1 */
  920. function phpversion(?string $extension = null): string|false {}
  921. /** @return true */
  922. function phpcredits(int $flags = CREDITS_ALL): bool {} // make return type void
  923. /** @refcount 1 */
  924. function php_sapi_name(): string|false {}
  925. /** @refcount 1 */
  926. function php_uname(string $mode = "a"): string {}
  927. /** @refcount 1 */
  928. function php_ini_scanned_files(): string|false {}
  929. /** @refcount 1 */
  930. function php_ini_loaded_file(): string|false {}
  931. /* iptc.c */
  932. /** @refcount 1 */
  933. function iptcembed(string $iptc_data, string $filename, int $spool = 0): string|bool {}
  934. /**
  935. * @return array<string, array>|false
  936. * @refcount 1
  937. */
  938. function iptcparse(string $iptc_block): array|false {}
  939. /* levenshtein.c */
  940. function levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1): int {}
  941. /* link.c */
  942. #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
  943. /** @refcount 1 */
  944. function readlink(string $path): string|false {}
  945. function linkinfo(string $path): int|false {}
  946. function symlink(string $target, string $link): bool {}
  947. function link(string $target, string $link): bool {}
  948. #endif
  949. /* mail.c */
  950. function mail(string $to, string $subject, string $message, array|string $additional_headers = [], string $additional_params = ""): bool {}
  951. /* math.c */
  952. function abs(int|float $num): int|float {}
  953. function ceil(int|float $num): float {}
  954. function floor(int|float $num): float {}
  955. function round(int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float {}
  956. function sin(float $num): float {}
  957. function cos(float $num): float {}
  958. function tan(float $num): float {}
  959. function asin(float $num): float {}
  960. function acos(float $num): float {}
  961. function atan(float $num): float {}
  962. function atanh(float $num): float {}
  963. function atan2(float $y, float $x): float {}
  964. function sinh(float $num): float {}
  965. function cosh(float $num): float {}
  966. function tanh(float $num): float {}
  967. function asinh(float $num): float {}
  968. function acosh(float $num): float {}
  969. function expm1(float $num): float {}
  970. function log1p(float $num): float {}
  971. function pi(): float {}
  972. function is_finite(float $num): bool {}
  973. function is_nan(float $num): bool {}
  974. function intdiv(int $num1, int $num2): int {}
  975. function is_infinite(float $num): bool {}
  976. function pow(mixed $num, mixed $exponent): int|float|object {}
  977. function exp(float $num): float {}
  978. function log(float $num, float $base = M_E): float {}
  979. function log10(float $num): float {}
  980. function sqrt(float $num): float {}
  981. function hypot(float $x, float $y): float {}
  982. function deg2rad(float $num): float {}
  983. function rad2deg(float $num): float {}
  984. function bindec(string $binary_string): int|float {}
  985. function hexdec(string $hex_string): int|float {}
  986. function octdec(string $octal_string): int|float {}
  987. /** @refcount 1 */
  988. function decbin(int $num): string {}
  989. /** @refcount 1 */
  990. function decoct(int $num): string {}
  991. /** @refcount 1 */
  992. function dechex(int $num): string {}
  993. /** @refcount 1 */
  994. function base_convert(string $num, int $from_base, int $to_base): string {}
  995. /** @refcount 1 */
  996. function number_format(float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ","): string {}
  997. function fmod(float $num1, float $num2): float {}
  998. function fdiv(float $num1, float $num2): float {}
  999. /* microtime.c */
  1000. #ifdef HAVE_GETTIMEOFDAY
  1001. /** @refcount 1 */
  1002. function microtime(bool $as_float = false): string|float {}
  1003. /**
  1004. * @return array<string, int>|float
  1005. * @refcount 1
  1006. */
  1007. function gettimeofday(bool $as_float = false): array|float {}
  1008. #endif
  1009. #ifdef HAVE_GETRUSAGE
  1010. /**
  1011. * @return array<string, int>|false
  1012. * @refcount 1
  1013. */
  1014. function getrusage(int $mode = 0): array|false {}
  1015. #endif
  1016. /* pack.c */
  1017. /** @refcount 1 */
  1018. function pack(string $format, mixed ...$values): string {}
  1019. /**
  1020. * @return array<int|string, mixed>|false
  1021. * @refcount 1
  1022. */
  1023. function unpack(string $format, string $string, int $offset = 0): array|false {}
  1024. /* password.c */
  1025. /**
  1026. * @return array<string, string|array|null>
  1027. * @refcount 1
  1028. */
  1029. function password_get_info(string $hash): array {}
  1030. /** @refcount 1 */
  1031. function password_hash(string $password, string|int|null $algo, array $options = []): string {}
  1032. function password_needs_rehash(string $hash, string|int|null $algo, array $options = []): bool {}
  1033. function password_verify(string $password, string $hash): bool {}
  1034. function password_algos(): array {}
  1035. /* proc_open.c */
  1036. #ifdef PHP_CAN_SUPPORT_PROC_OPEN
  1037. /**
  1038. * @param array $pipes
  1039. * @return resource|false
  1040. * @refcount 1
  1041. */
  1042. function proc_open(array|string $command, array $descriptor_spec, &$pipes, ?string $cwd = null, ?array $env_vars = null, ?array $options = null) {}
  1043. /** @param resource $process */
  1044. function proc_close($process): int {}
  1045. /** @param resource $process */
  1046. function proc_terminate($process, int $signal = 15): bool {}
  1047. /**
  1048. * @param resource $process
  1049. * @return array<string, bool|int|string>
  1050. * @refcount 1
  1051. */
  1052. function proc_get_status($process): array {}
  1053. #endif
  1054. /* quot_print.c */
  1055. /** @refcount 1 */
  1056. function quoted_printable_decode(string $string): string {}
  1057. /** @refcount 1 */
  1058. function quoted_printable_encode(string $string): string {}
  1059. /* mt_rand.c */
  1060. function mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {}
  1061. /** @alias mt_srand */
  1062. function srand(int $seed = 0, int $mode = MT_RAND_MT19937): void {}
  1063. function rand(int $min = UNKNOWN, int $max = UNKNOWN): int {}
  1064. function mt_rand(int $min = UNKNOWN, int $max = UNKNOWN): int {}
  1065. function mt_getrandmax(): int {}
  1066. /** @alias mt_getrandmax */
  1067. function getrandmax(): int {}
  1068. /* random.c */
  1069. /** @refcount 1 */
  1070. function random_bytes(int $length): string {}
  1071. function random_int(int $min, int $max): int {}
  1072. /* soundex.c */
  1073. /** @refcount 1 */
  1074. function soundex(string $string): string {}
  1075. /* streamsfuncs.c */
  1076. function stream_select(?array &$read, ?array &$write, ?array &$except, ?int $seconds, ?int $microseconds = null): int|false {}
  1077. /**
  1078. * @return resource
  1079. * @refcount 1
  1080. */
  1081. function stream_context_create(?array $options = null, ?array $params = null) {}
  1082. /** @param resource $context */
  1083. function stream_context_set_params($context, array $params): bool {}
  1084. /**
  1085. * @param resource $context
  1086. * @return array<string, mixed>
  1087. * @refcount 1
  1088. */
  1089. function stream_context_get_params($context): array {}
  1090. /** @param resource $context */
  1091. function stream_context_set_option($context, array|string $wrapper_or_options, ?string $option_name = null, mixed $value = UNKNOWN): bool {}
  1092. /**
  1093. * @param resource $stream_or_context
  1094. * @return array<string, mixed>
  1095. */
  1096. function stream_context_get_options($stream_or_context): array {}
  1097. /** @return resource */
  1098. function stream_context_get_default(?array $options = null) {}
  1099. /** @return resource */
  1100. function stream_context_set_default(array $options) {}
  1101. /**
  1102. * @param resource $stream
  1103. * @return resource|false
  1104. */
  1105. function stream_filter_prepend($stream, string $filter_name, int $mode = 0, mixed $params = UNKNOWN) {}
  1106. /**
  1107. * @param resource $stream
  1108. * @return resource|false
  1109. */
  1110. function stream_filter_append($stream, string $filter_name, int $mode = 0, mixed $params = UNKNOWN) {}
  1111. /** @param resource $stream_filter */
  1112. function stream_filter_remove($stream_filter): bool {}
  1113. /**
  1114. * @param int $error_code
  1115. * @param string $error_message
  1116. * @param resource|null $context
  1117. * @return resource|false
  1118. * @refcount 1
  1119. */
  1120. function stream_socket_client(string $address, &$error_code = null, &$error_message = null, ?float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null) {}
  1121. /**
  1122. * @param int $error_code
  1123. * @param string $error_message
  1124. * @param resource|null $context
  1125. * @return resource|false
  1126. * @refcount 1
  1127. */
  1128. function stream_socket_server(string $address, &$error_code = null, &$error_message = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null) {}
  1129. /**
  1130. * @param resource $socket
  1131. * @param string $peer_name
  1132. * @return resource|false
  1133. * @refcount 1
  1134. */
  1135. function stream_socket_accept($socket, ?float $timeout = null, &$peer_name = null) {}
  1136. /** @param resource $socket */
  1137. function stream_socket_get_name($socket, bool $remote): string|false {}
  1138. /**
  1139. * @param resource $socket
  1140. * @param string|null $address
  1141. * @refcount 1
  1142. */
  1143. function stream_socket_recvfrom($socket, int $length, int $flags = 0, &$address = null): string|false {}
  1144. /** @param resource $socket */
  1145. function stream_socket_sendto($socket, string $data, int $flags = 0, string $address = ""): int|false {}
  1146. /**
  1147. * @param resource $stream
  1148. * @param resource|null $session_stream
  1149. */
  1150. function stream_socket_enable_crypto($stream, bool $enable, ?int $crypto_method = null, $session_stream = null): int|bool {}
  1151. #ifdef HAVE_SHUTDOWN
  1152. /** @param resource $stream */
  1153. function stream_socket_shutdown($stream, int $mode): bool {}
  1154. #endif
  1155. #if HAVE_SOCKETPAIR
  1156. /**
  1157. * @return array<int, resource>|false
  1158. * @refcount 1
  1159. */
  1160. function stream_socket_pair(int $domain, int $type, int $protocol): array|false {}
  1161. #endif
  1162. /**
  1163. * @param resource $from
  1164. * @param resource $to
  1165. */
  1166. function stream_copy_to_stream($from, $to, ?int $length = null, int $offset = 0): int|false {}
  1167. /**
  1168. * @param resource $stream
  1169. * @refcount 1
  1170. */
  1171. function stream_get_contents($stream, ?int $length = null, int $offset = -1): string|false {}
  1172. /** @param resource $stream */
  1173. function stream_supports_lock($stream): bool {}
  1174. /** @param resource $stream */
  1175. function stream_set_write_buffer($stream, int $size): int {}
  1176. /**
  1177. * @param resource $stream
  1178. * @alias stream_set_write_buffer
  1179. */
  1180. function set_file_buffer($stream, int $size): int {}
  1181. /** @param resource $stream */
  1182. function stream_set_read_buffer($stream, int $size): int {}
  1183. /** @param resource $stream */
  1184. function stream_set_blocking($stream, bool $enable): bool {}
  1185. /**
  1186. * @param resource $stream
  1187. * @alias stream_set_blocking
  1188. */
  1189. function socket_set_blocking($stream, bool $enable): bool {}
  1190. /**
  1191. * @param resource $stream
  1192. * @return array<string, mixed>
  1193. */
  1194. function stream_get_meta_data($stream): array {}
  1195. /**
  1196. * @param resource $stream
  1197. * @return array<string, mixed>
  1198. * @alias stream_get_meta_data
  1199. */
  1200. function socket_get_status($stream): array {}
  1201. /**
  1202. * @param resource $stream
  1203. * @refcount 1
  1204. */
  1205. function stream_get_line($stream, int $length, string $ending = ""): string|false {}
  1206. /** @refcount 1 */
  1207. function stream_resolve_include_path(string $filename): string|false {}
  1208. /**
  1209. * @return array<int, string>
  1210. * @refcount 1
  1211. */
  1212. function stream_get_wrappers(): array {}
  1213. /**
  1214. * @return array<int, string>
  1215. * @refcount 1
  1216. */
  1217. function stream_get_transports(): array {}
  1218. /** @param resource|string $stream */
  1219. function stream_is_local($stream): bool {}
  1220. /** @param resource $stream */
  1221. function stream_isatty($stream): bool {}
  1222. #ifdef PHP_WIN32
  1223. /** @param resource $stream */
  1224. function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {}
  1225. #endif
  1226. /** @param resource $stream */
  1227. function stream_set_chunk_size($stream, int $size): int {}
  1228. #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
  1229. /** @param resource $stream */
  1230. function stream_set_timeout($stream, int $seconds, int $microseconds = 0): bool {}
  1231. /**
  1232. * @param resource $stream
  1233. * @alias stream_set_timeout
  1234. */
  1235. function socket_set_timeout($stream, int $seconds, int $microseconds = 0): bool {}
  1236. #endif
  1237. /* type.c */
  1238. function gettype(mixed $value): string {}
  1239. function get_debug_type(mixed $value): string {}
  1240. function settype(mixed &$var, string $type): bool {}
  1241. function intval(mixed $value, int $base = 10): int {}
  1242. function floatval(mixed $value): float {}
  1243. /** @alias floatval */
  1244. function doubleval(mixed $value): float {}
  1245. function boolval(mixed $value): bool {}
  1246. function strval(mixed $value): string {}
  1247. function is_null(mixed $value): bool {}
  1248. function is_resource(mixed $value): bool {}
  1249. function is_bool(mixed $value): bool {}
  1250. function is_int(mixed $value): bool {}
  1251. /** @alias is_int */
  1252. function is_integer(mixed $value): bool {}
  1253. /** @alias is_int */
  1254. function is_long(mixed $value): bool {}
  1255. function is_float(mixed $value): bool {}
  1256. /** @alias is_float */
  1257. function is_double(mixed $value): bool {}
  1258. function is_numeric(mixed $value): bool {}
  1259. function is_string(mixed $value): bool {}
  1260. function is_array(mixed $value): bool {}
  1261. function is_object(mixed $value): bool {}
  1262. function is_scalar(mixed $value): bool {}
  1263. /** @param string $callable_name */
  1264. function is_callable(mixed $value, bool $syntax_only = false, &$callable_name = null): bool {}
  1265. function is_iterable(mixed $value): bool {}
  1266. function is_countable(mixed $value): bool {}
  1267. /* uniqid.c */
  1268. #ifdef HAVE_GETTIMEOFDAY
  1269. /** @refcount 1 */
  1270. function uniqid(string $prefix = "", bool $more_entropy = false): string {}
  1271. #endif
  1272. /* url.c */
  1273. /**
  1274. * @return int|string|array<string, int|string>|null|false
  1275. * @refcount 1
  1276. */
  1277. function parse_url(string $url, int $component = -1): int|string|array|null|false {}
  1278. /** @refcount 1 */
  1279. function urlencode(string $string): string {}
  1280. /** @refcount 1 */
  1281. function urldecode(string $string): string {}
  1282. /** @refcount 1 */
  1283. function rawurlencode(string $string): string {}
  1284. /** @refcount 1 */
  1285. function rawurldecode(string $string): string {}
  1286. /**
  1287. * @param resource|null $context
  1288. * @return array<int|string, string|array>|false
  1289. * @refcount 1
  1290. */
  1291. function get_headers(string $url, bool $associative = false, $context = null): array|false {}
  1292. /* user_filters.c */
  1293. /**
  1294. * @param resource $brigade
  1295. * @refcount 1
  1296. */
  1297. function stream_bucket_make_writeable($brigade): ?object {}
  1298. /** @param resource $brigade */
  1299. function stream_bucket_prepend($brigade, object $bucket): void {}
  1300. /** @param resource $brigade */
  1301. function stream_bucket_append($brigade, object $bucket): void {}
  1302. /**
  1303. * @param resource $stream
  1304. * @refcount 1
  1305. */
  1306. function stream_bucket_new($stream, string $buffer): object {}
  1307. /**
  1308. * @return array<int, string>
  1309. * @refcount 1
  1310. */
  1311. function stream_get_filters(): array {}
  1312. function stream_filter_register(string $filter_name, string $class): bool {}
  1313. /* uuencode.c */
  1314. /** @refcount 1 */
  1315. function convert_uuencode(string $string): string {}
  1316. /** @refcount 1 */
  1317. function convert_uudecode(string $string): string|false {}
  1318. /* var.c */
  1319. function var_dump(mixed $value, mixed ...$values): void {}
  1320. /** @refcount 1 */
  1321. function var_export(mixed $value, bool $return = false): ?string {}
  1322. function debug_zval_dump(mixed $value, mixed ...$values): void {}
  1323. /** @refcount 1 */
  1324. function serialize(mixed $value): string {}
  1325. function unserialize(string $data, array $options = []): mixed {}
  1326. function memory_get_usage(bool $real_usage = false): int {}
  1327. function memory_get_peak_usage(bool $real_usage = false): int {}
  1328. /* versioning.c */
  1329. function version_compare(string $version1, string $version2, ?string $operator = null): int|bool {}
  1330. /* win32/codepage.c */
  1331. #ifdef PHP_WIN32
  1332. function sapi_windows_cp_set(int $codepage): bool {}
  1333. function sapi_windows_cp_get(string $kind = ""): int {}
  1334. function sapi_windows_cp_conv(int|string $in_codepage, int|string $out_codepage, string $subject): ?string {}
  1335. function sapi_windows_cp_is_utf8(): bool {}
  1336. function sapi_windows_set_ctrl_handler(?callable $handler, bool $add = true): bool {}
  1337. function sapi_windows_generate_ctrl_event(int $event, int $pid = 0): bool {}
  1338. #endif