3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "ryat\hi"; //var_dump($str); //$str = addslashes($str); //var_dump($str); file_put_contents('/tmp/ryat', addslashes($str)); var_dump(stripslashes(file_get_contents('/tmp/ryat')));
Output for 5.0.0 - 5.4.45, 5.5.30 - 5.5.34, 5.6.7, 5.6.14 - 5.6.19, 5.6.28 - 7.0.3, 7.0.14 - 7.1.0
string(7) "ryat\hi"
Output for 5.5.24 - 5.5.29, 5.5.35, 5.6.8 - 5.6.13, 5.6.20 - 5.6.21, 7.0.4 - 7.0.6
Warning: file_put_contents(/tmp/ryat): failed to open stream: Is a directory in /in/EZuaV on line 7 string(0) ""
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: file_put_contents() in /in/EZuaV on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: file_put_contents() in /in/EZuaV on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: file_put_contents() in /in/EZuaV on line 7