PageRenderTime 57ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/runtime/ext/string/ext_string.php

http://github.com/facebook/hiphop-php
PHP | 1733 lines | 367 code | 84 blank | 1282 comment | 0 complexity | 326d9e6094a4cb83ad124a955319c046 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?hh // partial
  2. namespace HH {
  3. newtype FormatString<T> = string;
  4. }
  5. namespace {
  6. /**
  7. * Returns a string with backslashes before characters that are listed in
  8. * charlist parameter.
  9. *
  10. * @param string $str - The string to be escaped.
  11. * @param string $charlist - A list of characters to be escaped. If charlist
  12. * contains characters \n, \r etc., they are converted in C-like style, while
  13. * other non-alphanumeric characters with ASCII codes lower than 32 and higher
  14. * than 126 converted to octal representation. When you define a sequence of
  15. * characters in the charlist argument make sure that you know what characters
  16. * come between the characters that you set as the start and end of the range.
  17. * Also, if the first character in a range has a higher ASCII value than the
  18. * second character in the range, no range will be constructed. Only the
  19. * start, end and period characters will be escaped. Use the ord() function to
  20. * find the ASCII value for a character. Be careful if you choose to escape
  21. * characters 0, a, b, f, n, r, t and v. They will be converted to \0, \a, \b,
  22. * \f, \n, \r, \t and \v. In PHP \0 (NULL), \r (carriage return), \n
  23. * (newline), \f (form feed), \v (vertical tab) and \t (tab) are predefined
  24. * escape sequences, while in C all of these are predefined escape sequences.
  25. *
  26. * @return string - Returns the escaped string.
  27. *
  28. */
  29. <<__IsFoldable, __Native, __Rx>>
  30. function addcslashes(string $str, string $charlist): string;
  31. /**
  32. * Returns a string with backslashes stripped off. Recognizes C-like \n, \r
  33. * ..., octal and hexadecimal representation.
  34. *
  35. * @param string $str - The string to be unescaped.
  36. *
  37. * @return string - Returns the unescaped string.
  38. *
  39. */
  40. <<__IsFoldable, __Native, __Rx>>
  41. function stripcslashes(string $str): string;
  42. /**
  43. * Returns a string with backslashes before characters that need to be quoted
  44. * in database queries etc. These characters are single quote ('), double
  45. * quote ("), backslash (\) and NUL (the NULL byte). An example use of
  46. * addslashes() is when you're entering data into a database. For example, to
  47. * insert the name O'reilly into a database, you will need to escape it. It's
  48. * highly recommended to use DBMS specific escape function (e.g.
  49. * mysqli_real_escape_string() for MySQL or pg_escape_string() for
  50. * PostgreSQL), but if the DBMS you're using doesn't have an escape function
  51. * and the DBMS uses \ to escape special chars, you can use this function.
  52. * This would only be to get the data into the database, the extra \ will not
  53. * be inserted. Having the PHP directive magic_quotes_sybase set to on will
  54. * mean ' is instead escaped with another '. The PHP directive
  55. * magic_quotes_gpc is on by default, and it essentially runs addslashes() on
  56. * all GET, POST, and COOKIE data. Do not use addslashes() on strings that
  57. * have already been escaped with magic_quotes_gpc as you'll then do double
  58. * escaping. The function get_magic_quotes_gpc() may come in handy for
  59. * checking this.
  60. *
  61. * @param string $str - The string to be escaped.
  62. *
  63. * @return string - Returns the escaped string.
  64. *
  65. */
  66. <<__IsFoldable, __Native, __Rx>>
  67. function addslashes(string $str): string;
  68. /**
  69. * Un-quotes a quoted string. If magic_quotes_sybase is on, no backslashes
  70. * are stripped off but two apostrophes are replaced by one instead. An
  71. * example use of stripslashes() is when the PHP directive magic_quotes_gpc is
  72. * on (it's on by default), and you aren't inserting this data into a place
  73. * (such as a database) that requires escaping. For example, if you're simply
  74. * outputting data straight from an HTML form.
  75. *
  76. * @param string $str - The input string.
  77. *
  78. * @return string - Returns a string with backslashes stripped off. (\'
  79. * becomes ' and so on.) Double backslashes (\\) are made into a single
  80. * backslash (\).
  81. *
  82. */
  83. <<__IsFoldable, __Native, __Rx>>
  84. function stripslashes(string $str): string;
  85. /**
  86. * Returns an ASCII string containing the hexadecimal representation of str.
  87. * The conversion is done byte-wise with the high-nibble first.
  88. *
  89. * @param string $str - A character.
  90. *
  91. * @return string - Returns the hexadecimal representation of the given
  92. * string.
  93. *
  94. */
  95. <<__IsFoldable, __Native, __Rx>>
  96. function bin2hex(string $str): string;
  97. /**
  98. * Returns an ASCII string containing the binary representation of hexidecimal
  99. * str.
  100. *
  101. * @param string $str - A character.
  102. *
  103. * @return mixed - Returns the binary representation of the given hexidecimal
  104. * string or FALSE on failure.
  105. *
  106. */
  107. // Not __IsFoldable since it uses isdigit() which depends on the current locale
  108. <<__Native>>
  109. function hex2bin(string $str): mixed;
  110. /**
  111. * Returns string with '<br />' or '<br>' inserted before all newlines.
  112. *
  113. * @param string $str - The input string.
  114. * @param bool $is_xhtml - Whether to use XHTML compatible line breaks or not.
  115. *
  116. * @return string - Returns the altered string.
  117. *
  118. */
  119. <<__IsFoldable, __Native, __Rx>>
  120. function nl2br(string $str, bool $is_xhtml = true): string;
  121. /**
  122. * Returns a version of str with a backslash character (\) before every
  123. * character that is among these: . \ + * ? [ ^ ] ( $ )
  124. *
  125. * @param string $str - The input string.
  126. *
  127. * @return string - Returns the string with meta characters quoted.
  128. *
  129. */
  130. <<__IsFoldable, __Native, __Rx>>
  131. function quotemeta(string $str): string;
  132. /**
  133. * @param string $str - The input string.
  134. *
  135. * @return string - Returns the shuffled string.
  136. *
  137. */
  138. <<__Native>>
  139. function str_shuffle(string $str): string;
  140. /**
  141. * Returns string, reversed.
  142. *
  143. * @param string $str - The string to be reversed.
  144. *
  145. * @return string - Returns the reversed string.
  146. *
  147. */
  148. <<__IsFoldable, __Native, __Rx>>
  149. function strrev(string $str): string;
  150. /**
  151. * Returns string with all alphabetic characters converted to lowercase. Note
  152. * that 'alphabetic' is determined by the current locale. This means that in
  153. * e.g. the default "C" locale, characters such as umlaut-A will not be
  154. * converted.
  155. *
  156. * @param string $str - The input string.
  157. *
  158. * @return string - Returns the lowercased string.
  159. *
  160. */
  161. <<__Native, __Rx>>
  162. function strtolower(string $str): string;
  163. /**
  164. * Returns string with all alphabetic characters converted to uppercase. Note
  165. * that 'alphabetic' is determined by the current locale. For instance, in the
  166. * default "C" locale characters such as umlaut-a will not be converted.
  167. *
  168. * @param string $str - The input string.
  169. *
  170. * @return string - Returns the uppercased string.
  171. *
  172. */
  173. <<__Native, __Rx>>
  174. function strtoupper(string $str): string;
  175. /**
  176. * Returns a string with the first character of str capitalized, if that
  177. * character is alphabetic. Note that 'alphabetic' is determined by the
  178. * current locale. For instance, in the default "C" locale characters such as
  179. * umlaut-a will not be converted.
  180. *
  181. * @param string $str - The input string.
  182. *
  183. * @return string - Returns the resulting string.
  184. *
  185. */
  186. <<__Native>>
  187. function ucfirst(string $str): string;
  188. /**
  189. * Returns a string with the first character of str , lowercased if that
  190. * character is alphabetic. Note that 'alphabetic' is determined by the
  191. * current locale. For instance, in the default "C" locale characters such as
  192. * umlaut-a will not be converted.
  193. *
  194. * @param string $str - The input string.
  195. *
  196. * @return string - Returns the resulting string.
  197. *
  198. */
  199. <<__Native>>
  200. function lcfirst(string $str): string;
  201. /**
  202. * Returns a string with the first character of each word in str capitalized,
  203. * if that character is alphabetic. The definition of a word is any string of
  204. * characters that is immediately after a whitespace (These are: space,
  205. * form-feed, newline, carriage return, horizontal tab, and vertical tab).
  206. *
  207. * @param string $str - The input string.
  208. *
  209. * @return string - Returns the modified string.
  210. *
  211. */
  212. <<__Native>>
  213. function ucwords(string $str, string $delimiters = " \t\r\n\f\v"): string;
  214. /**
  215. * This function tries to return a string with all NUL bytes, HTML and PHP
  216. * tags stripped from a given str. It uses the same tag stripping state
  217. * machine as the fgetss() function.
  218. *
  219. * @param string $str - The input string.
  220. * @param string $allowable_tags - You can use the optional second parameter
  221. * to specify tags which should not be stripped. HTML comments and PHP tags
  222. * are also stripped. This is hardcoded and can not be changed with
  223. * allowable_tags.
  224. *
  225. * @return string - Returns the stripped string.
  226. *
  227. */
  228. <<__Native>>
  229. function strip_tags(string $str, mixed $allowable_tags = ""): string;
  230. /**
  231. * This function returns a string with whitespace stripped from the beginning
  232. * and end of str. Without the second parameter, trim() will strip these
  233. * characters: " " (ASCII 32 (0x20)), an ordinary space. "\t" (ASCII 9
  234. * (0x09)), a tab. "\n" (ASCII 10 (0x0A)), a new line (line feed). "\r" (ASCII
  235. * 13 (0x0D)), a carriage return. "\0" (ASCII 0 (0x00)), the NUL-byte. "\x0B"
  236. * (ASCII 11 (0x0B)), a vertical tab.
  237. *
  238. * @param string $str - The string that will be trimmed.
  239. * @param string $charlist - Optionally, the stripped characters can also be
  240. * specified using the charlist parameter. Simply list all characters that you
  241. * want to be stripped. With .. you can specify a range of characters.
  242. *
  243. * @return string - The trimmed string.
  244. *
  245. */
  246. <<__IsFoldable, __Native, __Rx>>
  247. function trim(string $str, string $charlist = HPHP_TRIM_CHARLIST): string;
  248. /**
  249. * Strip whitespace (or other characters) from the beginning of a string.
  250. *
  251. * @param string $str - The input string.
  252. * @param string $charlist - You can also specify the characters you want to
  253. * strip, by means of the charlist parameter. Simply list all characters that
  254. * you want to be stripped. With .. you can specify a range of characters.
  255. *
  256. * @return string - This function returns a string with whitespace stripped
  257. * from the beginning of str. Without the second parameter, ltrim() will strip
  258. * these characters: " " (ASCII 32 (0x20)), an ordinary space. "\t" (ASCII 9
  259. * (0x09)), a tab. "\n" (ASCII 10 (0x0A)), a new line (line feed). "\r" (ASCII
  260. * 13 (0x0D)), a carriage return. "\0" (ASCII 0 (0x00)), the NUL-byte. "\x0B"
  261. * (ASCII 11 (0x0B)), a vertical tab.
  262. *
  263. */
  264. <<__IsFoldable, __Native, __Rx>>
  265. function ltrim(string $str, string $charlist = HPHP_TRIM_CHARLIST): string;
  266. /**
  267. * This function returns a string with whitespace stripped from the end of
  268. * str. Without the second parameter, rtrim() will strip these characters: "
  269. * " (ASCII 32 (0x20)), an ordinary space. "\t" (ASCII 9 (0x09)), a tab. "\n"
  270. * (ASCII 10 (0x0A)), a new line (line feed). "\r" (ASCII 13 (0x0D)), a
  271. * carriage return. "\0" (ASCII 0 (0x00)), the NUL-byte. "\x0B" (ASCII 11
  272. * (0x0B)), a vertical tab.
  273. *
  274. * @param string $str - The input string.
  275. * @param string $charlist - You can also specify the characters you want to
  276. * strip, by means of the charlist parameter. Simply list all characters that
  277. * you want to be stripped. With .. you can specify a range of characters.
  278. *
  279. * @return string - Returns the modified string.
  280. *
  281. */
  282. <<__IsFoldable, __Native, __Rx>>
  283. function rtrim(string $str, string $charlist = HPHP_TRIM_CHARLIST): string;
  284. <<__IsFoldable, __Native, __Rx>>
  285. function chop(string $str, string $charlist = HPHP_TRIM_CHARLIST): string;
  286. /**
  287. * Returns an array of strings, each of which is a substring of string formed
  288. * by splitting it on boundaries formed by the string delimiter. Although
  289. * implode() can, for historical reasons, accept its parameters in either
  290. * order, explode() cannot. You must ensure that the delimiter argument comes
  291. * before the string argument.
  292. *
  293. * @param string $delimiter - The boundary string.
  294. * @param string $str - The input string.
  295. * @param int $limit - If limit is set and positive, the returned array will
  296. * contain a maximum of limit elements with the last element containing the
  297. * rest of string. If the limit parameter is negative, all components except
  298. * the last -limit are returned. If the limit parameter is zero, then this is
  299. * treated as 1.
  300. *
  301. * @return mixed - Returns an array of strings created by splitting the string
  302. * parameter on boundaries formed by the delimiter. If delimiter is an empty
  303. * string (""), explode() will return FALSE. If delimiter contains a value
  304. * that is not contained in string and a negative limit is used, then an empty
  305. * arraywill be returned, otherwise an array containing string will be
  306. * returned.
  307. *
  308. */
  309. <<__IsFoldable, __Native, __Rx>>
  310. function explode(string $delimiter,
  311. string $str,
  312. int $limit = 0x7FFFFFFF): mixed;
  313. /**
  314. * Join container elements with a glue string. implode() can, for historical
  315. * reasons, accept its parameters in either order. For consistency with
  316. * explode(), however, it may be less confusing to use the documented order of
  317. * arguments.
  318. *
  319. * @param mixed $arg1 - Defaults to an empty string. This is not the preferred
  320. * usage of implode() as glue would be the second parameter and thus, the bad
  321. * prototype would be used.
  322. * @param mixed $arg2 - The array of strings to implode.
  323. *
  324. * @return string - Returns a string containing a string representation of all
  325. * the array elements in the same order, with the glue string between each
  326. * element.
  327. *
  328. */
  329. <<__IsFoldable, __Native, __Rx>>
  330. function implode(mixed $arg1, mixed $arg2 = null): string;
  331. /**
  332. * An alias for implode().
  333. *
  334. */
  335. <<__IsFoldable, __Native, __Rx>>
  336. function join(mixed $arg1, mixed $arg2 = null): string;
  337. /**
  338. * Converts a string to an array.
  339. *
  340. * @param string $str - The input string.
  341. * @param int $split_length - Maximum length of the chunk.
  342. *
  343. * @return mixed - If the optional split_length parameter is specified, the
  344. * returned array will be broken down into chunks with each being split_length
  345. * in length, otherwise each chunk will be one character in length. FALSE is
  346. * returned if split_length is less than 1. If the split_length length exceeds
  347. * the length of string, the entire string is returned as the first (and only)
  348. * array element.
  349. *
  350. */
  351. <<__IsFoldable, __Native, __Rx>>
  352. function str_split(string $str, int $split_length = 1): mixed;
  353. /**
  354. * Can be used to split a string into smaller chunks which is useful for e.g.
  355. * converting base64_encode() output to match RFC 2045 semantics. It inserts
  356. * end every chunklen characters.
  357. *
  358. * @param string $body - The string to be chunked.
  359. * @param int $chunklen - The chunk length.
  360. * @param string $end - The line ending sequence.
  361. *
  362. * @return mixed - Returns the chunked string.
  363. *
  364. */
  365. <<__Native, __IsFoldable, __Rx>>
  366. function chunk_split(string $body,
  367. int $chunklen = 76,
  368. string $end = "\r\n"): mixed;
  369. /**
  370. * strtok() splits a string (str) into smaller strings (tokens), with each
  371. * token being delimited by any character from token. That is, if you have a
  372. * string like "This is an example string" you could tokenize this string into
  373. * its individual words by using the space character as the token. Note that
  374. * only the first call to strtok uses the string argument. Every subsequent
  375. * call to strtok only needs the token to use, as it keeps track of where it
  376. * is in the current string. To start over, or to tokenize a new string you
  377. * simply call strtok with the string argument again to initialize it. Note
  378. * that you may put multiple tokens in the token parameter. The string will be
  379. * tokenized when any one of the characters in the argument are found.
  380. *
  381. * @param string $str - The string being split up into smaller strings
  382. * (tokens).
  383. * @param mixed $token - The delimiter used when splitting up str.
  384. *
  385. * @return mixed - A string token.
  386. *
  387. */
  388. <<__Native>>
  389. function strtok(string $str, mixed $token = null): mixed;
  390. /**
  391. * This function returns a string or an array with all occurrences of search
  392. * in subject replaced with the given replace value. If you don't need fancy
  393. * replacing rules (like regular expressions), you should always use this
  394. * function instead of ereg_replace() or preg_replace(). If search and replace
  395. * are arrays, then str_replace() takes a value from each array and uses them
  396. * to do search and replace on subject. If replace has fewer values than
  397. * search, then an empty string is used for the rest of replacement values. If
  398. * search is an array and replace is a string, then this replacement string is
  399. * used for every value of search. The converse would not make sense, though.
  400. * If search or replace are arrays, their elements are processed first to
  401. * last.
  402. *
  403. * @param mixed $search - The value being searched for, otherwise known as the
  404. * needle. An array may be used to designate multiple needles.
  405. * @param mixed $replace - The replacement value that replaces found search
  406. * values. An array may be used to designate multiple replacements.
  407. * @param mixed $subject - The string or array being searched and replaced on,
  408. * otherwise known as the haystack. If subject is an array, then the search
  409. * and replace is performed with every entry of subject, and the return value
  410. * is an array as well.
  411. * @param mixed $count - If passed, this will hold the number of matched and
  412. * replaced needles.
  413. *
  414. * @return mixed - This function returns a string or an array with the
  415. * replaced values.
  416. *
  417. */
  418. <<__IsFoldable, __Native, __Rx>>
  419. function str_replace(mixed $search,
  420. mixed $replace,
  421. mixed $subject): mixed;
  422. <<__IsFoldable, __Native, __Rx>>
  423. function str_replace_with_count(mixed $search,
  424. mixed $replace,
  425. mixed $subject,
  426. <<__OutOnly("KindOfInt64")>>
  427. inout mixed $count): mixed;
  428. /**
  429. * This function returns a string or an array with all occurrences of search
  430. * in subject (ignoring case) replaced with the given replace value. If you
  431. * don't need fancy replacing rules, you should generally use this function
  432. * instead of preg_replace() with the i modifier. If search and replace are
  433. * arrays, then str_ireplace() takes a value from each array and uses them to
  434. * do search and replace on subject. If replace has fewer values than search,
  435. * then an empty string is used for the rest of replacement values. If search
  436. * is an array and replace is a string, then this replacement string is used
  437. * for every value of search.
  438. *
  439. * @param mixed $search - Every replacement with search array is performed on
  440. * the result of previous replacement.
  441. * @param mixed $replace
  442. * @param mixed $subject - If subject is an array, then the search and replace
  443. * is performed with every entry of subject, and the return value is an array
  444. * as well.
  445. * @param mixed $count - The number of matched and replaced needles will be
  446. * returned in count which is passed by reference.
  447. *
  448. * @return mixed - Returns a string or an array of replacements.
  449. *
  450. */
  451. <<__IsFoldable, __Native, __Rx>>
  452. function str_ireplace(mixed $search,
  453. mixed $replace,
  454. mixed $subject): mixed;
  455. <<__IsFoldable, __Native, __Rx>>
  456. function str_ireplace_with_count(mixed $search,
  457. mixed $replace,
  458. mixed $subject,
  459. <<__OutOnly("KindOfInt64")>>
  460. inout mixed $count): mixed;
  461. /**
  462. * substr_replace() replaces a copy of string delimited by the start and
  463. * (optionally) length parameters with the string given in replacement.
  464. *
  465. * @param mixed $str - The input string.
  466. * @param mixed $replacement - The replacement string.
  467. * @param mixed $start - If start is positive, the replacing will begin at the
  468. * start'th offset into string. If start is negative, the replacing will
  469. * begin at the start'th character from the end of string.
  470. * @param mixed $length - If given and is positive, it represents the length
  471. * of the portion of string which is to be replaced. If it is negative, it
  472. * represents the number of characters from the end of string at which to stop
  473. * replacing. If it is not given, then it will default to strlen( string );
  474. * i.e. end the replacing at the end of string. Of course, if length is zero
  475. * then this function will have the effect of inserting replacement into
  476. * string at the given start offset.
  477. *
  478. * @return mixed - The result string is returned. If string is an array then
  479. * array is returned.
  480. *
  481. */
  482. <<__IsFoldable, __Native, __Rx>>
  483. function substr_replace(mixed $str,
  484. mixed $replacement,
  485. mixed $start,
  486. mixed $length = 0x7FFFFFFF): mixed;
  487. /**
  488. * Returns the portion of string specified by the start and length parameters.
  489. *
  490. * @param string $str - The input string.
  491. * @param int $start - If start is non-negative, the returned string will
  492. * start at the start'th position in string, counting from zero. For instance,
  493. * in the string 'abcdef', the character at position 0 is 'a', the character
  494. * at position 2 is 'c', and so forth. If start is negative, the returned
  495. * string will start at the start'th character from the end of string. If
  496. * string is less than or equal to start characters long, FALSE will be
  497. * returned. Example #1 Using a negative start
  498. * @param int $length - If length is given and is positive, the string
  499. * returned will contain at most length characters beginning from start
  500. * (depending on the length of string). If length is given and is negative,
  501. * then that many characters will be omitted from the end of string (after the
  502. * start position has been calculated when a start is negative). If start
  503. * denotes a position beyond this truncation, an empty string will be
  504. * returned. If length is given and is 0, FALSE or NULL an empty string will
  505. * be returned. If length is omitted, the substring starting from start until
  506. * the end of the string will be returned. Example #2 Using a negative length
  507. *
  508. * @return mixed - Returns the extracted part of string or FALSE on failure.
  509. *
  510. */
  511. <<__IsFoldable, __Native, __Rx>>
  512. function substr(string $str, int $start, int $length = 0x7FFFFFFF): mixed;
  513. /**
  514. * This functions returns the input string padded on the left, the right, or
  515. * both sides to the specified padding length. If the optional argument
  516. * pad_string is not supplied, the input is padded with spaces, otherwise it
  517. * is padded with characters from pad_string up to the limit.
  518. *
  519. * @param string $input - The input string.
  520. * @param int $pad_length - If the value of pad_length is negative, less than,
  521. * or equal to the length of the input string, no padding takes place.
  522. * @param string $pad_string - The pad_string may be truncated if the required
  523. * number of padding characters can't be evenly divided by the pad_string's
  524. * length.
  525. * @param int $pad_type - Optional argument pad_type can be STR_PAD_RIGHT,
  526. * STR_PAD_LEFT, or STR_PAD_BOTH. If pad_type is not specified it is assumed
  527. * to be STR_PAD_RIGHT.
  528. *
  529. * @return string - Returns the padded string.
  530. *
  531. */
  532. <<__IsFoldable, __Native, __Rx>>
  533. function str_pad(string $input,
  534. int $pad_length,
  535. string $pad_string = " ",
  536. int $pad_type = STR_PAD_RIGHT): string;
  537. /**
  538. * Returns input repeated multiplier times.
  539. *
  540. * @param string $input - The string to be repeated.
  541. *
  542. * @param int $multiplier - Number of time the input string should be
  543. * repeated. multiplier has to be greater than or equal to 0. If the
  544. * multiplier is set to 0, the function will return an empty string.
  545. *
  546. * @return string - Returns the repeated string.
  547. *
  548. */
  549. <<__IsFoldable, __Native, __Rx>>
  550. function str_repeat(string $input, int $multiplier): string;
  551. /**
  552. * html_entity_decode() is the opposite of htmlentities() in that it converts
  553. * all HTML entities to their applicable characters from string.
  554. *
  555. * @param string $str - The input string.
  556. * @param int $quote_style - The optional second quote_style parameter lets
  557. * you define what will be done with 'single' and "double" quotes. It takes on
  558. * one of three constants with the default being ENT_COMPAT: Available
  559. * quote_style constants Constant Name Description ENT_COMPAT Will convert
  560. * double-quotes and leave single-quotes alone. ENT_QUOTES Will convert both
  561. * double and single quotes. ENT_NOQUOTES Will leave both double and single
  562. * quotes unconverted.
  563. * @param string $charset - The ISO-8859-1 character set is used as default
  564. * for the optional third charset. This defines the character set used in
  565. * conversion. Following character sets are supported in PHP 4.3.0 and later.
  566. * Supported charsets Charset Aliases Description ISO-8859-1 ISO8859-1 Western
  567. * European, Latin-1 ISO-8859-15 ISO8859-15 Western European, Latin-9. Adds
  568. * the Euro sign, French and Finnish letters missing in Latin-1(ISO-8859-1).
  569. * UTF-8 ASCII compatible multi-byte 8-bit Unicode. cp866 ibm866, 866
  570. * DOS-specific Cyrillic charset. This charset is supported in 4.3.2. cp1251
  571. * Windows-1251, win-1251, 1251 Windows-specific Cyrillic charset. This
  572. * charset is supported in 4.3.2. cp1252 Windows-1252, 1252 Windows specific
  573. * charset for Western European. KOI8-R koi8-ru, koi8r Russian. This charset
  574. * is supported in 4.3.2. BIG5 950 Traditional Chinese, mainly used in Taiwan.
  575. * GB2312 936 Simplified Chinese, national standard character set. BIG5-HKSCS
  576. * Big5 with Hong Kong extensions, Traditional Chinese. Shift_JIS SJIS, 932
  577. * Japanese EUC-JP EUCJP Japanese Any other character sets are not recognized
  578. * and ISO-8859-1 will be used instead.
  579. *
  580. * @return string - Returns the decoded string.
  581. *
  582. */
  583. <<__Native>>
  584. function html_entity_decode(string $str,
  585. int $quote_style = ENT_COMPAT,
  586. string $charset = "UTF-8"): string;
  587. /**
  588. * This function is identical to htmlspecialchars() in all ways, except with
  589. * htmlentities(), all characters which have HTML character entity equivalents
  590. * are translated into these entities. If you're wanting to decode instead
  591. * (the reverse) you can use html_entity_decode().
  592. *
  593. * @param string $str - The input string.
  594. * @param int $quote_style - Like htmlspecialchars(), the optional second
  595. * quote_style parameter lets you define what will be done with 'single' and
  596. * "double" quotes. It takes on one of three constants with the default being
  597. * ENT_COMPAT: Available quote_style constants Constant Name Description
  598. * ENT_COMPAT Will convert double-quotes and leave single-quotes alone.
  599. * ENT_QUOTES Will convert both double and single quotes. ENT_NOQUOTES Will
  600. * leave both double and single quotes unconverted.
  601. * @param string $charset - Like htmlspecialchars(), it takes an optional
  602. * third argument charset which defines character set used in conversion.
  603. * Presently, the ISO-8859-1 character set is used as the default. Following
  604. * character sets are supported in PHP 4.3.0 and later. Supported charsets
  605. * Charset Aliases Description ISO-8859-1 ISO8859-1 Western European, Latin-1
  606. * ISO-8859-15 ISO8859-15 Western European, Latin-9. Adds the Euro sign,
  607. * French and Finnish letters missing in Latin-1(ISO-8859-1). UTF-8 ASCII
  608. * compatible multi-byte 8-bit Unicode. cp866 ibm866, 866 DOS-specific
  609. * Cyrillic charset. This charset is supported in 4.3.2. cp1251 Windows-1251,
  610. * win-1251, 1251 Windows-specific Cyrillic charset. This charset is supported
  611. * in 4.3.2. cp1252 Windows-1252, 1252 Windows specific charset for Western
  612. * European. KOI8-R koi8-ru, koi8r Russian. This charset is supported in
  613. * 4.3.2. BIG5 950 Traditional Chinese, mainly used in Taiwan. GB2312 936
  614. * Simplified Chinese, national standard character set. BIG5-HKSCS Big5 with
  615. * Hong Kong extensions, Traditional Chinese. Shift_JIS SJIS, 932 Japanese
  616. * EUC-JP EUCJP Japanese Any other character sets are not recognized and
  617. * ISO-8859-1 will be used instead.
  618. * @param bool $double_encode - When double_encode is turned off PHP will not
  619. * encode existing html entities. The default is to convert everything.
  620. *
  621. * @return string - Returns the encoded string.
  622. *
  623. */
  624. <<__Native>>
  625. function htmlentities(string $str,
  626. int $quote_style = ENT_COMPAT,
  627. string $charset = "UTF-8",
  628. bool $double_encode = true): string;
  629. /**
  630. * This function is the opposite of htmlspecialchars(). It converts special
  631. * HTML entities back to characters. The converted entities are: &amp;,
  632. * &quot; (when ENT_NOQUOTES is not set), &#039; (when ENT_QUOTES is set),
  633. * &lt; and &gt;.
  634. *
  635. * @param string $str - The string to decode
  636. * @param int $quote_style - The quote style. One of the following constants:
  637. * quote_style constants Constant Name Description ENT_COMPAT Will convert
  638. * double-quotes and leave single-quotes alone (default) ENT_QUOTES Will
  639. * convert both double and single quotes ENT_NOQUOTES Will leave both double
  640. * and single quotes unconverted
  641. *
  642. * @return string - Returns the decoded string.
  643. *
  644. */
  645. <<__Native>>
  646. function htmlspecialchars_decode(string $str,
  647. int $quote_style = ENT_COMPAT): string;
  648. /**
  649. * Certain characters have special significance in HTML, and should be
  650. * represented by HTML entities if they are to preserve their meanings. This
  651. * function returns a string with some of these conversions made; the
  652. * translations made are those most useful for everyday web programming. If
  653. * you require all HTML character entities to be translated, use
  654. * htmlentities() instead. This function is useful in preventing user-supplied
  655. * text from containing HTML markup, such as in a message board or guest book
  656. * application. The translations performed are: '&' (ampersand) becomes
  657. * '&amp;' '"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set.
  658. * ''' (single quote) becomes '&#039;' only when ENT_QUOTES is set. '<' (less
  659. * than) becomes '&lt;' '>' (greater than) becomes '&gt;'
  660. *
  661. * @param string $str - The string being converted.
  662. * @param int $quote_style - The optional second argument, quote_style, tells
  663. * the function what to do with single and double quote characters. The
  664. * default mode, ENT_COMPAT, is the backwards compatible mode which only
  665. * translates the double-quote character and leaves the single-quote
  666. * untranslated. If ENT_QUOTES is set, both single and double quotes are
  667. * translated and if ENT_NOQUOTES is set neither single nor double quotes are
  668. * translated.
  669. * @param string $charset - Defines character set used in conversion. The
  670. * default character set is ISO-8859-1. For the purposes of this function,
  671. * the charsets ISO-8859-1, ISO-8859-15, UTF-8, cp866, cp1251, cp1252, and
  672. * KOI8-R are effectively equivalent, as the characters affected by
  673. * htmlspecialchars() occupy the same positions in all of these charsets.
  674. * Following character sets are supported in PHP 4.3.0 and later. Supported
  675. * charsets Charset Aliases Description ISO-8859-1 ISO8859-1 Western European,
  676. * Latin-1 ISO-8859-15 ISO8859-15 Western European, Latin-9. Adds the Euro
  677. * sign, French and Finnish letters missing in Latin-1(ISO-8859-1). UTF-8
  678. * ASCII compatible multi-byte 8-bit Unicode. cp866 ibm866, 866 DOS-specific
  679. * Cyrillic charset. This charset is supported in 4.3.2. cp1251 Windows-1251,
  680. * win-1251, 1251 Windows-specific Cyrillic charset. This charset is supported
  681. * in 4.3.2. cp1252 Windows-1252, 1252 Windows specific charset for Western
  682. * European. KOI8-R koi8-ru, koi8r Russian. This charset is supported in
  683. * 4.3.2. BIG5 950 Traditional Chinese, mainly used in Taiwan. GB2312 936
  684. * Simplified Chinese, national standard character set. BIG5-HKSCS Big5 with
  685. * Hong Kong extensions, Traditional Chinese. Shift_JIS SJIS, 932 Japanese
  686. * EUC-JP EUCJP Japanese Any other character sets are not recognized and
  687. * ISO-8859-1 will be used instead.
  688. * @param bool $double_encode - When double_encode is turned off PHP will not
  689. * encode existing html entities, the default is to convert everything.
  690. *
  691. * @return string - The converted string.
  692. *
  693. */
  694. <<__Native>>
  695. function htmlspecialchars(string $str,
  696. int $quote_style = ENT_COMPAT,
  697. string $charset = "UTF-8",
  698. bool $double_encode = true): string;
  699. /**
  700. * Certain characters have special significance in HTML, and should be
  701. * represented by HTML entities if they are to preserve their meanings. This
  702. * function returns a string with some of these conversions made; the
  703. * translations made are those most useful for everyday web programming. If
  704. * you require all HTML character entities to be translated, use
  705. * htmlentities() instead. This function is useful in preventing user-supplied
  706. * text from containing HTML markup, such as in a message board or guest book
  707. * application. The translations performed are: '&' (ampersand) becomes
  708. * '&amp;' '"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set.
  709. * ''' (single quote) becomes '&#039;' only when ENT_QUOTES is set. '<' (less
  710. * than) becomes '&lt;' '>' (greater than) becomes '&gt;'
  711. *
  712. * @param string $str - The string being converted.
  713. * @param int $quote_style - The optional second argument, quote_style, tells
  714. * the function what to do with single and double quote characters. The
  715. * default mode, ENT_COMPAT, is the backwards compatible mode which only
  716. * translates the double-quote character and leaves the single-quote
  717. * untranslated. If ENT_QUOTES is set, both single and double quotes are
  718. * translated and if ENT_NOQUOTES is set neither single nor double quotes are
  719. * translated.
  720. * @param string $charset - Defines character set used in conversion. The
  721. * default character set is ISO-8859-1. For the purposes of this function,
  722. * the charsets ISO-8859-1, ISO-8859-15, UTF-8, cp866, cp1251, cp1252, and
  723. * KOI8-R are effectively equivalent, as the characters affected by
  724. * htmlspecialchars() occupy the same positions in all of these charsets.
  725. * Following character sets are supported in PHP 4.3.0 and later. Supported
  726. * charsets Charset Aliases Description ISO-8859-1 ISO8859-1 Western European,
  727. * Latin-1 ISO-8859-15 ISO8859-15 Western European, Latin-9. Adds the Euro
  728. * sign, French and Finnish letters missing in Latin-1(ISO-8859-1). UTF-8
  729. * ASCII compatible multi-byte 8-bit Unicode. cp866 ibm866, 866 DOS-specific
  730. * Cyrillic charset. This charset is supported in 4.3.2. cp1251 Windows-1251,
  731. * win-1251, 1251 Windows-specific Cyrillic charset. This charset is supported
  732. * in 4.3.2. cp1252 Windows-1252, 1252 Windows specific charset for Western
  733. * European. KOI8-R koi8-ru, koi8r Russian. This charset is supported in
  734. * 4.3.2. BIG5 950 Traditional Chinese, mainly used in Taiwan. GB2312 936
  735. * Simplified Chinese, national standard character set. BIG5-HKSCS Big5 with
  736. * Hong Kong extensions, Traditional Chinese. Shift_JIS SJIS, 932 Japanese
  737. * EUC-JP EUCJP Japanese Any other character sets are not recognized and
  738. * ISO-8859-1 will be used instead.
  739. * @param array $extra - An array of extra ascii chars to be encoded.
  740. *
  741. * @return string - The converted string.
  742. *
  743. */
  744. <<__Native>>
  745. function fb_htmlspecialchars(string $str,
  746. int $quote_style = ENT_COMPAT,
  747. string $charset = "ISO-8859-1",
  748. mixed $extra = varray[]): string;
  749. /**
  750. * Returns a quoted printable string created according to RFC2045, section
  751. * 6.7. This function is similar to imap_8bit(), except this one does not
  752. * require the IMAP module to work.
  753. *
  754. * @param string $str - The input string.
  755. *
  756. * @return string - Returns the encoded string.
  757. *
  758. */
  759. <<__IsFoldable, __Native, __Rx>>
  760. function quoted_printable_encode(string $str): string;
  761. /**
  762. * This function returns an 8-bit binary string corresponding to the decoded
  763. * quoted printable string (according to RFC2045, section 6.7, not RFC2821,
  764. * section 4.5.2, so additional periods are not stripped from the beginning of
  765. * line). This function is similar to imap_qprint(), except this one does not
  766. * require the IMAP module to work.
  767. *
  768. * @param string $str - The input string.
  769. *
  770. * @return string - Returns the 8-bit binary string.
  771. *
  772. */
  773. <<__IsFoldable, __Native, __Rx>>
  774. function quoted_printable_decode(string $str): string;
  775. /**
  776. * convert_uudecode() decodes a uuencoded string.
  777. *
  778. * @param string $data - The uuencoded data.
  779. *
  780. * @return mixed - Returns the decoded data as a string.
  781. *
  782. */
  783. <<__IsFoldable, __Native, __Rx>>
  784. function convert_uudecode(string $data): mixed;
  785. /**
  786. * convert_uuencode() encodes a string using the uuencode algorithm. Uuencode
  787. * translates all strings (including binary's ones) into printable characters,
  788. * making them safe for network transmissions. Uuencoded data is about 35%
  789. * larger than the original.
  790. *
  791. * @param string $data - The data to be encoded.
  792. *
  793. * @return mixed - Returns the uuencoded data.
  794. *
  795. */
  796. <<__IsFoldable, __Native, __Rx>>
  797. function convert_uuencode(string $data): mixed;
  798. /**
  799. * Performs the ROT13 encoding on the str argument and returns the resulting
  800. * string. The ROT13 encoding simply shifts every letter by 13 places in the
  801. * alphabet while leaving non-alpha characters untouched. Encoding and
  802. * decoding are done by the same function, passing an encoded string as
  803. * argument will return the original version.
  804. *
  805. * @param string $str - The input string.
  806. *
  807. * @return string - Returns the ROT13 version of the given string.
  808. *
  809. */
  810. <<__IsFoldable, __Native, __Rx>>
  811. function str_rot13(string $str): string;
  812. /**
  813. * Generates the cyclic redundancy checksum polynomial of 32-bit lengths of
  814. * the str. This is usually used to validate the integrity of data being
  815. * transmitted. Because PHP's integer type is signed, and many crc32
  816. * checksums will result in negative integers, you need to use the "%u"
  817. * formatter of sprintf() or printf() to get the string representation of the
  818. * unsigned crc32 checksum.
  819. *
  820. * @param string $str - The data.
  821. *
  822. * @return int - Returns the crc32 checksum of str as an integer.
  823. *
  824. */
  825. <<__IsFoldable, __Native, __Rx>>
  826. function crc32(string $str): int;
  827. /**
  828. * crypt() will return a hashed string using the standard Unix DES-based
  829. * algorithm or alternative algorithms that may be available on the system.
  830. * Some operating systems support more than one type of hash. In fact,
  831. * sometimes the standard DES-based algorithm is replaced by an MD5-based
  832. * algorithm. The hash type is triggered by the salt argument. Prior to 5.3,
  833. * PHP would determine the available algorithms at install-time based on the
  834. * system's crypt(). If no salt is provided, PHP will auto-generate either a
  835. * standard two character (DES) salt, or a twelve character (MD5), depending
  836. * on the availability of MD5 crypt(). PHP sets a constant named
  837. * CRYPT_SALT_LENGTH which indicates the longest valid salt allowed by the
  838. * available hashes. The standard DES-based crypt() returns the salt as the
  839. * first two characters of the output. It also only uses the first eight
  840. * characters of str, so longer strings that start with the same eight
  841. * characters will generate the same result (when the same salt is used). On
  842. * systems where the crypt() function supports multiple hash types, the
  843. * following constants are set to 0 or 1 depending on whether the given type
  844. * is available: CRYPT_STD_DES - Standard DES-based hash with a two character
  845. * salt from the alphabet "./0-9A-Za-z". Using invalid characters in the salt
  846. * will cause crypt() to fail. CRYPT_EXT_DES - Extended DES-based hash. The
  847. * "salt" is a 9-character string consisting of an underscore followed by 4
  848. * bytes of iteration count and 4 bytes of salt. These are encoded as
  849. * printable characters, 6 bits per character, least significant character
  850. * first. The values 0 to 63 are encoded as "./0-9A-Za-z". Using invalid
  851. * characters in the salt will cause crypt() to fail. CRYPT_MD5 - MD5 hashing
  852. * with a twelve character salt starting with $1$ CRYPT_BLOWFISH - Blowfish
  853. * hashing with a salt as follows: "$2a$", a two digit cost parameter, "$",
  854. * and 22 base 64 digits from the alphabet "./0-9A-Za-z". Using characters
  855. * outside of this range in the salt will cause crypt() to return a
  856. * zero-length string. The two digit cost parameter is the base-2 logarithm of
  857. * the iteration count for the underlying Blowfish-based hashing algorithmeter
  858. * and must be in range 04-31, values outside this range will cause crypt() to
  859. * fail. CRYPT_SHA256 - SHA-256 hash with a sixteen character salt prefixed
  860. * with $5$. If the salt string starts with 'rounds=<N>$', the numeric value
  861. * of N is used to indicate how many times the hashing loop should be
  862. * executed, much like the cost parameter on Blowfish. The default number of
  863. * rounds is 5000, there is a minimum of 1000 and a maximum of 999,999,999.
  864. * Any selection of N outside this range will be truncated to the nearest
  865. * limit. CRYPT_SHA512 - SHA-512 hash with a sixteen character salt prefixed
  866. * with $6$. If the salt string starts with 'rounds=<N>$', the numeric value
  867. * of N is used to indicate how many times the hashing loop should be
  868. * executed, much like the cost parameter on Blowfish. The default number of
  869. * rounds is 5000, there is a minimum of 1000 and a maximum of 999,999,999.
  870. * Any selection of N outside this range will be truncated to the nearest
  871. * limit. As of PHP 5.3.0, PHP contains its own implementation and will use
  872. * that if the system lacks of support for one or more of the algorithms.
  873. *
  874. * @param string $str - The string to be hashed.
  875. * @param string $salt - An optional salt string to base the hashing on. If
  876. * not provided, the behaviour is defined by the algorithm implementation and
  877. * can lead to unexpected results.
  878. *
  879. * @return string - Returns the hashed string or a string that is shorter than
  880. * 13 characters and is guaranteed to differ from the salt on failure.
  881. *
  882. */
  883. <<__Native>>
  884. function crypt(string $str, string $salt = ""): string;
  885. /**
  886. * Calculates the MD5 hash of str using the RSA Data Security, Inc. MD5
  887. * Message-Digest Algorithm, and returns that hash.
  888. *
  889. * @param string $str - The string.
  890. * @param bool $raw_output - If the optional raw_output is set to TRUE, then
  891. * the md5 digest is instead returned in raw binary format with a length of
  892. * 16.
  893. *
  894. * @return string - Returns the hash as a 32-character hexadecimal number.
  895. *
  896. */
  897. <<__IsFoldable, __Native, __Rx>>
  898. function md5(string $str, bool $raw_output = false): string;
  899. /**
  900. * @param string $str - The input string.
  901. * @param bool $raw_output - If the optional raw_output is set to TRUE, then
  902. * the sha1 digest is instead returned in raw binary format with a length of
  903. * 20, otherwise the returned value is a 40-character hexadecimal number.
  904. *
  905. * @return string - Returns the sha1 hash as a string.
  906. *
  907. */
  908. <<__IsFoldable, __Native, __Rx>>
  909. function sha1(string $str, bool $raw_output = false): string;
  910. /**
  911. * This function returns a copy of str, translating all occurrences of each
  912. * character in from to the corresponding character in to. If from and to are
  913. * different lengths, the extra characters in the longer of the two are
  914. * ignored.
  915. *
  916. * @param string $str - The string being translated.
  917. * @param mixed $from - The string being translated to to.
  918. * @param mixed $to - The string replacing from.
  919. *
  920. * @return mixed - Returns the translated string. If replace_pairs contains a
  921. * key which is an empty string (""), FALSE will be returned.
  922. *
  923. */
  924. <<__IsFoldable, __Native, __Rx>>
  925. function strtr(string $str, mixed $from, mixed $to = null): mixed;
  926. /**
  927. * Converts from one Cyrillic character set to another. Supported characters
  928. * are: k - koi8-r w - windows-1251 i - iso8859-5 a - x-cp866 d - x-cp866 m -
  929. * x-mac-cyrillic
  930. *
  931. * @param string $str - The string to be converted.
  932. * @param string $from - The source Cyrillic character set, as a single
  933. * character.
  934. * @param string $to - The target Cyrillic character set, as a single
  935. * character.
  936. *
  937. * @return string - Returns the converted string.
  938. *
  939. */
  940. <<__IsFoldable, __Native, __Rx>>
  941. function convert_cyr_string(string $str, string $from, string $to): string;
  942. /**
  943. * get_html_translation_table() will return the translation table that is used
  944. * internally for htmlspecialchars() and htmlentities() with the default
  945. * charset. Special characters can be encoded in several ways. E.g. " can be
  946. * encoded as &quot;, &#34; or &#x22. get_html_translation_table() returns
  947. * only the most common form for them.
  948. *
  949. * @param int $table - There are two new constants (HTML_ENTITIES,
  950. * HTML_SPECIALCHARS) that allow you to specify the table you want.
  951. * @param int $quote_style - Like the htmlspecialchars() and htmlentities()
  952. * functions you can optionally specify the quote_style you are working with.
  953. * See the description of these modes in htmlspecialchars().
  954. * @param string $encoding - Encoding to use. If omitted, the default value
  955. * for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and
  956. * UTF-8 from PHP 5.4.0 onwards.
  957. *
  958. * @return array - Returns the translation table as an array.
  959. *
  960. */
  961. <<__Native>>
  962. function get_html_translation_table(int $table = 0,
  963. int $quote_style = ENT_COMPAT,
  964. string $encoding = "UTF-8"): array;
  965. /**
  966. * Converts logical Hebrew text to visual text. The function tries to avoid
  967. * breaking words.
  968. *
  969. * @param string $hebrew_text - A Hebrew input string.
  970. * @param int $max_chars_per_line - This optional parameter indicates maximum
  971. * number of characters per line that will be returned.
  972. *
  973. * @return string - Returns the visual string.
  974. *
  975. */
  976. <<__Native>>
  977. function hebrev(string $hebrew_text, int $max_chars_per_line = 0): string;
  978. /**
  979. * This function is similar to hebrev() with the difference that it converts
  980. * newlines (\n) to "<br>\n". The function tries to avoid breaking words.
  981. *
  982. * @param string $hebrew_text - A Hebrew input string.
  983. *
  984. * @param int $max_chars_per_line - This optional parameter indicates maximum
  985. * number of characters per line that will be returned.
  986. *
  987. * @return string - Returns the visual string.
  988. *
  989. */
  990. <<__Native>>
  991. function hebrevc(string $hebrew_text, int $max_chars_per_line = 0): string;
  992. /**
  993. * Sets locale information. On Windows, setlocale(LC_ALL, '') sets the locale
  994. * names from the system's regional/language settings (accessible via Control
  995. * Panel).
  996. *
  997. * @param int $category - category is a named constant specifying the category
  998. * of the functions affected by the locale setting: LC_ALL for all of the
  999. * below LC_COLLATE for string comparison, see strcoll() LC_CTYPE for
  1000. * character classification and conversion, for example strtoupper()
  1001. * LC_MONETARY for localeconv() LC_NUMERIC for decimal separator (See also
  1002. * localeconv()) LC_TIME for date and time formatting with strftime()
  1003. * LC_MESSAGES for system responses (available if PHP was compiled with
  1004. * libintl)
  1005. * @param mixed $locale - If locale is NULL or the empty string "", the locale
  1006. * names will be set from the values of environment variables with the same
  1007. * names as the above categories, or from "LANG". If locale is "0", the
  1008. * locale setting is not affected, only the current setting is returned. If
  1009. * locale is an array or followed by additional parameters then each array
  1010. * element or parameter is tried to be set as new locale until success. This
  1011. * is useful if a locale is known under different names on different systems
  1012. * or for providing a fallback for a possibly not available locale.
  1013. *
  1014. * @return mixed - Returns the new current locale, or FALSE if the locale
  1015. * functionality is not implemented on your platform, the specified locale
  1016. * does not exist or the category name is invalid. An invalid category name
  1017. * also causes a warning message. Category/locale names can be found in RFC
  1018. * 1766 and ISO 639. Different systems have different naming schemes for
  1019. * locales. The return value of setlocale() depends on the system that PHP is
  1020. * running. It returns exactly what the system setlocale function returns.
  1021. *
  1022. */
  1023. <<__Native, __NonRx('Sets Global')>>
  1024. function setlocale(int $category, mixed $locale, ...$argv): mixed;
  1025. /**
  1026. * Returns an associative array containing localized numeric and monetary
  1027. * formatting information.
  1028. *
  1029. * @return array
  1030. *
  1031. */
  1032. <<__Native>>
  1033. function localeconv(): array;
  1034. /**
  1035. * nl_langinfo() is used to access individual elements of the locale
  1036. * categories. Unlike localeconv(), which returns all of the elements,
  1037. * nl_langinfo() allows you to select any specific element.
  1038. *
  1039. * @param int $item
  1040. *
  1041. * @return string - Returns the element as a string, or FALSE if item is not
  1042. * valid.
  1043. *
  1044. */
  1045. <<__Native>>
  1046. function nl_langinfo(int $item): mixed;
  1047. /**
  1048. * The function sscanf() is the input analog of printf(). sscanf() reads from
  1049. * the string str and interprets it according to the specified format, which
  1050. * is described in the documentation for sprintf(). Any whitespace in the
  1051. * format string matches any whitespace in the input string. This means that
  1052. * even a tab \t in the format string can match a single space character in
  1053. * the input string.
  1054. *
  1055. * @param string $str - The input string being parsed.
  1056. * @param string $format - The interpreted format for str, which is d…

Large files files are truncated, but you can click here to view the full file