3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['submit_booking'])){ $file="bookings.csv"; if(!file_exists($file)){ file_put_contents($file,"Date,Trip,Flying From,Going To,Departure,Passengers,Name,Email,Phone\n"); } $data=[ date("Y-m-d H:i"), $_POST['trip'], $_POST['from'], $_POST['to'], $_POST['date'], $_POST['passengers'], $_POST['name'], $_POST['email'], $_POST['phone'] ]; $f=fopen($file,"a"); fputcsv($f,$data); fclose($f); $msg="Booking Submitted!"; } ?> <!DOCTYPE html> <html> <head> <style> body{ font-family:Arial; background:#e9f8ff; } .box{ width:900px; margin:50px auto; background:#cfefff; padding:40px; border-radius:25px; } .row{ display:flex; gap:20px; margin-bottom:15px; } input,select{ width:100%; padding:12px; border-radius:8px; border:0; } button{ background:#1e2a6b; color:white; border:none; padding:15px 40px; border-radius:30px; font-size:16px; cursor:pointer; } .center{text-align:center;} .trip label{ border:2px solid #2f79ff; padding:6px 20px; border-radius:6px; margin-right:10px; } </style> </head> <body> <div class="box"> <?php if(isset($msg)) echo "<p style='color:green'>$msg</p>"; ?> <form method="post"> <div class="trip"> <label><input type="radio" name="trip" value="One Way" checked> One Way</label> <label><input type="radio" name="trip" value="Return"> Return</label> </div> <br> <div class="row"> <input name="from" placeholder="Flying From" required> <input name="to" placeholder="Going To" required> </div> <div class="row"> <input type="date" name="date" required> <select name="passengers"> <option>1</option> <option>2</option> <option>3</option> <option>4+</option> </select> <input name="name" placeholder="Full Name" required> </div> <div class="row"> <input type="email" name="email" placeholder="Email" required> <input name="phone" placeholder="Phone"> </div> <br> <div class="center"> <button name="submit_booking">BOOK NOW</button> </div> </form> </div> </body> </html> <?php if(isset($_POST['submit_booking'])){ $file="bookings.csv"; if(!file_exists($file)){ file_put_contents($file,"Date,Trip,Flying From,Going To,Departure,Passengers,Name,Email,Phone\n"); } $data=[ date("Y-m-d H:i"), $_POST['trip'], $_POST['from'], $_POST['to'], $_POST['date'], $_POST['passengers'], $_POST['name'], $_POST['email'], $_POST['phone'] ]; $f=fopen($file,"a"); fputcsv($f,$data); fclose($f); $msg="Booking Submitted!"; } ?> <!DOCTYPE html> <html> <head> <style> body{ font-family:Arial; background:#e9f8ff; } .box{ width:900px; margin:50px auto; background:#cfefff; padding:40px; border-radius:25px; } .row{ display:flex; gap:20px; margin-bottom:15px; } input,select{ width:100%; padding:12px; border-radius:8px; border:0; } button{ background:#1e2a6b; color:white; border:none; padding:15px 40px; border-radius:30px; font-size:16px; cursor:pointer; } .center{text-align:center;} .trip label{ border:2px solid #2f79ff; padding:6px 20px; border-radius:6px; margin-right:10px; } </style> </head> <body> <div class="box"> <?php if(isset($msg)) echo "<p style='color:green'>$msg</p>"; ?> <form method="post"> <div class="trip"> <label><input type="radio" name="trip" value="One Way" checked> One Way</label> <label><input type="radio" name="trip" value="Return"> Return</label> </div> <br> <div class="row"> <input name="from" placeholder="Flying From" required> <input name="to" placeholder="Going To" required> </div> <div class="row"> <input type="date" name="date" required> <select name="passengers"> <option>1</option> <option>2</option> <option>3</option> <option>4+</option> </select> <input name="name" placeholder="Full Name" required> </div> <div class="row"> <input type="email" name="email" placeholder="Email" required> <input name="phone" placeholder="Phone"> </div> <br> <div class="center"> <button name="submit_booking">BOOK NOW</button> </div> </form> </div> </body> </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.30.0120.00519.21
8.5.20.0390.00516.79
8.5.10.0340.00816.59
8.5.00.0370.01116.70
8.4.180.0110.01319.59
8.4.170.0400.01119.64
8.4.160.0350.01419.47
8.4.150.0360.01419.54
8.4.140.0370.00717.40
8.4.130.0370.00717.58
8.4.120.0400.01217.53
8.4.110.0380.01117.70
8.4.100.0390.00817.66
8.4.90.0380.01517.70
8.4.80.0420.00717.66
8.4.70.0350.01017.64
8.4.60.0390.00817.54
8.4.50.0390.00717.70
8.4.40.0440.00817.53
8.4.30.0150.00917.71
8.4.20.0390.01017.51
8.4.10.0390.01217.35
8.3.300.0320.00918.26
8.3.290.0290.01218.36
8.3.280.0340.00818.21
8.3.270.0400.00716.48
8.3.260.0440.00916.61
8.3.250.0350.01116.77
8.3.240.0380.00816.63
8.3.230.0340.01116.75
8.3.220.0400.00516.47
8.3.210.0380.00716.65
8.3.200.0400.00416.61
8.3.190.0440.00916.21
8.3.180.0410.00816.59
8.3.170.0370.01216.52
8.3.160.0380.00716.25
8.3.150.0380.01016.37
8.3.140.0410.00616.29
8.3.130.0320.00716.41
8.3.120.0320.00916.67
8.3.110.0300.00516.45
8.3.100.0180.00516.68
8.3.90.0210.00516.53
8.3.80.0280.00916.61
8.3.70.0370.01016.62
8.3.60.0400.00916.50
8.3.50.0390.00716.47
8.3.40.0370.01017.76
8.3.30.0260.01017.92
8.3.20.0300.00917.85
8.3.10.0270.00917.97
8.3.00.0280.00817.71

preferences:
46.22 ms | 886 KiB | 5 Q