3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents(sys_get_temp_dir() . "/test", "test"); echo file_get_contents(sys_get_temp_dir() . "/test");
Output for 5.2.1 - 5.2.17, 5.3.0 - 5.3.23, 5.3.25 - 5.3.29, 5.4.0 - 5.4.6, 5.4.8 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25, 7.4.33, 8.0.0 - 8.0.14, 8.0.17 - 8.0.20, 8.0.30, 8.1.13 - 8.1.14, 8.1.21 - 8.1.28, 8.2.8 - 8.2.18, 8.3.0 - 8.3.6
test
Output for 8.0.29, 8.1.17 - 8.1.20, 8.2.4 - 8.2.7
Warning: file_put_contents(/tmp/test): Failed to open stream: Is a directory in /in/JPRfV on line 3 Warning: file_get_contents(/tmp/test): Failed to open stream: Permission denied in /in/JPRfV on line 4
Output for 8.2.1 - 8.2.3
Warning: file_put_contents(/tmp/test): Failed to open stream: Is a directory in /in/JPRfV on line 3 Notice: file_get_contents(): Read of 8232 bytes failed with errno=21 Is a directory in /in/JPRfV on line 4
Output for 8.2.0
Warning: file_put_contents(/tmp/test): Failed to open stream: Is a directory in /in/JPRfV on line 3 Notice: file_get_contents(): Read of 8252 bytes failed with errno=21 Is a directory in /in/JPRfV on line 4
Output for 8.0.15 - 8.0.16, 8.0.21 - 8.0.28, 8.1.0 - 8.1.12, 8.1.15 - 8.1.16
Warning: file_put_contents(/tmp/test): Failed to open stream: Is a directory in /in/JPRfV on line 3 Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /in/JPRfV on line 4
Output for 7.4.27 - 7.4.32
Warning: file_put_contents(/tmp/test): failed to open stream: Is a directory in /in/JPRfV on line 3 Notice: file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory in /in/JPRfV on line 4
Output for 7.4.26
Warning: file_put_contents(/tmp/test): failed to open stream: Is a directory in /in/JPRfV on line 3
Output for 5.4.7
Output for 5.3.24
Warning: file_get_contents(/tmp/test): failed to open stream: No such file or directory in /in/JPRfV on line 4
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function sys_get_temp_dir() in /in/JPRfV on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: file_put_contents() in /in/JPRfV on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: file_put_contents() in /in/JPRfV on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: file_put_contents() in /in/JPRfV on line 3

preferences:
306.58 ms | 401 KiB | 424 Q