php-src/Zend/tests/strlen_deprecation_to_exception.phpt
Nikita Popov 353f963bba Init STRLEN result when deprecation promoted to exception
Move the result initialization before HANDLE_EXCEPTION(), the
actual value doesn't matter.

This fixes one of the issues report in bug #81190.
2021-07-01 16:22:27 +02:00

18 lines
332 B
PHP

--TEST--
strlen() null deprecation warning promoted to exception
--FILE--
<?php
set_error_handler(function($_, $msg) {
throw new Exception($msg);
});
try {
strlen(null);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
strlen(): Passing null to parameter #1 ($string) of type string is deprecated