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.14
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.30, 8.2.9 - 8.2.25
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:
58.57 ms | 408 KiB | 5 Q