3v4l.org

run code in 300+ PHP versions simultaneously
<?php fputs(STDOUT, 'hey dude'); echo $basename = trim(fgets(STDOUT)); //I expect $basename to be "hey dude" but it aint
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
hey dude Notice: fgets(): Read of 8192 bytes failed with errno=9 Bad file descriptor in /in/3eDlO on line 4
Output for 7.4.0 - 7.4.33
hey dude Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in /in/3eDlO on line 4
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
hey dude

preferences:
254.06 ms | 403 KiB | 293 Q