3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fileClass = tmpfile(); $url = 'https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php'; try{ file_put_contents($fileClass, file_get_contents($url)) ; require $fileClass; } catch(Exception $e){ die('could not load lybrary because '. $e->getMessage()); }
Output for 5.6.30, 7.0.0 - 7.2.9, 7.3.0rc3
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/N6536 on line 5 Warning: file_get_contents(): open_basedir restriction in effect. File(https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/N6536 on line 5 Warning: file_get_contents(https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php): failed to open stream: Operation not permitted in /in/N6536 on line 5 Warning: file_put_contents() expects parameter 1 to be a valid path, resource given in /in/N6536 on line 5 Warning: require(): open_basedir restriction in effect. File(Resource id #4) is not within the allowed path(s): (/tmp:/in:/etc) in /in/N6536 on line 6 Warning: require(Resource id #4): failed to open stream: Operation not permitted in /in/N6536 on line 6 Fatal error: require(): Failed opening required 'Resource id #4' (include_path='.:') in /in/N6536 on line 6
Process exited with code 255.
Output for 7.3.0alpha1 - 7.3.0beta2
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/N6536 on line 5 Warning: file_get_contents(https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php): failed to open stream: No such file or directory in /in/N6536 on line 5 Warning: file_put_contents() expects parameter 1 to be a valid path, resource given in /in/N6536 on line 5 Warning: require(Resource id #4): failed to open stream: No such file or directory in /in/N6536 on line 6 Fatal error: require(): Failed opening required 'Resource id #4' (include_path='.:') in /in/N6536 on line 6
Process exited with code 255.
Output for hhvm-3.22.0
Warning: Failed to open https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php (Could not resolve host: raw.githubusercontent.com) in /in/N6536 on line -1 Warning: file_put_contents() expects parameter 1 to be string, resource given in /in/N6536 on line -1 Fatal error: Uncaught Error: require(Resource id #4): File not found in /in/N6536:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Warning: Failed to open https://raw.githubusercontent.com/colshrapnel/safemysql/master/safemysql.class.php (Could not resolve host: raw.githubusercontent.com) in /in/N6536 on line 5 Warning: file_put_contents() expects parameter 1 to be string, resource given in /in/N6536 on line 5 Fatal error: Uncaught Error: require(Resource id #4): File not found in /in/N6536:6 Stack trace: #0 {main}
Process exited with code 255.