@@ -9,13 +9,12 @@ require_once('skipifconnectfailure.inc');
9
9
--FILE--
10
10
<?php
11
11
require_once ("connect.inc " );
12
- set_error_handler ('handle_catchable_fatal ' );
13
12
14
13
$ mysqli = new mysqli ();
15
14
try {
16
15
new mysqli_result ($ mysqli );
17
- } catch (Error $ exception ) {
18
- echo $ exception ->getMessage () . "\n" ;
16
+ } catch (Throwable $ e ) {
17
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
19
18
}
20
19
21
20
require ('table.inc ' );
@@ -30,16 +29,16 @@ require_once('skipifconnectfailure.inc');
30
29
try {
31
30
if (!is_null ($ tmp = @$ res ->fetch_object ($ link , $ link )))
32
31
printf ("[005] Expecting NULL, got %s/%s \n" , gettype ($ tmp ), $ tmp );
33
- } catch (Error $ e ) {
34
- handle_catchable_fatal ( $ e -> getCode (), $ e -> getMessage () , $ e ->getFile (), $ e -> getLine ()) ;
32
+ } catch (Throwable $ e ) {
33
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
35
34
}
36
35
37
36
38
37
try {
39
38
if (!is_null ($ tmp = @$ res ->fetch_object ($ link , $ link , $ link )))
40
39
printf ("[006] Expecting NULL, got %s/%s \n" , gettype ($ tmp ), $ tmp );
41
- } catch (Error $ e ) {
42
- handle_catchable_fatal ( $ e -> getCode (), $ e -> getMessage () , $ e ->getFile (), $ e -> getLine ()) ;
40
+ } catch (Throwable $ e ) {
41
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
43
42
}
44
43
45
44
$ obj = mysqli_fetch_object ($ res );
@@ -76,8 +75,8 @@ require_once('skipifconnectfailure.inc');
76
75
77
76
try {
78
77
$ res ->fetch_object ('mysqli_fetch_object_construct ' , null );
79
- } catch (TypeError $ exception ) {
80
- echo $ exception ->getMessage () . "\n" ;
78
+ } catch (Throwable $ e ) {
79
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
81
80
mysqli_fetch_object ($ res );
82
81
}
83
82
@@ -88,7 +87,7 @@ require_once('skipifconnectfailure.inc');
88
87
var_dump ($ obj );
89
88
}
90
89
} catch (Throwable $ e ) {
91
- echo " Exception: " . $ e ->getMessage () . "\n" ;
90
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
92
91
}
93
92
94
93
$ obj = $ res ->fetch_object ('mysqli_fetch_object_construct ' , array ('a ' , 'b ' ));
@@ -110,14 +109,14 @@ require_once('skipifconnectfailure.inc');
110
109
111
110
try {
112
111
mysqli_fetch_object ($ res );
113
- } catch (Error $ exception ) {
114
- echo $ exception ->getMessage () . "\n" ;
112
+ } catch (Throwable $ e ) {
113
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
115
114
}
116
115
117
116
try {
118
117
var_dump ($ res ->fetch_object ('this_class_does_not_exist ' ));
119
- } catch (TypeError $ exception ) {
120
- echo $ exception ->getMessage () . "\n" ;
118
+ } catch (Throwable $ e ) {
119
+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
121
120
}
122
121
123
122
$ mysqli ->close ();
@@ -127,14 +126,14 @@ require_once('skipifconnectfailure.inc');
127
126
<?php
128
127
require_once ("clean_table.inc " );
129
128
?>
130
- --EXPECTF --
131
- mysqli object is not fully initialized
132
- [0] Object of class mysqli could not be converted to string in %s on line %d
133
- [0] mysqli_result::fetch_object() expects at most 2 arguments, 3 given in %s on line %d
134
- mysqli_result::fetch_object(): Argument #2 ($constructor_args) must be of type array, null given
135
- Exception : Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected
129
+ --EXPECT --
130
+ Error: mysqli object is not fully initialized
131
+ Error: Object of class mysqli could not be converted to string
132
+ ArgumentCountError: mysqli_result::fetch_object() expects at most 2 arguments, 3 given
133
+ TypeError: mysqli_result::fetch_object(): Argument #2 ($constructor_args) must be of type array, null given
134
+ ArgumentCountError : Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected
136
135
NULL
137
136
NULL
138
- mysqli_result object is already closed
139
- mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, this_class_does_not_exist given
137
+ Error: mysqli_result object is already closed
138
+ TypeError: mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, this_class_does_not_exist given
140
139
done!
0 commit comments