php-src/ext/mysqli/tests/mysqli_driver/write_property_strict.phpt
George Peter Banyard 6a4031b8c4
ext/mysqli: Work on making tests parallizable (#11814)
Batch 1 of amending tests, so they can run in parallel.

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2023-09-29 18:57:30 +01:00

27 lines
518 B
PHP

--TEST--
Writing to mysqli_driver properties (strict_types)
--EXTENSIONS--
mysqli
--FILE--
<?php
declare(strict_types=1);
$driver = new mysqli_driver;
try {
/* Read-only property */
$driver->client_info = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$driver->report_mode = "1";
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot write read-only property mysqli_driver::$client_info
Cannot assign string to property mysqli_driver::$report_mode of type int