xref: /PHP-8.0/ext/mysqli/mysqli.stub.php (revision ceb0951f)
1<?php
2
3/** @generate-function-entries */
4
5final class mysqli_driver
6{
7}
8
9class mysqli
10{
11    public function __construct(
12        ?string $hostname = null,
13        ?string $username = null,
14        ?string $password = null,
15        ?string $database = null,
16        ?int $port = null,
17        ?string $socket = null
18    ) {}
19
20    /**
21     * @return bool
22     * @alias mysqli_autocommit
23     */
24    public function autocommit(bool $enable) {}
25
26    /**
27     * @return bool
28     * @alias mysqli_begin_transaction
29     */
30    public function begin_transaction(int $flags = 0, ?string $name = null) {}
31
32    /**
33     * @return bool
34     * @alias mysqli_change_user
35     */
36    public function change_user(string $username, string $password, ?string $database) {}
37
38    /**
39     * @return string
40     * @alias mysqli_character_set_name
41     */
42    public function character_set_name() {}
43
44    /**
45     * @return bool
46     * @alias mysqli_close
47     */
48    public function close() {}
49
50    /**
51     * @return bool
52     * @alias mysqli_commit
53     */
54    public function commit(int $flags = 0, ?string $name = null) {}
55
56    /**
57     * @return bool|null
58     * @alias mysqli_connect
59     * @no-verify
60     */
61    public function connect(
62        ?string $hostname = null,
63        ?string $username = null,
64        ?string $password = null,
65        ?string $database = null,
66        ?int $port = null,
67        ?string $socket = null
68    ) {}
69
70    /**
71     * @return bool
72     * @alias mysqli_dump_debug_info
73     */
74    public function dump_debug_info() {}
75
76    /**
77     * @return bool
78     * @alias mysqli_debug
79     * @no-verify Should really be a static method
80     */
81    public function debug(string $options) {}
82
83    /**
84     * @return object|null
85     * @alias mysqli_get_charset
86     */
87    public function get_charset() {}
88
89    /**
90     * @return string
91     * @alias mysqli_get_client_info
92     */
93    public function get_client_info() {}
94
95#if defined(MYSQLI_USE_MYSQLND)
96    /**
97     * @return array
98     * @alias mysqli_get_connection_stats
99     */
100    public function get_connection_stats() {}
101#endif
102
103    /**
104     * @return string
105     * @alias mysqli_get_server_info
106     */
107    public function get_server_info() {}
108
109    /**
110     * @return mysqli_warning|false
111     * @alias mysqli_get_warnings
112     */
113    public function get_warnings() {}
114
115    /**
116     * @return null|false
117     */
118    public function init() {}
119
120    /**
121     * @return bool
122     * @alias mysqli_kill
123     */
124    public function kill(int $process_id) {}
125
126    /**
127     * @return bool
128     * @alias mysqli_multi_query
129     */
130    public function multi_query(string $query) {}
131
132    /**
133     * @return bool
134     * @alias mysqli_more_results
135     */
136    public function more_results() {}
137
138    /**
139     * @return bool
140     * @alias mysqli_next_result
141     */
142    public function next_result() {}
143
144    /**
145     * @return bool
146     * @alias mysqli_ping
147     */
148    public function ping() {}
149
150#if defined(MYSQLI_USE_MYSQLND)
151    /**
152     * @return int|false
153     * @alias mysqli_poll
154     */
155    public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0) {}
156#endif
157
158    /**
159     * @return mysqli_stmt|false
160     * @alias mysqli_prepare
161     */
162    public function prepare(string $query) {}
163
164    /**
165     * @return mysqli_result|bool
166     * @alias mysqli_query
167     */
168    public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT) {}
169
170    /**
171     * @return bool
172     * @alias mysqli_real_connect
173     */
174    public function real_connect(
175        ?string $hostname = null,
176        ?string $username = null,
177        ?string $password = null,
178        ?string $database = null,
179        ?int $port = null,
180        ?string $socket = null,
181        int $flags = 0
182    ) {}
183
184    /**
185     * @return string
186     * @alias mysqli_real_escape_string
187     */
188    public function real_escape_string(string $string) {}
189
190#if defined(MYSQLI_USE_MYSQLND)
191    /**
192     * @return mysqli_result|bool
193     * @alias mysqli_reap_async_query
194     */
195    public function reap_async_query() {}
196#endif
197
198    /**
199     * @return string
200     * @alias mysqli_real_escape_string
201     */
202    public function escape_string(string $string) {}
203
204    /**
205     * @return bool
206     * @alias mysqli_real_query
207     */
208    public function real_query(string $query) {}
209
210    /**
211     * @return bool
212     * @alias mysqli_release_savepoint
213     */
214    public function release_savepoint(string $name) {}
215
216    /**
217     * @return bool
218     * @alias mysqli_rollback
219     */
220    public function rollback(int $flags = 0, ?string $name = null) {}
221
222    /**
223     * @return bool
224     * @alias mysqli_savepoint
225     */
226    public function savepoint(string $name) {}
227
228    /**
229     * @return bool
230     * @alias mysqli_select_db
231     */
232    public function select_db(string $database) {}
233
234    /**
235     * @return bool
236     * @alias mysqli_set_charset
237     */
238    public function set_charset(string $charset) {}
239
240    /**
241     * @param string|int $value
242     * @return bool
243     * @alias mysqli_options
244     */
245    public function options(int $option, $value) {}
246
247    /**
248     * @param string|int $value
249     * @return bool
250     * @alias mysqli_options
251     */
252    public function set_opt(int $option, $value) {}
253
254    /**
255     * @return bool
256     * @alias mysqli_ssl_set
257     */
258    public function ssl_set(
259        ?string $key,
260        ?string $certificate,
261        ?string $ca_certificate,
262        ?string $ca_path,
263        ?string $cipher_algos
264    ) {}
265
266    /**
267     * @return string|false
268     * @alias mysqli_stat
269     */
270    public function stat() {}
271
272    /**
273     * @return mysqli_stmt|false
274     * @alias mysqli_stmt_init
275     */
276    public function stmt_init() {}
277
278    /**
279     * @return mysqli_result|false
280     * @alias mysqli_store_result
281     */
282    public function store_result(int $mode = 0) {}
283
284    /**
285     * @return bool
286     * @alias mysqli_thread_safe
287     */
288    public function thread_safe() {}
289
290    /**
291     * @return mysqli_result|false
292     * @alias mysqli_use_result
293     */
294    public function use_result() {}
295
296    /**
297     * @return bool
298     * @alias mysqli_refresh
299     */
300    public function refresh(int $flags) {}
301}
302
303class mysqli_result implements IteratorAggregate
304{
305    public function __construct(mysqli $mysql, int $result_mode = MYSQLI_STORE_RESULT) {}
306
307    /**
308     * @return void
309     * @alias mysqli_free_result
310     */
311    public function close() {}
312
313    /**
314     * @return void
315     * @alias mysqli_free_result
316     */
317    public function free() {}
318
319    /**
320     * @return bool
321     * @alias mysqli_data_seek
322     */
323    public function data_seek(int $offset) {}
324
325    /**
326     * @return object|false
327     * @alias mysqli_fetch_field
328     */
329    public function fetch_field() {}
330
331    /**
332     * @return array
333     * @alias mysqli_fetch_fields
334     */
335    public function fetch_fields() {}
336
337    /**
338     * @return object|false
339     * @alias mysqli_fetch_field_direct
340     */
341    public function fetch_field_direct(int $index) {}
342
343#if defined(MYSQLI_USE_MYSQLND)
344    /**
345     * @return array
346     * @alias mysqli_fetch_all
347     */
348    public function fetch_all(int $mode = MYSQLI_NUM) {}
349#endif
350
351    /**
352     * @return array|null|false
353     * @alias mysqli_fetch_array
354     */
355    public function fetch_array(int $mode = MYSQLI_BOTH) {}
356
357    /**
358     * @return array|null|false
359     * @alias mysqli_fetch_assoc
360     */
361    public function fetch_assoc() {}
362
363    /**
364     * @return object|null|false
365     * @alias mysqli_fetch_object
366     */
367    public function fetch_object(string $class = "stdClass", array $constructor_args = []) {}
368
369    /**
370     * @return array|null|false
371     * @alias mysqli_fetch_row
372     */
373    public function fetch_row() {}
374
375    /**
376     * @return bool
377     * @alias mysqli_field_seek
378     */
379    public function field_seek(int $index) {}
380
381    /**
382     * @return void
383     * @alias mysqli_free_result
384     */
385    public function free_result() {}
386
387    public function getIterator(): Iterator;
388}
389
390class mysqli_stmt
391{
392    public function __construct(mysqli $mysql, ?string $query = null) {}
393
394    /**
395     * @return int
396     * @alias mysqli_stmt_attr_get
397     */
398    public function attr_get(int $attribute) {}
399
400    /**
401     * @return bool
402     * @alias mysqli_stmt_attr_set
403     */
404    public function attr_set(int $attribute, int $value) {}
405
406    /**
407     * @return bool
408     * @alias mysqli_stmt_bind_param
409     */
410    public function bind_param(string $types, mixed &...$vars) {}
411
412    /**
413     * @return bool
414     * @alias mysqli_stmt_bind_result
415     */
416    public function bind_result(mixed &...$vars) {}
417
418    /**
419     * @return bool
420     * @alias mysqli_stmt_close
421     */
422    public function close() {}
423
424    /**
425     * @return void
426     * @alias mysqli_stmt_data_seek
427     */
428    public function data_seek(int $offset) {}
429
430    /**
431     * @return bool
432     * @alias mysqli_stmt_execute
433     */
434    public function execute() {}
435
436    /**
437     * @return bool|null
438     * @alias mysqli_stmt_fetch
439     */
440    public function fetch() {}
441
442    /**
443     * @return mysqli_warning|false
444     * @alias mysqli_stmt_get_warnings
445     */
446    public function get_warnings() {}
447
448    /**
449     * @return mysqli_result|false
450     * @alias mysqli_stmt_result_metadata
451     */
452    public function result_metadata() {}
453
454#if defined(MYSQLI_USE_MYSQLND)
455    /**
456     * @return bool
457     * @alias mysqli_stmt_more_results
458     */
459    public function more_results() {}
460
461    /**
462     * @return bool
463     * @alias mysqli_stmt_next_result
464     */
465    public function next_result() {}
466#endif
467
468    /**
469     * @return int|string
470     * @alias mysqli_stmt_num_rows
471     */
472    public function num_rows() {}
473
474    /**
475     * @return bool
476     * @alias mysqli_stmt_send_long_data
477     */
478    public function send_long_data(int $param_num, string $data) {}
479
480    /**
481     * @return void
482     * @alias mysqli_stmt_free_result
483     */
484    public function free_result() {}
485
486    /**
487     * @return bool
488     * @alias mysqli_stmt_reset
489     */
490    public function reset() {}
491
492    /**
493     * @return bool
494     * @alias mysqli_stmt_prepare
495     */
496    public function prepare(string $query) {}
497
498    /**
499     * @return bool
500     * @alias mysqli_stmt_store_result
501     */
502    public function store_result() {}
503
504#if defined(MYSQLI_USE_MYSQLND)
505    /**
506     * @return mysqli_result|false
507     * @alias mysqli_stmt_get_result
508     */
509    public function get_result() {}
510#endif
511}
512
513final class mysqli_warning
514{
515    private function __construct() {}
516
517    public function next(): bool {}
518}
519
520final class mysqli_sql_exception extends RuntimeException
521{
522}
523
524function mysqli_affected_rows(mysqli $mysql): int|string {}
525
526function mysqli_autocommit(mysqli $mysql, bool $enable): bool {}
527
528function mysqli_begin_transaction(mysqli $mysql, int $flags = 0, ?string $name = null): bool {}
529
530function mysqli_change_user(mysqli $mysql, string $username, string $password, ?string $database): bool {}
531
532function mysqli_character_set_name(mysqli $mysql): string {}
533
534function mysqli_close(mysqli $mysql): bool {}
535
536function mysqli_commit(mysqli $mysql, int $flags = 0, ?string $name = null): bool {}
537
538function mysqli_connect(
539    ?string $hostname = null,
540    ?string $username = null,
541    ?string $password = null,
542    ?string $database = null,
543    ?int $port = null,
544    ?string $socket = null
545): mysqli|false {}
546
547function mysqli_connect_errno(): int {}
548
549function mysqli_connect_error(): ?string {}
550
551function mysqli_data_seek(mysqli_result $result, int $offset): bool {}
552
553function mysqli_dump_debug_info(mysqli $mysql): bool {}
554
555function mysqli_debug(string $options): bool {}
556
557function mysqli_errno(mysqli $mysql): int {}
558
559function mysqli_error(mysqli $mysql): string {}
560
561function mysqli_error_list(mysqli $mysql): array {}
562
563function mysqli_stmt_execute(mysqli_stmt $statement): bool {}
564
565/** @alias mysqli_stmt_execute */
566function mysqli_execute(mysqli_stmt $statement): bool {}
567
568function mysqli_fetch_field(mysqli_result $result): object|false {}
569
570function mysqli_fetch_fields(mysqli_result $result): array {}
571
572function mysqli_fetch_field_direct(mysqli_result $result, int $index): object|false {}
573
574function mysqli_fetch_lengths(mysqli_result $result): array|false {}
575
576#if defined(MYSQLI_USE_MYSQLND)
577function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array {}
578#endif
579
580function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array|null|false {}
581
582function mysqli_fetch_assoc(mysqli_result $result): array|null|false {}
583
584function mysqli_fetch_object(mysqli_result $result, string $class = "stdClass", array $constructor_args = []): object|null|false {}
585
586function mysqli_fetch_row(mysqli_result $result): array|null|false {}
587
588function mysqli_field_count(mysqli $mysql): int {}
589
590function mysqli_field_seek(mysqli_result $result, int $index): bool {}
591
592function mysqli_field_tell(mysqli_result $result): int {}
593
594function mysqli_free_result(mysqli_result $result): void {}
595
596#if defined(MYSQLI_USE_MYSQLND)
597function mysqli_get_connection_stats(mysqli $mysql): array {}
598
599function mysqli_get_client_stats(): array {}
600#endif
601
602function mysqli_get_charset(mysqli $mysql): ?object {}
603
604function mysqli_get_client_info(?mysqli $mysql = null): string {}
605
606function mysqli_get_client_version(): int {}
607
608function mysqli_get_links_stats(): array {}
609
610function mysqli_get_host_info(mysqli $mysql): string {}
611
612function mysqli_get_proto_info(mysqli $mysql): int {}
613
614function mysqli_get_server_info(mysqli $mysql): string {}
615
616function mysqli_get_server_version(mysqli $mysql): int {}
617
618function mysqli_get_warnings(mysqli $mysql): mysqli_warning|false {}
619
620function mysqli_init(): mysqli|false {}
621
622function mysqli_info(mysqli $mysql): ?string {}
623
624function mysqli_insert_id(mysqli $mysql): int|string {}
625
626function mysqli_kill(mysqli $mysql, int $process_id): bool {}
627
628function mysqli_more_results(mysqli $mysql): bool {}
629
630function mysqli_multi_query(mysqli $mysql, string $query): bool {}
631
632function mysqli_next_result(mysqli $mysql): bool {}
633
634function mysqli_num_fields(mysqli_result $result): int {}
635
636function mysqli_num_rows(mysqli_result $result): int|string {}
637
638/** @param string|int $value */
639function mysqli_options(mysqli $mysql, int $option, $value): bool {}
640
641/**
642 * @param string|int $value
643 * @alias mysqli_options
644 */
645function mysqli_set_opt(mysqli $mysql, int $option, $value): bool {}
646
647function mysqli_ping(mysqli $mysql): bool {}
648
649#if defined(MYSQLI_USE_MYSQLND)
650function mysqli_poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {}
651#endif
652
653function mysqli_prepare(mysqli $mysql, string $query): mysqli_stmt|false {}
654
655function mysqli_report(int $flags): bool {}
656
657function mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {}
658
659function mysqli_real_connect(
660    mysqli $mysql,
661    ?string $hostname = null,
662    ?string $username = null,
663    ?string $password = null,
664    ?string $database = null,
665    ?int $port = null,
666    ?string $socket = null,
667    int $flags = 0
668): bool {}
669
670function mysqli_real_escape_string(mysqli $mysql, string $string): string {}
671
672/** @alias mysqli_real_escape_string */
673function mysqli_escape_string(mysqli $mysql, string $string): string {}
674
675function mysqli_real_query(mysqli $mysql, string $query): bool {}
676
677#if defined(MYSQLI_USE_MYSQLND)
678function mysqli_reap_async_query(mysqli $mysql): mysqli_result|bool {}
679#endif
680
681function mysqli_release_savepoint(mysqli $mysql, string $name): bool {}
682
683function mysqli_rollback(mysqli $mysql, int $flags = 0, ?string $name = null): bool {}
684
685function mysqli_savepoint(mysqli $mysql, string $name): bool {}
686
687function mysqli_select_db(mysqli $mysql, string $database): bool {}
688
689function mysqli_set_charset(mysqli $mysql, string $charset): bool {}
690
691function mysqli_stmt_affected_rows(mysqli_stmt $statement): int|string {}
692
693function mysqli_stmt_attr_get(mysqli_stmt $statement, int $attribute): int {}
694
695function mysqli_stmt_attr_set(mysqli_stmt $statement, int $attribute, int $value): bool {}
696
697function mysqli_stmt_bind_param(mysqli_stmt $statement, string $types, mixed &...$vars): bool {}
698
699function mysqli_stmt_bind_result(mysqli_stmt $statement, mixed &...$vars): bool {}
700
701function mysqli_stmt_close(mysqli_stmt $statement): bool {}
702
703function mysqli_stmt_data_seek(mysqli_stmt $statement, int $offset): void {}
704
705function mysqli_stmt_errno(mysqli_stmt $statement): int {}
706
707function mysqli_stmt_error(mysqli_stmt $statement): string {}
708
709function mysqli_stmt_error_list(mysqli_stmt $statement): array {}
710
711function mysqli_stmt_fetch(mysqli_stmt $statement): ?bool {}
712
713function mysqli_stmt_field_count(mysqli_stmt $statement): int {}
714
715function mysqli_stmt_free_result(mysqli_stmt $statement): void {}
716
717#if defined(MYSQLI_USE_MYSQLND)
718function mysqli_stmt_get_result(mysqli_stmt $statement): mysqli_result|false {}
719#endif
720
721function mysqli_stmt_get_warnings(mysqli_stmt $statement): mysqli_warning|false {}
722
723function mysqli_stmt_init(mysqli $mysql): mysqli_stmt|false {}
724
725function mysqli_stmt_insert_id(mysqli_stmt $statement): int|string {}
726
727#if defined(MYSQLI_USE_MYSQLND)
728function mysqli_stmt_more_results(mysqli_stmt $statement): bool {}
729
730function mysqli_stmt_next_result(mysqli_stmt $statement): bool {}
731#endif
732
733function mysqli_stmt_num_rows(mysqli_stmt $statement): int|string {}
734
735function mysqli_stmt_param_count(mysqli_stmt $statement): int {}
736
737function mysqli_stmt_prepare(mysqli_stmt $statement, string $query): bool {}
738
739function mysqli_stmt_reset(mysqli_stmt $statement): bool {}
740
741function mysqli_stmt_result_metadata(mysqli_stmt $statement): mysqli_result|false {}
742
743function mysqli_stmt_send_long_data(mysqli_stmt $statement, int $param_num, string $data): bool {}
744
745function mysqli_stmt_store_result(mysqli_stmt $statement): bool {}
746
747function mysqli_stmt_sqlstate(mysqli_stmt $statement): string {}
748
749function mysqli_sqlstate(mysqli $mysql): string {}
750
751function mysqli_ssl_set(
752    mysqli $mysql,
753    ?string $key,
754    ?string $certificate,
755    ?string $ca_certificate,
756    ?string $ca_path,
757    ?string $cipher_algos
758): bool {}
759
760function mysqli_stat(mysqli $mysql): string|false {}
761
762function mysqli_store_result(mysqli $mysql, int $mode = 0): mysqli_result|false {}
763
764function mysqli_thread_id(mysqli $mysql): int {}
765
766function mysqli_thread_safe(): bool {}
767
768function mysqli_use_result(mysqli $mysql): mysqli_result|false {}
769
770function mysqli_warning_count(mysqli $mysql): int {}
771
772function mysqli_refresh(mysqli $mysql, int $flags): bool {}
773