3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(php_uname('s')); @mkdir(sys_get_temp_dir() . '/src', 0700); preg_match_all('/\`\`\`php(.*?)\`\`\`/s', file_get_contents('https://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 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/EOGM2 on line 6 Warning: file_get_contents(https://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/EOGM2 on line 6 Notice: Undefined offset: 0 in /in/EOGM2 on line 7 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/EOGM2:13 Stack trace: #0 {main} thrown in /in/EOGM2 on line 13
Process exited with code 255.
Output for 7.0.4
string(5) "Linux" Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/EOGM2 on line 6 Warning: file_get_contents(https://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/EOGM2 on line 6 Notice: Undefined offset: 0 in /in/EOGM2 on line 7 Fatal error: Uncaught Error: Class 'Foo\Bar\Baz' not found in /in/EOGM2:13 Stack trace: #0 {main} thrown in /in/EOGM2 on line 13
Process exited with code 255.
Output for 5.5.24 - 5.5.32, 5.5.34 - 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/EOGM2 on line 6 Warning: file_get_contents(https://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/EOGM2 on line 6 Notice: Undefined offset: 0 in /in/EOGM2 on line 7 Fatal error: Class 'Foo\Bar\Baz' not found in /in/EOGM2 on line 13
Process exited with code 255.
Output for 5.4.15 - 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/EOGM2 on line 6 Warning: file_get_contents(https://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/EOGM2 on line 6 Notice: Undefined offset: 0 in /in/EOGM2 on line 7 Fatal error: Class 'Foo\Bar\Baz' not found in /in/EOGM2 on line 13
Process exited with code 255.
Output for 5.3.0 - 5.4.14
string(5) "Linux" Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/EOGM2 on line 6 Warning: file_get_contents(https://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md): failed to open stream: No such file or directory in /in/EOGM2 on line 6 Notice: Undefined offset: 0 in /in/EOGM2 on line 7 Fatal error: Class 'Foo\Bar\Baz' not found in /in/EOGM2 on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EOGM2 on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EOGM2 on line 13 Parse error: syntax error, unexpected T_STRING in /in/EOGM2 on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EOGM2 on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EOGM2 on line 13 Parse error: parse error, unexpected T_STRING in /in/EOGM2 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/EOGM2 on line 13 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EOGM2 on line 13 Parse error: parse error in /in/EOGM2 on line 13
Process exited with code 255.