3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ini_set('opcache.enable', true); $file = __DIR__.'/file.txt'; file_put_contents($file, '<?php return 1;'); $var = include $file; file_put_contents($file, '<?php return 2;'); $var = include $file; var_dump($var);
Output for 5.6.28, 7.0.14 - 7.2.6
Warning: Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in /in/pjnin on line 3 Warning: file_put_contents(/in/file.txt): failed to open stream: Permission denied in /in/pjnin on line 6 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(/in/file.txt): failed to open stream: Permission denied in /in/pjnin on line 8 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 5.5.24 - 5.5.28, 5.5.35 - 5.6.12, 5.6.21, 7.0.6
Warning: Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in /in/pjnin on line 3 Warning: file_put_contents(/in/file.txt): failed to open stream: Read-only file system in /in/pjnin on line 6 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(/in/file.txt): failed to open stream: Read-only file system in /in/pjnin on line 8 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 5.4.40 - 5.4.45, 5.5.29 - 5.5.34, 5.6.13 - 5.6.20, 7.0.0 - 7.0.5
Warning: file_put_contents(/in/file.txt): failed to open stream: Read-only file system in /in/pjnin on line 6 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(/in/file.txt): failed to open stream: Read-only file system in /in/pjnin on line 8 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 5.3.0 - 5.4.39
Warning: file_put_contents(/in/file.txt): failed to open stream: Permission denied in /in/pjnin on line 6 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(/in/file.txt): failed to open stream: Permission denied in /in/pjnin on line 8 Warning: include(/in/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: include(): Failed opening '/in/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 5.1.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/pjnin on line 5 Warning: file_put_contents(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 6 Warning: include(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: include(): Failed opening '__DIR__/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 8 Warning: include(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: include(): Failed opening '__DIR__/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 5.0.0 - 5.0.5
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/pjnin on line 5 Warning: file_put_contents(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 6 Warning: main(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 7 Warning: main(): Failed opening '__DIR__/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 7 Warning: file_put_contents(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 8 Warning: main(__DIR__/file.txt): failed to open stream: No such file or directory in /in/pjnin on line 9 Warning: main(): Failed opening '__DIR__/file.txt' for inclusion (include_path='.:') in /in/pjnin on line 9 bool(false)
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/pjnin on line 5 Fatal error: Call to undefined function: file_put_contents() in /in/pjnin on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/pjnin on line 5 Fatal error: Call to undefined function: file_put_contents() in /in/pjnin on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/pjnin on line 5 Fatal error: Call to undefined function: file_put_contents() in /in/pjnin on line 6