-
Notifications
You must be signed in to change notification settings - Fork 803
/
Copy pathstandard_1.php
1234 lines (1183 loc) · 38.9 KB
/
standard_1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
use JetBrains\PhpStorm\ArrayShape;
use JetBrains\PhpStorm\Deprecated;
use JetBrains\PhpStorm\ExpectedValues;
use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware;
use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable;
use JetBrains\PhpStorm\Pure;
/**
* Make a string uppercase
* @link https://php.net/manual/en/function.strtoupper.php
* @param string $string <p>
* The input string.
* </p>
* @return string the uppercased string.
*/
#[Pure]
function strtoupper(string $string): string {}
/**
* Make a string lowercase
* @link https://php.net/manual/en/function.strtolower.php
* @param string $string <p>
* The input string.
* </p>
* @return string the lowercased string.
*/
#[Pure]
function strtolower(string $string): string {}
/**
* Find the position of the first occurrence of a substring in a string
* @link https://php.net/manual/en/function.strpos.php
* @param string $haystack <p>
* The string to search in
* </p>
* @param string $needle <p>
* If <b>needle</b> is not a string, it is converted
* to an integer and applied as the ordinal value of a character.
* </p>
* @param int<0,max> $offset [optional] <p>
* If specified, search will start this number of characters counted from
* the beginning of the string. Unlike {@see strrpos()} and {@see strripos()}, the offset cannot be negative.
* </p>
* @return int<0,max>|false <p>
* Returns the position where the needle exists relative to the beginning of
* the <b>haystack</b> string (independent of search direction
* or offset).
* Also note that string positions start at 0, and not 1.
* </p>
* <p>
* Returns <b>FALSE</b> if the needle was not found.
* </p>
*/
#[Pure]
function strpos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Find position of first occurrence of a case-insensitive string
* @link https://php.net/manual/en/function.stripos.php
* @param string $haystack <p>
* The string to search in
* </p>
* @param string $needle <p>
* Note that the needle may be a string of one or
* more characters.
* </p>
* <p>
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
* @param int $offset <p>
* The optional offset parameter allows you
* to specify which character in haystack to
* start searching. The position returned is still relative to the
* beginning of haystack.
* </p>
* @return int|false If needle is not found,
* stripos will return boolean false.
*/
#[Pure]
function stripos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Find the position of the last occurrence of a substring in a string
* @link https://php.net/manual/en/function.strrpos.php
* @param string $haystack <p>
* The string to search in.
* </p>
* @param string $needle <p>
* If <b>needle</b> is not a string, it is converted to an integer and applied as the ordinal value of a character.
* </p>
* @param int $offset [optional] <p>
* If specified, search will start this number of characters counted from the beginning of the string. If the value is negative, search will instead start from that many characters from the end of the string, searching backwards.
* </p>
* @return int|false <p>
* Returns the position where the needle exists relative to the beginning of
* the <b>haystack</b> string (independent of search direction
* or offset).
* Also note that string positions start at 0, and not 1.
* </p>
* <p>
* Returns <b>FALSE</b> if the needle was not found.
* </p>
*/
#[Pure]
function strrpos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Find position of last occurrence of a case-insensitive string in a string
* @link https://php.net/manual/en/function.strripos.php
* @param string $haystack <p>
* The string to search in
* </p>
* @param string $needle <p>
* Note that the needle may be a string of one or
* more characters.
* </p>
* @param int $offset <p>
* The offset parameter may be specified to begin
* searching an arbitrary number of characters into the string.
* </p>
* <p>
* Negative offset values will start the search at
* offset characters from the
* start of the string.
* </p>
* @return int|false the numerical position of the last occurrence of
* needle. Also note that string positions start at 0,
* and not 1.
* </p>
* <p>
* If needle is not found, false is returned.
*/
#[Pure]
function strripos(string $haystack, string $needle, int $offset = 0): int|false {}
/**
* Reverse a string
* @link https://php.net/manual/en/function.strrev.php
* @param string $string <p>
* The string to be reversed.
* </p>
* @return string the reversed string.
*/
#[Pure]
function strrev(string $string): string {}
/**
* Convert logical Hebrew text to visual text
* @link https://php.net/manual/en/function.hebrev.php
* @param string $string <p>
* A Hebrew input string.
* </p>
* @param int $max_chars_per_line <p>
* This optional parameter indicates maximum number of characters per
* line that will be returned.
* </p>
* @return string the visual string.
*/
#[Pure]
function hebrev(string $string, int $max_chars_per_line = 0): string {}
/**
* Convert logical Hebrew text to visual text with newline conversion
* @link https://php.net/manual/en/function.hebrevc.php
* @param string $hebrew_text <p>
* A Hebrew input string.
* </p>
* @param int $max_chars_per_line [optional] <p>
* This optional parameter indicates maximum number of characters per
* line that will be returned.
* </p>
* @return string the visual string.
* @removed 8.0
*/
#[Deprecated(replacement: 'nl2br(hebrev(%parameter0%))', since: '7.4')]
function hebrevc(string $hebrew_text, $max_chars_per_line): string {}
/**
* Inserts HTML line breaks before all newlines in a string
* @link https://php.net/manual/en/function.nl2br.php
* @param string $string <p>
* The input string.
* </p>
* @param bool $use_xhtml [optional] <p>
* Whether to use XHTML compatible line breaks or not.
* </p>
* @return string the altered string.
*/
#[Pure]
function nl2br(string $string, bool $use_xhtml = true): string {}
/**
* Returns trailing name component of path
* @link https://php.net/manual/en/function.basename.php
* @param string $path <p>
* A path.
* </p>
* <p>
* On Windows, both slash (/) and backslash
* (\) are used as directory separator character. In
* other environments, it is the forward slash (/).
* </p>
* @param string $suffix <p>
* If the filename ends in suffix this will also
* be cut off.
* </p>
* @return string the base name of the given path.
*/
#[Pure]
function basename(string $path, string $suffix = ''): string {}
/**
* Returns a parent directory's path
* @link https://php.net/manual/en/function.dirname.php
* @param string $path <p>
* A path.
* </p>
* <p>
* On Windows, both slash (/) and backslash
* (\) are used as directory separator character. In
* other environments, it is the forward slash (/).
* </p>
* @param int $levels <p>
* The number of parent directories to go up.
* This must be an integer greater than 0.
* </p>
* @return string the name of the directory. If there are no slashes in
* path, a dot ('.') is returned,
* indicating the current directory. Otherwise, the returned string is
* path with any trailing
* /component removed.
*/
#[Pure]
function dirname(string $path, #[PhpStormStubsElementAvailable(from: '7.0')] int $levels = 1): string {}
/**
* Returns information about a file path
* @link https://php.net/manual/en/function.pathinfo.php
* @param string $path <p>
* The path being checked.
* </p>
* @param int $flags [optional] <p>
* You can specify which elements are returned with optional parameter
* options. It composes from
* PATHINFO_DIRNAME,
* PATHINFO_BASENAME,
* PATHINFO_EXTENSION and
* PATHINFO_FILENAME. It
* defaults to return all elements.
* </p>
* @return string|array{dirname: string, basename: string, extension: string, filename: string} The following associative array elements are returned:
* dirname, basename,
* extension (if any), and filename.
* </p>
* <p>
* If options is used, this function will return a
* string if not all elements are requested.
*/
#[Pure(true)]
#[ArrayShape(['dirname' => 'string', 'basename' => 'string', 'extension' => 'string', 'filename' => 'string'])]
function pathinfo(string $path, #[ExpectedValues(flags: [
PATHINFO_DIRNAME,
PATHINFO_BASENAME,
PATHINFO_EXTENSION,
PATHINFO_FILENAME
])] int $flags = PATHINFO_ALL): array|string {}
/**
* Un-quotes a quoted string
* @link https://php.net/manual/en/function.stripslashes.php
* @param string $string <p>
* The input string.
* </p>
* @return string a string with backslashes stripped off.
* (\' becomes ' and so on.)
* Double backslashes (\\) are made into a single
* backslash (\).
*/
#[Pure]
function stripslashes(string $string): string {}
/**
* Un-quote string quoted with <function>addcslashes</function>
* @link https://php.net/manual/en/function.stripcslashes.php
* @param string $string <p>
* The string to be unescaped.
* </p>
* @return string the unescaped string.
*/
#[Pure]
function stripcslashes(string $string): string {}
/**
* Find the first occurrence of a string
* @link https://php.net/manual/en/function.strstr.php
* @param string $haystack <p>
* The input string.
* </p>
* @param string $needle <p>
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
* @param bool $before_needle [optional] <p>
* If true, strstr returns
* the part of the haystack before the first
* occurrence of the needle.
* </p>
* @return string|false the portion of string, or false if needle
* is not found.
*/
#[Pure]
function strstr(string $haystack, string $needle, bool $before_needle = false): string|false {}
/**
* Case-insensitive <function>strstr</function>
* @link https://php.net/manual/en/function.stristr.php
* @param string $haystack <p>
* The string to search in
* </p>
* @param string $needle <p>
* If needle is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
* @param bool $before_needle [optional] <p>
* If true, stristr
* returns the part of the haystack before the
* first occurrence of the needle.
* </p>
* @return string|false the matched substring. If needle is not
* found, returns false.
*/
#[Pure]
function stristr(string $haystack, string $needle, bool $before_needle = false): string|false {}
/**
* Find the last occurrence of a character in a string
* @link https://php.net/manual/en/function.strrchr.php
* @param string $haystack <p>
* The string to search in
* </p>
* @param string $needle <p>
* If <b>needle</b> contains more than one character,
* only the first is used. This behavior is different from that of {@see strstr()}.
* </p>
* <p>
* If <b>needle</b> is not a string, it is converted to
* an integer and applied as the ordinal value of a character.
* </p>
* @param bool $before_needle Since 8.3 If true, strrchr() returns the part of the haystack before the last occurrence
* of the needle (excluding the needle).
* @return string|false <p>
* This function returns the portion of string, or <b>FALSE</b> if
* <b>needle</b> is not found.
* </p>
*/
#[Pure]
function strrchr(string $haystack, string $needle, #[PhpStormStubsElementAvailable(from: '8.3')] bool $before_needle = false): string|false {}
/**
* Randomly shuffles a string
* @link https://php.net/manual/en/function.str-shuffle.php
* @param string $string <p>
* The input string.
* </p>
* @return string the shuffled string.
*/
function str_shuffle(string $string): string {}
/**
* Return information about words used in a string
* @link https://php.net/manual/en/function.str-word-count.php
* @param string $string <p>
* The string
* </p>
* @param int $format [optional] <p>
* Specify the return value of this function. The current supported values
* are:
* 0 - returns the number of words found
* </p>
* @param string|null $characters [optional] <p>
* A list of additional characters which will be considered as 'word'
* </p>
* @return string[]|int an array or an integer, depending on the
* format chosen.
*/
#[Pure]
function str_word_count(string $string, int $format = 0, ?string $characters): array|int {}
/**
* Convert a string to an array
* @link https://php.net/manual/en/function.str-split.php
* @param string $string <p>
* The input string.
* </p>
* @param int $length [optional] <p>
* Maximum length of the chunk.
* </p>
* @return string[]|false <p>If the optional split_length parameter is
* specified, the returned array will be broken down into chunks with each
* being split_length in length, otherwise each chunk
* will be one character in length.
* </p>
* <p>
* <b>FALSE</b> is returned if split_length is less than 1.
* If the split_length length exceeds the length of
* string, the entire string is returned as the first
* (and only) array element.
* </p>
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")]
function str_split(string $string, int $length = 1): array|false {}
/**
* Search a string for any of a set of characters
* @link https://php.net/manual/en/function.strpbrk.php
* @param string $string <p>
* The string where char_list is looked for.
* </p>
* @param string $characters <p>
* This parameter is case sensitive.
* </p>
* @return string|false a string starting from the character found, or false if it is
* not found.
*/
#[Pure]
function strpbrk(
string $string,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.0')] $char_list = '',
#[PhpStormStubsElementAvailable(from: '7.1')] string $characters
): string|false {}
/**
* Binary safe comparison of two strings from an offset, up to length characters
* @link https://php.net/manual/en/function.substr-compare.php
* @param string $haystack <p>
* The main string being compared.
* </p>
* @param string $needle <p>
* The secondary string being compared.
* </p>
* @param int $offset <p>
* The start position for the comparison. If negative, it starts counting
* from the end of the string.
* </p>
* @param int|null $length [optional] <p>
* The length of the comparison.
* </p>
* @param bool $case_insensitive [optional] <p>
* If case_insensitivity is true, comparison is
* case insensitive.
* </p>
* @return int if less than 0 if main_str from position
* offset is less than str, >
* 0 if it is greater than str, and 0 if they are equal.
* If offset is equal to or greater than the length of
* main_str or length is set and
* is less than 1, substr_compare prints a warning and returns
* false.
*/
#[Pure]
function substr_compare(string $haystack, string $needle, int $offset, ?int $length, bool $case_insensitive = false): int {}
/**
* Locale based string comparison
* @link https://php.net/manual/en/function.strcoll.php
* @param string $string1 <p>
* The first string.
* </p>
* @param string $string2 <p>
* The second string.
* </p>
* @return int if less than 0 if str1 is less than
* str2; > 0 if
* str1 is greater than
* str2, and 0 if they are equal.
*/
#[Pure]
function strcoll(string $string1, string $string2): int {}
/**
* Formats a number as a currency string
* @link https://php.net/manual/en/function.money-format.php
* @param string $format <p>
* The format specification consists of the following sequence:<br>
* a % character</p>
* @param float $number <p>
* The number to be formatted.
* </p>
* @return string|null the formatted string. Characters before and after the formatting
* string will be returned unchanged.
* Non-numeric number causes returning null and
* emitting E_WARNING.
* @removed 8.0
* @see NumberFormatter
*/
#[Deprecated(reason: 'Use the NumberFormatter functionality', since: '7.4')]
function money_format(string $format, float $number): ?string {}
/**
* Return part of a string or false on failure. For PHP8.0+ only string is returned
* @link https://php.net/manual/en/function.substr.php
* @param string $string <p>
* The input string.
* </p>
* @param int $offset <p>
* If start is non-negative, the returned string
* will start at the start'th position in
* string, counting from zero. For instance,
* in the string 'abcdef', the character at
* position 0 is 'a', the
* character at position 2 is
* 'c', and so forth.
* </p>
* <p>
* If start is negative, the returned string
* will start at the start'th character
* from the end of string.
* </p>
* <p>
* If string is less than or equal to
* start characters long, false will be returned.
* </p>
* <p>
* Using a negative start
* </p>
* <pre>
* <?php
* $rest = substr("abcdef", -1); // returns "f"
* $rest = substr("abcdef", -2); // returns "ef"
* $rest = substr("abcdef", -3, 1); // returns "d"
* ?>
* </pre>
* @param int|null $length [optional] <p>
* If length is given and is positive, the string
* returned will contain at most length characters
* beginning from start (depending on the length of
* string).
* </p>
* <p>
* If length is given and is negative, then that many
* characters will be omitted from the end of string
* (after the start position has been calculated when a
* start is negative). If
* start denotes a position beyond this truncation,
* an empty string will be returned.
* </p>
* <p>
* If length is given and is 0,
* false or null an empty string will be returned.
* </p>
* Using a negative length:
* <pre>
* <?php
* $rest = substr("abcdef", 0, -1); // returns "abcde"
* $rest = substr("abcdef", 2, -1); // returns "cde"
* $rest = substr("abcdef", 4, -4); // returns false
* $rest = substr("abcdef", -3, -1); // returns "de"
* ?>
* </pre>
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")]
function substr(string $string, int $offset, ?int $length) {}
/**
* Replace text within a portion of a string
* @link https://php.net/manual/en/function.substr-replace.php
* @param string[]|string $string <p>
* The input string.
* </p>
* @param string[]|string $replace <p>
* The replacement string.
* </p>
* @param int[]|int $offset <p>
* If start is positive, the replacing will
* begin at the start'th offset into
* string.
* </p>
* <p>
* If start is negative, the replacing will
* begin at the start'th character from the
* end of string.
* </p>
* @param int[]|int $length [optional] <p>
* If given and is positive, it represents the length of the portion of
* string which is to be replaced. If it is
* negative, it represents the number of characters from the end of
* string at which to stop replacing. If it
* is not given, then it will default to strlen(
* string ); i.e. end the replacing at the
* end of string. Of course, if
* length is zero then this function will have the
* effect of inserting replacement into
* string at the given
* start offset.
* </p>
* @return string|string[] The result string is returned. If string is an
* array then array is returned.
*/
#[Pure]
function substr_replace(array|string $string, array|string $replace, array|int $offset, array|int|null $length = null): array|string {}
/**
* Quote meta characters
* @link https://php.net/manual/en/function.quotemeta.php
* @param string $string <p>
* The input string.
* </p>
* @return string the string with meta characters quoted.
*/
#[Pure]
function quotemeta(string $string): string {}
/**
* Make a string's first character uppercase
* @link https://php.net/manual/en/function.ucfirst.php
* @param string $string <p>
* The input string.
* </p>
* @return string the resulting string.
*/
#[Pure]
function ucfirst(string $string): string {}
/**
* Make a string's first character lowercase
* @link https://php.net/manual/en/function.lcfirst.php
* @param string $string <p>
* The input string.
* </p>
* @return string the resulting string.
*/
#[Pure]
function lcfirst(string $string): string {}
/**
* Uppercase the first character of each word in a string
* @link https://php.net/manual/en/function.ucwords.php
* @param string $string <p>
* The input string.
* </p>
* @param string $separators [optional] <p>
* The optional separators contains the word separator characters.
* </p>
* @return string the modified string.
*/
#[Pure]
function ucwords(string $string, string $separators = " \t\r\n\f\v"): string {}
/**
* Translate characters or replace substrings
* @link https://php.net/manual/en/function.strtr.php
* @param string $string <p>
* The string being translated.
* </p>
* @param string $from <p>
* The string replacing from.
* </p>
* @param string $to <p>
* The string being translated to to.
* </p>
* @return string This function returns a copy of str,
* translating all occurrences of each character in
* from to the corresponding character in
* to.
*/
#[Pure]
function strtr(string $string, string $from, string $to): string {}
/**
* Translate certain characters
* @link https://php.net/manual/en/function.strtr.php
* @param string $str The string being translated.
* @param array $replace_pairs The replace_pairs parameter may be used as a substitute for to and from in which case it's an array in the form array('from' => 'to', ...).
* @return string A copy of str, translating all occurrences of each character in from to the corresponding character in to.
*/
#[Pure]
function strtr(string $str, array $replace_pairs): string {}
/**
* Quote string with slashes
* @link https://php.net/manual/en/function.addslashes.php
* @param string $string <p>
* The string to be escaped.
* </p>
* @return string the escaped string.
*/
#[Pure]
function addslashes(string $string): string {}
/**
* Quote string with slashes in a C style
* @link https://php.net/manual/en/function.addcslashes.php
* @param string $string <p>
* The string to be escaped.
* </p>
* @param string $characters <p>
* A list of characters to be escaped. If
* charlist contains characters
* \n, \r etc., they are
* converted in C-like style, while other non-alphanumeric characters
* with ASCII codes lower than 32 and higher than 126 converted to
* octal representation.
* </p>
* <p>
* When you define a sequence of characters in the charlist argument
* make sure that you know what characters come between the
* characters that you set as the start and end of the range.
* </p>
* <pre>
* <?php
* echo addcslashes('foo[ ]', 'A..z');
* // output: \f\o\o\[ \]
* // All upper and lower-case letters will be escaped
* // ... but so will the [\]^_`
* ?>
* </pre>
* <p>
* Also, if the first character in a range has a higher ASCII value
* than the second character in the range, no range will be
* constructed. Only the start, end and period characters will be
* escaped. Use the ord function to find the
* ASCII value for a character.
* </p>
* <pre>
* <?php
* echo addcslashes("zoo['.']", 'z..A');
* // output: \zoo['\.']
* ?>
* </pre>
* <p>
* Be careful if you choose to escape characters 0, a, b, f, n, r,
* t and v. They will be converted to \0, \a, \b, \f, \n, \r, \t
* and \v.
* In PHP \0 (NULL), \r (carriage return), \n (newline), \f (form feed),
* \v (vertical tab) and \t (tab) are predefined escape sequences,
* while in C all of these are predefined escape sequences.
* </p>
* @return string the escaped string.
*/
#[Pure]
function addcslashes(string $string, string $characters): string {}
/**
* Strip whitespace (or other characters) from the end of a string.
* Without the second parameter, rtrim() will strip these characters:
* <ul>
* <li>" " (ASCII 32 (0x20)), an ordinary space.
* <li>"\t" (ASCII 9 (0x09)), a tab.
* <li>"\n" (ASCII 10 (0x0A)), a new line (line feed).
* <li>"\r" (ASCII 13 (0x0D)), a carriage return.
* <li>"\0" (ASCII 0 (0x00)), the NUL-byte.
* <li>"\x0B" (ASCII 11 (0x0B)), a vertical tab.
* </ul>
* @link https://php.net/manual/en/function.rtrim.php
* @param string $string <p>
* The input string.
* </p>
* @param string $characters [optional] <p>
* You can also specify the characters you want to strip, by means
* of the charlist parameter.
* Simply list all characters that you want to be stripped. With
* .. you can specify a range of characters.
* </p>
* @return string the modified string.
*/
#[Pure]
function rtrim(string $string, string $characters = " \n\r\t\v\0"): string {}
/**
* Replace all occurrences of the search string with the replacement string
* @link https://php.net/manual/en/function.str-replace.php
* @param string|string[] $search <p>
* The value being searched for, otherwise known as the needle.
* An array may be used to designate multiple needles.
* </p>
* @param string|string[] $replace <p>
* The replacement value that replaces found search
* values. An array may be used to designate multiple replacements.
* </p>
* @param string|string[] $subject <p>
* The string or array being searched and replaced on,
* otherwise known as the haystack.
* </p>
* <p>
* If subject is an array, then the search and
* replace is performed with every entry of
* subject, and the return value is an array as
* well.
* </p>
* @param int &$count [optional] If passed, this will hold the number of matched and replaced needles.
* @return string|string[] This function returns a string or an array with the replaced values.
*/
function str_replace(array|string $search, array|string $replace, array|string $subject, &$count): array|string {}
/**
* Case-insensitive version of <function>str_replace</function>.
* @link https://php.net/manual/en/function.str-ireplace.php
* @param mixed $search <p>
* Every replacement with search array is
* performed on the result of previous replacement.
* </p>
* @param array|string $replace <p>
* </p>
* @param array|string $subject <p>
* If subject is an array, then the search and
* replace is performed with every entry of
* subject, and the return value is an array as
* well.
* </p>
* @param int &$count [optional] <p>
* The number of matched and replaced needles will
* be returned in count which is passed by
* reference.
* </p>
* @return string|string[] a string or an array of replacements.
*/
function str_ireplace(array|string $search, array|string $replace, array|string $subject, &$count): array|string {}
/**
* Repeat a string
* @link https://php.net/manual/en/function.str-repeat.php
* @param string $string <p>
* The string to be repeated.
* </p>
* @param int $times <p>
* Number of time the input string should be
* repeated.
* </p>
* <p>
* multiplier has to be greater than or equal to 0.
* If the multiplier is set to 0, the function
* will return an empty string.
* </p>
* @return string the repeated string.
*/
#[Pure]
function str_repeat(string $string, int $times): string {}
/**
* Return information about characters used in a string
* @link https://php.net/manual/en/function.count-chars.php
* @param string $string <p>
* The examined string.
* </p>
* @param int $mode <p>
* See return values.
* </p>
* @return int[]|string Depending on mode
* count_chars returns one of the following:
* 0 - an array with the byte-value as key and the frequency of
* every byte as value.
* 1 - same as 0 but only byte-values with a frequency greater
* than zero are listed.
* 2 - same as 0 but only byte-values with a frequency equal to
* zero are listed.
* 3 - a string containing all unique characters is returned.
* 4 - a string containing all not used characters is returned.
*/
#[Pure]
function count_chars(string $string, int $mode = 0): array|string {}
/**
* Split a string into smaller chunks
* @link https://php.net/manual/en/function.chunk-split.php
* @param string $string <p>
* The string to be chunked.
* </p>
* @param int $length [optional] <p>
* The chunk length.
* </p>
* @param string $separator [optional] <p>
* The line ending sequence.
* </p>
* @return string the chunked string.
*/
#[Pure]
function chunk_split(string $string, int $length = 76, string $separator = "\r\n"): string {}
/**
* Strip whitespace (or other characters) from the beginning and end of a string
* @link https://php.net/manual/en/function.trim.php
* @param string $string <p>
* The string that will be trimmed.
* </p>
* @param string $characters [optional] <p>
* Optionally, the stripped characters can also be specified using
* the charlist parameter.
* Simply list all characters that you want to be stripped. With
* .. you can specify a range of characters.
* </p>
* @return string The trimmed string.
*/
#[Pure]
function trim(string $string, string $characters = " \n\r\t\v\0"): string {}
/**
* Strip whitespace (or other characters) from the beginning of a string
* @link https://php.net/manual/en/function.ltrim.php
* @param string $string <p>
* The input string.
* </p>
* @param string $characters [optional] <p>
* You can also specify the characters you want to strip, by means of the
* charlist parameter.
* Simply list all characters that you want to be stripped. With
* .. you can specify a range of characters.
* </p>
* @return string This function returns a string with whitespace stripped from the
* beginning of str.
* Without the second parameter,
* ltrim will strip these characters:
* " " (ASCII 32
* (0x20)), an ordinary space.
* "\t" (ASCII 9
* (0x09)), a tab.
* "\n" (ASCII 10
* (0x0A)), a new line (line feed).
* "\r" (ASCII 13
* (0x0D)), a carriage return.
* "\0" (ASCII 0
* (0x00)), the NUL-byte.
* "\x0B" (ASCII 11
* (0x0B)), a vertical tab.
*/
#[Pure]
function ltrim(string $string, string $characters = " \n\r\t\v\0"): string {}
/**
* Strip HTML and PHP tags from a string
* @link https://php.net/manual/en/function.strip-tags.php
* @param string $string <p>
* The input string.
* </p>
* @param string[]|string|null $allowed_tags [optional] <p>
* You can use the optional second parameter to specify tags which should
* not be stripped.
* </p>
* <p>
* HTML comments and PHP tags are also stripped. This is hardcoded and
* can not be changed with allowable_tags.
* </p>
* @return string the stripped string.
*/
#[Pure]
function strip_tags(string $string, #[LanguageLevelTypeAware(["7.4" => "string[]|string|null"], default: "string|null")] $allowed_tags = null): string {}
/**
* Calculate the similarity between two strings
* @link https://php.net/manual/en/function.similar-text.php
* @param string $string1 <p>
* The first string.
* </p>
* @param string $string2 <p>
* The second string.
* </p>
* @param float &$percent [optional] <p>
* By passing a reference as third argument,
* similar_text will calculate the similarity in
* percent for you.
* </p>
* @return int the number of matching chars in both strings.
*/
function similar_text(string $string1, string $string2, &$percent): int {}
/**
* Split a string by a string
* @link https://php.net/manual/en/function.explode.php
* @param string $separator <p>
* The boundary string.
* </p>
* @param string $string <p>
* The input string.
* </p>
* @param int $limit [optional] <p>
* If limit is set and positive, the returned array will contain
* a maximum of limit elements with the last
* element containing the rest of string.
* </p>
* <p>
* If the limit parameter is negative, all components
* except the last -limit are returned.
* </p>
* <p>
* If the limit parameter is zero, then this is treated as 1.
* </p>
* @return string[]|false If delimiter is an empty string (""),
* explode will return false.
* If delimiter contains a value that is not
* contained in string and a negative
* limit is used, then an empty array will be
* returned. For any other limit, an array containing
* string will be returned.
*/
#[Pure]
#[LanguageLevelTypeAware(["8.0" => "string[]"], default: "string[]|false")]