Проверяю
trim([])
под
php7
PHP Warning: trim() expects parameter 1 to be string, array given in C:\MyPrograms\Open Server\tests\phptest.php on line 6
Warning: trim() expects parameter 1 to be string, array given in C:\MyPrograms\Open Server\tests\phptest.php on line 6
php8
PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in C:\MyPrograms\Open Server\tests\phptest.php:6
Stack trace:
#0 C:\MyPrograms\Open Server\tests\phptest.php(6): trim(Array)
#1 {main}
thrown in C:\MyPrograms\Open Server\tests\phptest.php on line 6
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in C:\MyPrograms\Open Server\tests\phptest.php:6
Stack trace:
#0 C:\MyPrograms\Open Server\tests\phptest.php(6): trim(Array)
#1 {main}
thrown in C:\MyPrograms\Open Server\tests\phptest.php on line 6