3v4l.org

run code in 300+ PHP versions simultaneously
<style type="text/css"> .calculator_table { font-size:12px; font-family:Century Gothic; border:2pt solid #000000; background-color:#6BB3FF padding:25px; width:300px; } </style> <?php if(!empty($_POST['calculator_ok'])): //last cycle date $date="$_POST[dateyear]-$_POST[datemonth]-$_POST[dateday]"; //convert to time $lasttime=mktime(0,0,0,$_POST['datemonth'],$_POST['dateday'],$_POST['dateyear']); // next period start $next_period=$lasttime + $_POST['days']*24*3600; $next_period=date("F d, Y",$next_period); //first fertile day $firstdaytime=$lasttime + $_POST['days']*24*3600 - 16*24*3600; $firstday=date("F d, Y",$firstdaytime); //last fertile day $lastdaytime=$lasttime + $_POST['days']*24*3600 - 12*24*3600; $lastday=date("F d, Y",$lastdaytime); //have to adjust due date? $diff=$_POST['days'] - 28; //due date $date + 280 days $duedatetime=$lasttime + 280*24*3600 + $diff*24*3600; $duedate=date("F d, Y",$duedatetime); ?> <div class="calculator_table"> <p>Here are the results based on the information you provided:</p> <p>Your next <b>menstrual period</b> is expected to start on <strong><?php echo $next_period?></strong>.</p> <p>You next <b>most fertile</b> period is <strong><?php echo $firstday?> to <?php echo $lastday?></strong>.</p> <p>If you conceive within this timeframe, your estimated <b>due date</b> will be <strong><?php echo $duedate?></strong>.</p> <p align="center"><input type="button" value="Calculate again!" onclick="window.location='http://<?php echo $_SERVER['HTTP_HOST'];?><?php echo $_SERVER['REQUEST_URI']?>'"></p> </div> <?php else: //the calculator comes here ?> <div class="calculator_table"> <form method="post"> <p>Please select the first day of your last menstrual period:</p> <p><?php echo date_chooser("date",date("Y-m-d"))?></p> <p>Usual number of days in your period: <select name="days"> <?php for($i=20;$i<=45;$i++) { if($i==28) $selected='selected="true"'; else $selected=''; echo "<option $selected value='$i'>$i</option>"; } ?> </select></p> <p align="center"><input type="submit" name="calculator_ok" value="Calculate"></p> </form> </div> <?php endif; //to print a date chooser - get name and value in mysql date format function date_chooser($name,$value="") { $months=array('','January','February','March','April','May','June','July','August', 'September','October','November','December'); if(empty($value)) $value=date("Y-m-d"); $parts=explode("-",$value); $day=$parts[2]+0; $month=$parts[1]+0; $year=$parts[0]; $chooser=""; $chooser.="<select name='".$name."month'>"; for($i=1;$i<=12;$i++) { if($i==$month) $selected='selected="true"'; else $selected=''; $chooser.="<option $selected value='$i'>$months[$i]</option>"; } $chooser.="</select> / "; $chooser.="<select name='".$name."day'>"; for($i=1;$i<=31;$i++) { if($i==$day) $selected='selected'; else $selected=''; $chooser.="<option $selected value='$i'>$i</option>"; } $chooser.="</select> / "; $chooser.="<select name='".$name."year'>"; for($i=(date("Y")-1);$i<=2050;$i++) { if($i==$year) $selected='selected'; else $selected=''; $chooser.="<option $selected>$i</option>"; } $chooser.="</select> "; return $chooser; } ?>

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.3.70.0110.00416.63
8.3.60.0110.00718.55
8.3.50.0100.01022.17
8.3.40.0090.00618.93
8.3.30.0060.01019.23
8.3.20.0030.00518.85
8.3.10.0090.00021.27
8.3.00.0040.00423.31
8.2.180.0130.00916.63
8.2.170.0180.00322.96
8.2.160.0150.00620.47
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00721.00
8.2.110.0030.00620.66
8.2.100.0080.00418.16
8.2.90.0080.00019.53
8.2.80.0020.00519.34
8.2.70.0030.00617.75
8.2.60.0040.00418.30
8.2.50.0040.00418.07
8.2.40.0030.00518.34
8.2.30.0040.00419.58
8.2.20.0000.00817.97
8.2.10.0080.00018.04
8.2.00.0000.00818.05
8.1.280.0060.01625.92
8.1.270.0000.00723.99
8.1.260.0030.00726.35
8.1.250.0000.00728.09
8.1.240.0000.00923.97
8.1.230.0070.00421.08
8.1.220.0040.00418.77
8.1.210.0080.00019.09
8.1.200.0030.00617.50
8.1.190.0080.00017.66
8.1.180.0000.00918.10
8.1.170.0090.00018.80
8.1.160.0040.00419.00
8.1.150.0030.00618.84
8.1.140.0040.00417.68
8.1.130.0000.00718.03
8.1.120.0030.00517.71
8.1.110.0000.00817.60
8.1.100.0000.00817.52
8.1.90.0070.00317.60
8.1.80.0070.00017.68
8.1.70.0030.00317.61
8.1.60.0040.00417.63
8.1.50.0030.00517.52
8.1.40.0030.00517.66
8.1.30.0030.00617.73
8.1.20.0000.00817.83
8.1.10.0000.00817.77
8.1.00.0000.00717.73
8.0.300.0040.00420.16
8.0.290.0000.00917.30
8.0.280.0040.00418.64
8.0.270.0070.00017.29
8.0.260.0000.00717.45
8.0.250.0080.00017.16
8.0.240.0060.00317.24
8.0.230.0040.00417.18
8.0.220.0000.00717.02
8.0.210.0040.00317.16
8.0.200.0000.00817.08
8.0.190.0000.00717.21
8.0.180.0000.00717.06
8.0.170.0000.00817.14
8.0.160.0040.00417.18
8.0.150.0040.00417.05
8.0.140.0000.00817.11
8.0.130.0000.00613.51
8.0.120.0040.00417.05
8.0.110.0000.00817.17
8.0.100.0000.00717.07
8.0.90.0040.00416.99
8.0.80.0060.01017.15
8.0.70.0080.00017.01
8.0.60.0000.00817.17
8.0.50.0000.00717.15
8.0.30.0060.01217.13
8.0.20.0110.01217.47
8.0.10.0040.00417.38
8.0.00.0070.01217.01
7.4.330.0030.00315.08
7.4.320.0030.00316.68
7.4.300.0000.00616.76
7.4.290.0040.00416.70
7.4.280.0030.00616.60
7.4.270.0040.00416.69
7.4.260.0060.00013.27
7.4.250.0050.00316.67
7.4.240.0000.00716.68
7.4.230.0000.00716.73
7.4.220.0140.01416.52
7.4.210.0060.01016.72
7.4.200.0030.00516.63
7.4.190.0070.00016.55
7.4.160.0130.01016.57
7.4.150.0140.00717.40
7.4.140.0090.01617.86
7.4.130.0080.01016.80
7.4.120.0110.00616.62
7.4.110.0100.00716.93
7.4.100.0120.00616.73
7.4.90.0030.01716.77
7.4.80.0110.00819.39
7.4.70.0090.01316.69
7.4.60.0040.01316.82
7.4.50.0050.00316.77
7.4.40.0070.00722.77
7.4.30.0120.00816.54
7.4.00.0060.00915.01
7.3.330.0030.00313.62
7.3.320.0030.00313.46
7.3.310.0020.00516.57
7.3.300.0040.00416.37
7.3.290.0160.00616.50
7.3.280.0050.01316.52
7.3.270.0110.00717.40
7.3.260.0100.01018.24
7.3.250.0080.01116.71
7.3.240.0100.00716.63
7.3.230.0060.01016.67
7.3.210.0040.01316.69
7.3.200.0090.00919.39
7.3.190.0100.01316.55
7.3.180.0150.00016.43
7.3.170.0030.01316.45
7.3.160.0040.01416.66
7.3.120.0070.00715.30
7.2.330.0070.01116.62
7.2.320.0090.00916.77
7.2.310.0150.00916.85
7.2.300.0060.01116.84
7.2.290.0000.01716.73
7.2.00.0040.00719.66
7.1.100.0000.00918.52
7.1.70.0030.00517.17
7.1.60.0070.00717.40
7.1.50.0100.01317.18
7.1.00.0000.03722.45
7.0.200.0130.00816.93
7.0.140.0070.06722.07
7.0.110.0330.04019.88
7.0.100.0470.05319.99
7.0.90.0170.07720.10
7.0.80.0430.06320.02
7.0.70.0200.03719.95
7.0.60.0170.03320.05
7.0.50.0170.03320.04
7.0.40.0000.06019.61
7.0.30.0000.05019.61
7.0.20.0000.04319.76
7.0.10.0130.06719.58
7.0.00.0070.03319.81
5.6.280.0130.06321.10
5.6.260.0070.06020.87
5.6.250.0070.04720.63
5.6.240.0030.04720.71
5.6.230.0000.05320.61
5.6.220.0100.03720.64
5.6.210.0000.04320.56
5.6.200.0030.04720.45
5.6.190.0070.04320.53
5.6.180.0030.05320.64
5.6.170.0000.04020.63
5.6.160.0100.03020.66
5.6.150.0070.04020.60
5.6.140.0000.06020.56
5.6.130.0070.05720.56
5.6.120.0200.08320.58
5.6.110.0170.06720.57
5.6.100.0030.08320.53
5.6.90.0000.08320.81
5.6.80.0170.06720.18
5.6.70.0000.08020.03
5.6.60.0070.05320.00
5.6.50.0030.08019.99
5.6.40.0100.05719.96
5.6.30.0100.07719.80
5.6.20.0100.07719.88
5.6.10.0100.07719.95
5.6.00.0070.06020.02
5.5.380.0030.06717.71
5.5.370.0030.03317.57
5.5.360.0030.04017.69
5.5.350.0000.04017.28
5.5.340.0000.08317.92
5.5.330.0030.07017.93
5.5.320.0000.04317.92
5.5.310.0070.03717.85
5.5.300.0100.03317.91
5.5.290.0030.04018.13
5.5.280.0070.06718.11
5.5.270.0000.08717.91
5.5.260.0130.07318.13
5.5.250.0070.08318.04
5.5.240.0030.05017.48
5.5.230.0130.07017.48
5.5.220.0100.07317.43
5.5.210.0030.08017.52
5.5.200.0130.07317.20
5.5.190.0230.06017.58
5.5.180.0030.08317.29
5.5.160.0070.07317.28
5.5.150.0130.07317.29
5.5.140.0230.06017.48
5.5.130.0170.06717.61
5.5.120.0130.06717.50
5.5.110.0070.07717.28
5.5.100.0130.06717.23
5.5.90.0030.08017.47
5.5.80.0030.08017.51
5.5.70.0130.07717.29
5.5.60.0100.08017.31
5.5.50.0130.05717.46
5.5.40.0100.08017.15
5.5.30.0100.06317.37
5.5.20.0070.07017.46
5.5.10.0000.08017.20
5.5.00.0000.05317.48
5.4.450.0030.05319.46
5.4.440.0030.08319.46
5.4.430.0170.07019.27
5.4.420.0170.06719.49
5.4.410.0130.06719.09
5.4.400.0200.06719.29
5.4.390.0030.06718.96
5.4.380.0130.07319.29
5.4.370.0100.07319.20
5.4.360.0200.06719.13
5.4.350.0170.07019.19
5.4.340.0030.07319.06
5.4.320.0130.07019.13
5.4.310.0030.05018.96
5.4.300.0130.05719.26
5.4.290.0070.07719.11
5.4.280.0030.05718.95
5.4.270.0130.07019.12
5.4.260.0130.06318.89
5.4.250.0030.04019.28
5.4.240.0100.05719.12
5.4.230.0130.07319.13
5.4.220.0030.08018.93
5.4.210.0070.07018.97
5.4.200.0030.07719.12
5.4.190.0100.07019.08
5.4.180.0070.06019.13
5.4.170.0070.07719.03
5.4.160.0030.07718.93
5.4.150.0000.09318.96
5.4.140.0130.06716.25
5.4.130.0070.07316.36
5.4.120.0030.06316.48
5.4.110.0030.05016.49
5.4.100.0100.06316.46
5.4.90.0030.07316.54
5.4.80.0030.06316.32
5.4.70.0100.06316.31
5.4.60.0030.03716.30
5.4.50.0030.06716.43
5.4.40.0000.07716.34
5.4.30.0070.07316.48
5.4.20.0070.06016.58
5.4.10.0130.06716.34
5.4.00.0030.06715.79
5.3.290.0170.07314.94
5.3.280.0170.06714.63
5.3.270.0100.07314.50
5.3.260.0030.05314.65
5.3.250.0030.08314.78
5.3.240.0100.08014.77
5.3.230.0130.05714.86
5.3.220.0100.06714.45
5.3.210.0030.07714.59
5.3.200.0030.07714.68
5.3.190.0100.07714.57
5.3.180.0070.06714.68
5.3.170.0100.07314.73
5.3.160.0100.03714.59
5.3.150.0030.04314.61
5.3.140.0000.08014.61
5.3.130.0130.05314.54
5.3.120.0070.05014.57
5.3.110.0070.07014.62
5.3.100.0000.07714.07
5.3.90.0100.05714.05
5.3.80.0070.03714.11
5.3.70.0030.07714.18
5.3.60.0100.06314.08
5.3.50.0070.07013.99
5.3.40.0130.07014.08
5.3.30.0070.07013.99
5.3.20.0130.07013.71
5.3.10.0030.07713.83
5.3.00.0070.07013.69
5.2.170.0030.05311.21
5.2.160.0000.04011.33
5.2.150.0000.06311.21
5.2.140.0100.05711.27
5.2.130.0070.06011.37
5.2.120.0100.04711.14
5.2.110.0130.04310.99
5.2.100.0070.05011.29
5.2.90.0070.06011.27
5.2.80.0070.06311.13
5.2.70.0070.05011.14
5.2.60.0000.03711.05
5.2.50.0030.05311.20
5.2.40.0130.05011.02
5.2.30.0070.05311.00
5.2.20.0130.05711.14
5.2.10.0130.04711.13
5.2.00.0030.06010.76
5.1.60.0130.02710.05
5.1.50.0000.06010.05
5.1.40.0070.05010.01
5.1.30.0030.06010.40
5.1.20.0100.05010.64
5.1.10.0130.04710.10
5.1.00.0030.05710.12
5.0.50.0000.0478.75
5.0.40.0070.0408.47
5.0.30.0070.0638.34
5.0.20.0070.0408.34
5.0.10.0000.0478.22
5.0.00.0000.0638.18
4.4.90.0030.0376.26
4.4.80.0030.0176.26
4.4.70.0070.0306.26
4.4.60.0100.0306.26
4.4.50.0000.0206.26
4.4.40.0070.0236.26
4.4.30.0070.0176.26
4.4.20.0030.0376.26
4.4.10.0070.0276.26
4.4.00.0070.0536.26
4.3.110.0030.0336.26
4.3.100.0070.0306.26
4.3.90.0030.0376.26
4.3.80.0000.0376.26
4.3.70.0070.0276.26
4.3.60.0030.0336.26
4.3.50.0070.0306.26
4.3.40.0070.0476.26
4.3.30.0000.0376.26
4.3.20.0000.0376.26
4.3.10.0000.0306.26
4.3.00.0000.0306.26

preferences:
37.14 ms | 401 KiB | 5 Q