3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_ALL,'C'); $utfchar = chr(0xC3).chr(0x89); // U+009C in UTF-8 $csv = $utfchar."x".$utfchar."x\n"; file_put_contents('test.csv', $csv); $file = fopen('test.csv', 'r'); $data = fgetcsv($file); for ($i = 0; $i < strlen($data[0]); $i++) { echo dechex(ord($data[0][$i])).' '; } echo "\n"; unlink('test.csv'); // expected: c3 89 78 c3 89 78 - "ÉxÉx" // actual: 78 c3 89 78 - "xÉx"
Output for git.master, git.master_jit
Warning: file_put_contents(): open_basedir restriction in effect. File(test.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Jhpkh on line 8 Warning: file_put_contents(test.csv): Failed to open stream: Operation not permitted in /in/Jhpkh on line 8 Warning: fopen(): open_basedir restriction in effect. File(test.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Jhpkh on line 9 Warning: fopen(test.csv): Failed to open stream: Operation not permitted in /in/Jhpkh on line 9 Fatal error: Uncaught TypeError: fgetcsv(): Argument #1 ($stream) must be of type resource, bool given in /in/Jhpkh:10 Stack trace: #0 /in/Jhpkh(10): fgetcsv(false) #1 {main} thrown in /in/Jhpkh on line 10
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_put_contents(): open_basedir restriction in effect. File(test.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Jhpkh on line 8 Warning: file_put_contents(test.csv): Failed to open stream: Operation not permitted in /in/Jhpkh on line 8 Warning: fopen(): open_basedir restriction in effect. File(test.csv) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Jhpkh on line 9 Warning: fopen(test.csv): Failed to open stream: Operation not permitted in /in/Jhpkh on line 9 Fatal error: Uncaught TypeError: fgetcsv(): Argument #1 ($stream) must be of type resource, false given in /in/Jhpkh:10 Stack trace: #0 /in/Jhpkh(10): fgetcsv(false) #1 {main} thrown in /in/Jhpkh on line 10
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:
44.23 ms | 401 KiB | 8 Q