strlen_deprecation_to_exception.phpt 332 B

1234567891011121314151617
  1. --TEST--
  2. strlen() null deprecation warning promoted to exception
  3. --FILE--
  4. <?php
  5. set_error_handler(function($_, $msg) {
  6. throw new Exception($msg);
  7. });
  8. try {
  9. strlen(null);
  10. } catch (Exception $e) {
  11. echo $e->getMessage(), "\n";
  12. }
  13. ?>
  14. --EXPECT--
  15. strlen(): Passing null to parameter #1 ($string) of type string is deprecated