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 git.master, git.master_jit, rfc.property-hooks
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.

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:
60.34 ms | 401 KiB | 8 Q