@@ -9,13 +9,12 @@ require_once('skipifconnectfailure.inc');
99--FILE--
1010<?php
1111 require_once ("connect.inc " );
12- set_error_handler ('handle_catchable_fatal ' );
1312
1413 $ mysqli = new mysqli ();
1514 try {
1615 new mysqli_result ($ mysqli );
17- } catch (Error $ exception ) {
18- echo $ exception ->getMessage () . "\n" ;
16+ } catch (Throwable $ e ) {
17+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
1918 }
2019
2120 require ('table.inc ' );
@@ -30,16 +29,16 @@ require_once('skipifconnectfailure.inc');
3029 try {
3130 if (!is_null ($ tmp = @$ res ->fetch_object ($ link , $ link )))
3231 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" ;
3534 }
3635
3736
3837 try {
3938 if (!is_null ($ tmp = @$ res ->fetch_object ($ link , $ link , $ link )))
4039 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" ;
4342 }
4443
4544 $ obj = mysqli_fetch_object ($ res );
@@ -76,8 +75,8 @@ require_once('skipifconnectfailure.inc');
7675
7776 try {
7877 $ 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" ;
8180 mysqli_fetch_object ($ res );
8281 }
8382
@@ -88,7 +87,7 @@ require_once('skipifconnectfailure.inc');
8887 var_dump ($ obj );
8988 }
9089 } catch (Throwable $ e ) {
91- echo " Exception: " . $ e ->getMessage () . "\n" ;
90+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
9291 }
9392
9493 $ obj = $ res ->fetch_object ('mysqli_fetch_object_construct ' , array ('a ' , 'b ' ));
@@ -110,14 +109,14 @@ require_once('skipifconnectfailure.inc');
110109
111110 try {
112111 mysqli_fetch_object ($ res );
113- } catch (Error $ exception ) {
114- echo $ exception ->getMessage () . "\n" ;
112+ } catch (Throwable $ e ) {
113+ echo $ e ::class, ' : ' , $ e ->getMessage (), "\n" ;
115114 }
116115
117116 try {
118117 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" ;
121120 }
122121
123122 $ mysqli ->close ();
@@ -127,14 +126,14 @@ require_once('skipifconnectfailure.inc');
127126<?php
128127 require_once ("clean_table.inc " );
129128?>
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
136135NULL
137136NULL
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
140139done!
0 commit comments