3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents("test.txt", "Hello, world!"); $handle = fopen("test.txt", "r"); $contents = stream_get_contents($handle); echo "Contents A = {$contents}\n"; $contents = stream_get_contents($handle); echo "Contents B = {$contents}\n"; fclose($handle);
Output for git.master, git.master_jit
Warning: file_put_contents(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gHkPG on line 3 Warning: file_put_contents(test.txt): Failed to open stream: Operation not permitted in /in/gHkPG on line 3 Warning: fopen(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gHkPG on line 5 Warning: fopen(test.txt): Failed to open stream: Operation not permitted in /in/gHkPG on line 5 Fatal error: Uncaught TypeError: stream_get_contents(): Argument #1 ($stream) must be of type resource, bool given in /in/gHkPG:6 Stack trace: #0 /in/gHkPG(6): stream_get_contents(false) #1 {main} thrown in /in/gHkPG on line 6
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_put_contents(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gHkPG on line 3 Warning: file_put_contents(test.txt): Failed to open stream: Operation not permitted in /in/gHkPG on line 3 Warning: fopen(): open_basedir restriction in effect. File(test.txt) is not within the allowed path(s): (/tmp:/in:/etc) in /in/gHkPG on line 5 Warning: fopen(test.txt): Failed to open stream: Operation not permitted in /in/gHkPG on line 5 Fatal error: Uncaught TypeError: stream_get_contents(): Argument #1 ($stream) must be of type resource, false given in /in/gHkPG:6 Stack trace: #0 /in/gHkPG(6): stream_get_contents(false) #1 {main} thrown in /in/gHkPG on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.1 ms | 401 KiB | 8 Q