<?php
set_error_handler(function($ErrLevel, $ErrMessage) {
if ($ErrLevel == E_RECOVERABLE_ERROR)
// order this according to what your app uses most
return strpos($ErrMessage, 'must be an instance of string, string')
|| strpos($ErrMessage, 'must be an instance of integer, integer')
|| strpos($ErrMessage, 'must be an instance of float, double')
|| strpos($ErrMessage, 'must be an instance of boolean, boolean')
|| strpos($ErrMessage, 'must be an instance of resource, resource');
});
function miauw(string $string) {
echo 'de catchable error wordt onderdrukt wanneer $string een string is';
}
miauw(2);