3v4l.org

run code in 300+ PHP versions simultaneously
<?php // no separator $dir = '/tmp/'; ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n"); // with separator $dir = dirname(PHP_BINARY); ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n"); // with separator $dir = '/tmp/'.PATH_SEPARATOR.dirname(PHP_BINARY); ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); $fp = fopen('/tmp/hhvm-openbasedir-test', 'w'); if ($fp) { print("Opened!\n"); fclose($fb); } else print("Failed to open\n");
Output for git.master_jit, git.master, rfc.property-hooks
ini_set to /tmp/ Opened! Warning: Undefined variable $fb in /in/7DmQe on line 10 Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given in /in/7DmQe:10 Stack trace: #0 /in/7DmQe(10): fclose(NULL) #1 {main} thrown in /in/7DmQe on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.85 ms | 401 KiB | 8 Q