3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
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: Uncaught Error: Failed opening required 'Key.php' (include_path='.:') in /in/0j8MI:9 Stack trace: #0 {main} thrown in /in/0j8MI on line 9
Process exited with code 255.
Output for 8.0.13
Warning: require_once(Key.php): Failed to open stream: No such file or directory in /in/0j8MI on line 9 Fatal error: Uncaught Error: Failed opening required 'Key.php' (include_path='.:') in /in/0j8MI:9 Stack trace: #0 {main} thrown in /in/0j8MI on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.24, 7.1.0 - 7.1.10, 7.3.32 - 7.3.33, 7.4.33
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.2.11 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32
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 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.

preferences:
148.6 ms | 401 KiB | 175 Q