3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function example($foo) { print trim($foo); } // Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given. example(false);
Output for 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, false given in /in/nBel1:7 Stack trace: #0 /in/nBel1(7): trim(false) #1 /in/nBel1(11): example(false) #2 {main} thrown in /in/nBel1 on line 7
Process exited with code 255.
Output for 8.1.22 - 8.1.28, 8.2.9 - 8.2.19
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in /in/nBel1:7 Stack trace: #0 /in/nBel1(7): trim(false) #1 /in/nBel1(11): example(false) #2 {main} thrown in /in/nBel1 on line 7
Process exited with code 255.

preferences:
39.56 ms | 402 KiB | 31 Q