3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(php_uname('s')); @mkdir(sys_get_temp_dir() . '/src', 0700); preg_match_all('/\`\`\`php(.*?)\`\`\`/s', file_get_contents('http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md'), $m); file_put_contents(sys_get_temp_dir() . '/autoloader.php', $m[1][0]); file_put_contents(sys_get_temp_dir() . '/src/Baz.php', "<?php namespace Foo\Bar; class BAZ {}"); file_put_contents(sys_get_temp_dir() . '/src/Buz.php', "<?php namespace Foo\Bar; class Buz {}"); require sys_get_temp_dir() . '/autoloader.php'; $c1 = new \Foo\Bar\Baz(); $c2 = new \Foo\Bar\BAZ(); var_dump($c1 == $c2); $c3 = new \Foo\Bar\BUZ(); $c4 = new \Foo\Bar\Buz(); var_dump($c3 == $c4);
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for raw.github.com failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): Failed to open stream: php_network_getaddresses: getaddrinfo for raw.github.com failed: System error in /in/KubLK on line 6 Warning: Undefined array key 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class "Foo\Bar\Baz" not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 8.3.5
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for raw.github.com failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): Failed to open stream: php_network_getaddresses: getaddrinfo for raw.github.com failed: System error in /in/KubLK on line 6 Warning: Undefined array key 0 in /in/KubLK on line 7 Warning: file_put_contents(/tmp/src/Baz.php): Failed to open stream: No such file or directory in /in/KubLK on line 8 Warning: file_put_contents(/tmp/src/Buz.php): Failed to open stream: No such file or directory in /in/KubLK on line 9 Fatal error: Uncaught Error: Class "Foo\Bar\Baz" not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 8.0.13 - 8.0.30
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Warning: Undefined array key 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class "Foo\Bar\Baz" not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 8.0.0 - 8.0.12
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): Failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Warning: Undefined array key 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class "Foo\Bar\Baz" not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 7.0.4, 7.0.20, 7.1.5 - 7.1.20, 7.2.0 - 7.2.6, 7.3.12, 7.4.0, 7.4.27 - 7.4.33
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.14, 7.4.16 - 7.4.25
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 7.4.15
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Warning: file_put_contents(/tmp/src/Buz.php): failed to open stream: No such file or directory in /in/KubLK on line 9 Warning: require(/tmp/autoloader.php): failed to open stream: No such file or directory in /in/KubLK on line 11 Fatal error: require(): Failed opening required '/tmp/autoloader.php' (include_path='.:') in /in/KubLK on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.0.14, 7.1.0
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/KubLK:13 Stack trace: #0 {main} thrown in /in/KubLK on line 13
Process exited with code 255.
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.5.35, 5.6.8 - 5.6.17, 5.6.20 - 5.6.28
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Fatal error: Class 'Foo\Bar\Baz' not found in /in/KubLK on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Warning: file_get_contents(http://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/KubLK on line 6 Notice: Undefined offset: 0 in /in/KubLK on line 7 Fatal error: Class 'Foo\Bar\Baz' not found in /in/KubLK on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Parse error: syntax error, unexpected T_STRING in /in/KubLK on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Parse error: parse error, unexpected T_STRING in /in/KubLK on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/KubLK on line 13 Parse error: parse error in /in/KubLK on line 13
Process exited with code 255.

preferences:
223.14 ms | 402 KiB | 315 Q