3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dir = '/'.PATH_SEPARATOR.dirname(PHP_BINARY); ini_set('open_basedir', $dir); print("ini_set to ".$dir."\n"); var_dump(file_put_contents('/tmp/hhvm-openbasedir-test', 'some data'));
based on IcDaB
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
ini_set to /:/usr/bin int(9)
Output for 5.0.0 - 5.3.29
Notice: Use of undefined constant PHP_BINARY - assumed 'PHP_BINARY' in /in/lOe02 on line 3 ini_set to /:. int(9)
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant PHP_BINARY - assumed 'PHP_BINARY' in /in/lOe02 on line 3 ini_set to /:. Fatal error: Call to undefined function: file_put_contents() in /in/lOe02 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Use of undefined constant PHP_BINARY - assumed 'PHP_BINARY' in /in/lOe02 on line 3 ini_set to /:. Fatal error: Call to undefined function: file_put_contents() in /in/lOe02 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_BINARY - assumed 'PHP_BINARY' in /in/lOe02 on line 3 ini_set to /:. Fatal error: Call to undefined function: file_put_contents() in /in/lOe02 on line 9