3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = tempnam('.', 'test'); $fh = fopen($file, 'w+'); fwrite($fh, '[first_section] one = 1 five = 5 animal = BIRD [second_section] path = "/usr/local/bin" URL = "http://www.example.com/~username" [third_section] phpversion[0] = "5.0" phpversion[1] = "5.1" phpversion[2] = "5.2" phpversion[3] = "5.3" '); fclose($fh); // Parse with sections $ini_array = parse_ini_file($file, true); print_r($ini_array);
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: tempnam(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/dRX2l on line 3 Fatal error: Uncaught ValueError: Path cannot be empty in /in/dRX2l:4 Stack trace: #0 /in/dRX2l(4): fopen('', 'w+') #1 {main} thrown in /in/dRX2l on line 4
Process exited with code 255.
Output for 7.1.0 - 7.1.10, 7.2.0, 7.4.33, 8.0.13
Notice: tempnam(): file created in the system's temporary directory in /in/dRX2l on line 3 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( [phpversion] => Array ( [0] => 5.0 [1] => 5.1 [2] => 5.2 [3] => 5.3 ) ) )
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.32
Warning: tempnam(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/dRX2l on line 3 Warning: fopen(): Filename cannot be empty in /in/dRX2l on line 4 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/dRX2l on line 6 Warning: fclose() expects parameter 1 to be resource, bool given in /in/dRX2l on line 21 Warning: parse_ini_file(): Filename cannot be empty! in /in/dRX2l on line 24
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.3.32 - 7.3.33
Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( [phpversion] => Array ( [0] => 5.0 [1] => 5.1 [2] => 5.2 [3] => 5.3 ) ) )
Output for 7.2.29 - 7.2.33
Warning: tempnam(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in:/etc) in /in/dRX2l on line 3 Warning: fopen(): Filename cannot be empty in /in/dRX2l on line 4 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/dRX2l on line 6 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/dRX2l on line 21 Warning: parse_ini_file(): Filename cannot be empty! in /in/dRX2l on line 24
Output for 7.1.20, 7.2.6 - 7.2.8
Warning: tempnam(): open_basedir restriction in effect. File(.) is not within the allowed path(s): (/tmp:/in) in /in/dRX2l on line 3 Warning: fopen(): Filename cannot be empty in /in/dRX2l on line 4 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/dRX2l on line 6 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/dRX2l on line 21 Warning: parse_ini_file(): Filename cannot be empty! in /in/dRX2l on line 24
Output for 5.2.17
Warning: Error parsing /tmp/testHib7eZ on line 12 in /in/dRX2l on line 24
Output for 5.2.16
Warning: Error parsing /tmp/test4ERpr0 on line 12 in /in/dRX2l on line 24
Output for 5.2.15
Warning: Error parsing /tmp/testlMZ0P3 on line 12 in /in/dRX2l on line 24
Output for 5.2.14
Warning: Error parsing /tmp/test5xz8i9 on line 12 in /in/dRX2l on line 24
Output for 5.2.13
Warning: Error parsing /tmp/testrUxRIb on line 12 in /in/dRX2l on line 24
Output for 5.2.12
Warning: Error parsing /tmp/testVgBB3c on line 12 in /in/dRX2l on line 24
Output for 5.2.11
Warning: Error parsing /tmp/test0hjNMg on line 12 in /in/dRX2l on line 24
Output for 5.2.10
Warning: Error parsing /tmp/testRHnd4i on line 12 in /in/dRX2l on line 24
Output for 5.2.9
Warning: Error parsing /tmp/testT2vKto on line 12 in /in/dRX2l on line 24
Output for 5.2.8
Warning: Error parsing /tmp/testKyry0r on line 12 in /in/dRX2l on line 24
Output for 5.2.7
Warning: Error parsing /tmp/testFlC4nu on line 12 in /in/dRX2l on line 24
Output for 5.2.6
Warning: Error parsing /tmp/testJOlS1n on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.5
Warning: Error parsing /tmp/testh9aNGr on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.4
Warning: Error parsing /tmp/test5rURZt on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.3
Warning: Error parsing /tmp/testFmxv3u on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.2
Warning: Error parsing /tmp/testIEKWby on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.1
Warning: Error parsing /tmp/testV8SCsA on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.2.0
Warning: Error parsing /tmp/testaUPbrG on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.6
Warning: Error parsing /tmp/testoJXuvJ on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.5
Warning: Error parsing /tmp/testOHqU8J on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.4
Warning: Error parsing /tmp/testyXxDJM on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.3
Warning: Error parsing /tmp/testIHCgyP on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.2
Warning: Error parsing /tmp/test3rky3R on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.1
Warning: Error parsing /tmp/testEEbSvY on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.1.0
Warning: Error parsing /tmp/testdjWWw1 on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.5
Warning: Error parsing /tmp/testkKm0g2 on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.4
Warning: Error parsing /tmp/testWAu114 on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.3
Warning: Error parsing /tmp/testiNC627 on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.2
Warning: Error parsing /tmp/test8ECeca on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.1
Warning: Error parsing /tmp/testdpfHQc on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 5.0.0
Warning: Error parsing /tmp/testK00N5e on line 12 in /in/dRX2l on line 24 Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( ) [0] => Array ( ) )
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
Array ( [first_section] => Array ( [one] => 1 [five] => 5 [animal] => BIRD ) [second_section] => Array ( [path] => /usr/local/bin [URL] => http://www.example.com/~username ) [third_section] => Array ( [phpversion[0]] => 5.0 [phpversion[1]] => 5.1 [phpversion[2]] => 5.2 [phpversion[3]] => 5.3 ) )

preferences:
234.33 ms | 402 KiB | 314 Q