3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Created by PhpStorm. * User: Tobias Cervin * Date: 2017-10-02 */ session_start(); require_once 'Key.php'; if(isset($_POST['email']) && isset($_POST['key'])){ $email = $_POST['email']; $filename = 'subscriptions.txt'; if (!empty($email)){ if(Key::isValid($_POST['key'])){ //If key is valid it takes email from the form and writes it to the existing or created file 'subscriptions.txt' file_put_contents($filename, $email + '\n', FILE_APPEND | LOCK_EX); echo 'You have been added as a subscripteee!'; } else{ echo 'You little fraud, get out of here!!!'; } } else{ echo 'Wrong email input...'; } } ?> <!DOCTYPE html> <html> <head> <title>The Awesome Mail Spamming Subscription!</title> </head> <body> <form action="" method="post"> <div class="subscribe"> <strong>Please Subscribe!</strong> <div class="field"> eMail: <input type="email" name="email"> </div> <input type="submit" value="subscribed"> <input type="hidden" name="key" value="<?php echo Key::generate(); ?>"> </div> </form> </body> </html>
Output for 7.2.11, 7.3.0rc3
Warning: require_once(): open_basedir restriction in effect. File(Key.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/0j8MI on line 9 Warning: require_once(Key.php): failed to open stream: Operation not permitted in /in/0j8MI on line 9 Fatal error: require_once(): Failed opening required 'Key.php' (include_path='.:') in /in/0j8MI on line 9
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.10, 7.3.0alpha1 - 7.3.0beta1
Warning: require_once(Key.php): failed to open stream: No such file or directory in /in/0j8MI on line 9 Fatal error: require_once(): Failed opening required 'Key.php' (include_path='.:') in /in/0j8MI on line 9
Process exited with code 255.
Output for 7.1.20 - 7.2.6
Warning: require_once(): open_basedir restriction in effect. File(Key.php) is not within the allowed path(s): (/tmp:/in) in /in/0j8MI on line 9 Warning: require_once(Key.php): failed to open stream: Operation not permitted in /in/0j8MI on line 9 Fatal error: require_once(): Failed opening required 'Key.php' (include_path='.:') in /in/0j8MI on line 9
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: require_once(Key.php): File not found in /in/0j8MI:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: require_once(Key.php): File not found in /in/0j8MI:9 Stack trace: #0 {main}
Process exited with code 255.