3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* This calculator is your for free by Calendarscripts.info. You have no obligations for anything - you can modify, redistribute, sell it or whatever you want to do. We will appreciate if you don't remove the link at the bottom, but that's not required. */ /* Feel free to modify the CSS and the texts below. - no problem at all. Just don't touch the PHP code or the specual codes which are surrounded with %% unless you know what you are doing. */ /* Version 1.1 released on Nov 7, 2011*/ ?> <style type="text/css"> .calculator_table { font-size:11px; font-family:verdana, arial, sans-serif; border:2pt solid #4444FF; 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.60.0070.00718.39
8.3.50.0130.00721.21
8.3.40.0060.00919.09
8.3.30.0060.00920.17
8.3.20.0080.00020.20
8.3.10.0050.00321.96
8.3.00.0000.00822.46
8.2.180.0120.00316.75
8.2.170.0040.01122.96
8.2.160.0070.00720.60
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0120.00320.86
8.2.110.0060.00322.30
8.2.100.0060.00618.09
8.2.90.0040.00419.38
8.2.80.0040.00419.58
8.2.70.0040.00417.73
8.2.60.0080.00018.05
8.2.50.0090.00018.07
8.2.40.0000.00818.59
8.2.30.0000.00719.59
8.2.20.0040.00417.91
8.2.10.0050.00318.05
8.2.00.0030.00517.95
8.1.280.0120.00325.92
8.1.270.0060.00323.99
8.1.260.0090.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00323.82
8.1.230.0040.00719.18
8.1.220.0030.00517.90
8.1.210.0030.00618.77
8.1.200.0030.00617.60
8.1.190.0000.00817.66
8.1.180.0000.00818.10
8.1.170.0090.00018.62
8.1.160.0100.00018.96
8.1.150.0040.00418.73
8.1.140.0000.00717.64
8.1.130.0000.00718.04
8.1.120.0040.00417.65
8.1.110.0040.00417.69
8.1.100.0000.00717.57
8.1.90.0000.00717.75
8.1.80.0050.00217.70
8.1.70.0040.00417.52
8.1.60.0080.00017.63
8.1.50.0030.00617.73
8.1.40.0030.00517.62
8.1.30.0060.00317.80
8.1.20.0040.00417.87
8.1.10.0040.00417.72
8.1.00.0090.00017.73
8.0.300.0040.00418.77
8.0.290.0080.00017.16
8.0.280.0070.00018.55
8.0.270.0040.00417.33
8.0.260.0030.00317.02
8.0.250.0050.00217.16
8.0.240.0050.00317.22
8.0.230.0000.00717.23
8.0.220.0000.00717.14
8.0.210.0070.00017.06
8.0.200.0060.00017.09
8.0.190.0030.00717.07
8.0.180.0000.00817.16
8.0.170.0030.00617.04
8.0.160.0040.00417.07
8.0.150.0070.00016.92
8.0.140.0060.00617.05
8.0.130.0060.00013.52
8.0.120.0080.00017.18
8.0.110.0050.00216.97
8.0.100.0040.00417.08
8.0.90.0040.00416.98
8.0.80.0140.00317.06
8.0.70.0000.00716.96
8.0.60.0060.00317.10
8.0.50.0040.00416.88
8.0.30.0130.01017.17
8.0.20.0080.01217.40
8.0.10.0040.00417.16
8.0.00.0120.00817.14
7.4.330.0000.00516.77
7.4.320.0040.00416.57
7.4.300.0000.00616.76
7.4.290.0070.00016.71
7.4.280.0030.00716.55
7.4.270.0040.00416.75
7.4.260.0060.00013.37
7.4.250.0060.00316.71
7.4.240.0000.00716.68
7.4.230.0040.00416.50
7.4.220.0030.01416.72
7.4.210.0100.00616.74
7.4.200.0080.00016.54
7.4.190.0030.00516.84
7.4.160.0100.00716.69
7.4.150.0110.00717.40
7.4.140.0080.00917.86
7.4.130.0090.00816.80
7.4.120.0070.01116.57
7.4.110.0040.01516.67
7.4.100.0060.01216.68
7.4.90.0120.00616.77
7.4.80.0040.01319.39
7.4.70.0100.00716.71
7.4.60.0110.01116.68
7.4.50.0080.00016.54
7.4.40.0080.00322.77
7.4.30.0030.01416.69
7.4.00.0050.00815.11
7.3.330.0000.00613.30
7.3.320.0030.00313.32
7.3.310.0000.00816.55
7.3.300.0080.00016.54
7.3.290.0150.00616.51
7.3.280.0100.00716.52
7.3.270.0180.00017.40
7.3.260.0120.01216.75
7.3.250.0070.01116.71
7.3.240.0070.01016.62
7.3.230.0030.01416.75
7.3.210.0170.00716.64
7.3.200.0130.00319.39
7.3.190.0120.00616.60
7.3.180.0040.01116.70
7.3.170.0070.01016.48
7.3.160.0000.01616.52
7.3.120.0060.00915.13
7.3.110.0060.01315.02
7.3.100.0030.01314.86
7.3.90.0030.01414.91
7.3.80.0070.01015.02
7.3.70.0040.00814.91
7.3.60.0060.01214.99
7.3.50.0070.01015.13
7.3.40.0000.01614.92
7.3.30.0070.00415.10
7.3.20.0060.00916.88
7.3.10.0040.01016.81
7.3.00.0060.00916.91
7.2.330.0060.01617.08
7.2.320.0100.01317.02
7.2.310.0120.01216.83
7.2.300.0070.01117.02
7.2.290.0090.01316.99
7.2.250.0040.01815.19
7.2.240.0030.01815.55
7.2.230.0070.01015.30
7.2.220.0030.01315.44
7.2.210.0070.01015.29
7.2.200.0070.01015.25
7.2.190.0090.00615.04
7.2.180.0150.00315.16
7.2.170.0110.00415.34
7.2.130.0070.01017.12
7.2.120.0070.00716.87
7.2.110.0060.01016.70
7.2.100.0000.01516.94
7.2.90.0070.00717.06
7.2.80.0120.00317.13
7.2.70.0070.00717.20
7.2.60.0050.00717.01
7.2.50.0060.00617.12
7.2.40.0000.01116.85
7.2.30.0040.01116.95
7.2.20.0000.01517.16
7.2.10.0120.00317.16
7.2.00.0040.00918.25
7.1.330.0060.00915.98
7.1.320.0130.00315.98
7.1.310.0030.00916.02
7.1.300.0090.00915.96
7.1.290.0030.01215.97
7.1.280.0030.00615.90
7.1.270.0060.00916.12
7.1.260.0030.01516.08
7.1.250.0130.00315.85
7.1.200.0000.01016.04
7.1.100.0040.00818.10
7.1.70.0000.00717.41
7.1.60.0100.00719.17
7.1.50.0100.01417.05
7.1.00.0000.07022.51
7.0.200.0030.00616.96
7.0.140.0100.06721.96
7.0.100.0030.04020.23
7.0.90.0030.05020.03
7.0.80.0100.07019.97
7.0.70.0070.07020.02
7.0.60.0070.06320.02
7.0.50.0170.05720.27
7.0.40.0100.07020.15
7.0.30.0070.07320.18
7.0.20.0000.05720.08
7.0.10.0100.07020.07
7.0.00.0030.08719.95
5.6.280.0070.07020.93
5.6.250.0070.07320.66
5.6.240.0100.08020.66
5.6.230.0100.04720.58
5.6.220.0170.04320.51
5.6.210.0100.05720.69
5.6.200.0100.08321.07
5.6.190.0030.04321.15
5.6.180.0070.04021.11
5.6.170.0100.06721.03
5.6.160.0170.07721.05
5.6.150.0100.07020.96
5.6.140.0100.06021.19
5.6.130.0100.08721.07
5.6.120.0130.08020.98
5.6.110.0100.06721.06
5.6.100.0100.04321.04
5.6.90.0030.04321.02
5.6.80.0030.08020.59
5.6.70.0100.04320.41
5.6.60.0100.04020.52
5.6.50.0100.03720.50
5.6.40.0030.03320.52
5.6.30.0030.04020.55
5.6.20.0070.03720.46
5.6.10.0030.03320.51
5.6.00.0100.03320.33
5.5.380.0070.03720.40
5.5.370.0100.05320.52
5.5.360.0130.07020.38
5.5.350.0030.06320.45
5.5.340.0100.08020.67
5.5.330.0070.04720.84
5.5.320.0170.07020.81
5.5.310.0130.06320.94
5.5.300.0100.04020.80
5.5.290.0170.07320.95
5.5.280.0100.05320.91
5.5.270.0100.04320.66
5.5.260.0130.07320.66
5.5.250.0030.08720.69
5.5.240.0130.07320.24
5.5.230.0130.06720.15
5.5.220.0030.04720.20
5.5.210.0000.08020.29
5.5.200.0030.04020.02
5.5.190.0100.03320.25
5.5.180.0070.03720.26
5.5.160.0030.03720.12
5.5.150.0030.03720.25
5.5.140.0070.03020.17
5.5.130.0000.03720.02
5.5.120.0100.03720.25
5.5.110.0030.04020.18
5.5.100.0030.04720.10
5.5.90.0030.03720.13
5.5.80.0030.04020.03
5.5.70.0100.03320.09
5.5.60.0070.04019.96
5.5.50.0030.03019.96
5.5.40.0070.03020.09
5.5.30.0030.03720.09
5.5.20.0100.03020.06
5.5.10.0070.03020.16
5.5.00.0100.03020.06
5.4.450.0130.07719.46
5.4.440.0130.04019.37
5.4.430.0030.07019.50
5.4.420.0000.04719.45
5.4.410.0130.06019.25
5.4.400.0130.04018.86
5.4.390.0100.05019.18
5.4.380.0030.05319.04
5.4.370.0000.04319.09
5.4.360.0070.02719.05
5.4.350.0000.06019.16
5.4.340.0030.04019.05
5.4.320.0000.04719.22
5.4.310.0070.02719.05
5.4.300.0070.03018.87
5.4.290.0030.03319.18
5.4.280.0030.03719.17
5.4.270.0030.03719.03
5.4.260.0000.04019.23
5.4.250.0100.02719.20
5.4.240.0070.03319.17
5.4.230.0100.03019.20
5.4.220.0030.03319.08
5.4.210.0070.03018.84
5.4.200.0100.03018.94
5.4.190.0000.03319.04
5.4.180.0070.03018.86
5.4.170.0000.03718.84
5.4.160.0030.03719.19
5.4.150.0000.03318.88
5.4.140.0030.03016.38
5.4.130.0000.03316.29
5.4.120.0030.03016.46
5.4.110.0000.03316.39
5.4.100.0070.02716.52
5.4.90.0030.03716.52
5.4.80.0000.03316.28
5.4.70.0030.03016.28
5.4.60.0100.02716.33
5.4.50.0070.03016.43
5.4.40.0000.03316.43
5.4.30.0030.03316.48
5.4.20.0030.03016.42
5.4.10.0070.02716.42
5.4.00.0030.03015.85
5.3.290.0100.06714.75
5.3.280.0030.03014.72
5.3.270.0070.03014.62
5.3.260.0070.02714.77
5.3.250.0030.03014.61
5.3.240.0030.03014.73
5.3.230.0030.03014.62
5.3.220.0000.03714.66
5.3.210.0100.03014.63
5.3.200.0030.03014.66
5.3.190.0030.03314.72
5.3.180.0070.03314.52
5.3.170.0070.03314.71
5.3.160.0000.04014.63
5.3.150.0000.03314.61
5.3.140.0000.03314.60
5.3.130.0070.02714.67
5.3.120.0000.03314.55
5.3.110.0070.02714.69
5.3.100.0000.03714.08
5.3.90.0070.02714.03
5.3.80.0030.03014.07
5.3.70.0070.05714.04
5.3.60.0070.06714.05
5.3.50.0030.04313.88
5.3.40.0130.06014.07
5.3.30.0070.07014.07
5.3.20.0130.04313.70
5.3.10.0130.04713.78
5.3.00.0070.05313.57
5.2.170.0070.07012.13
5.2.160.0130.04312.13
5.2.150.0100.02012.13
5.2.140.0130.06312.13
5.2.130.0030.03312.13
5.2.120.0000.04312.13
5.2.110.0000.03712.13
5.2.100.0030.03312.13
5.2.90.0130.04312.13
5.2.80.0070.04012.13
5.2.70.0030.06312.13
5.2.60.0100.05712.13
5.2.50.0000.04012.13
5.2.40.0000.03712.13
5.2.30.0070.05312.13
5.2.20.0100.05712.13
5.2.10.0070.06312.13
5.2.00.0100.02712.13
5.1.60.0030.04312.13
5.1.50.0130.03312.13
5.1.40.0030.03312.13
5.1.30.0030.06012.13
5.1.20.0030.05712.13
5.1.10.0000.05312.13
5.1.00.0070.05012.13
5.0.50.0000.04012.13
5.0.40.0000.03312.13
5.0.30.0000.03312.13
5.0.20.0000.04012.13
5.0.10.0030.04712.13
5.0.00.0030.04712.13
4.4.90.0030.02012.13
4.4.80.0000.04012.13
4.4.70.0030.03712.13
4.4.60.0070.03012.13
4.4.50.0070.02712.13
4.4.40.0100.03712.13
4.4.30.0070.03312.13
4.4.20.0000.03712.13
4.4.10.0000.02712.13
4.4.00.0030.02712.13
4.3.110.0100.01312.13
4.3.100.0000.03012.13
4.3.90.0000.02312.13
4.3.80.0030.04712.13
4.3.70.0030.02712.13
4.3.60.0030.03012.13
4.3.50.0000.02312.13
4.3.40.0000.04012.13
4.3.30.0000.03312.13
4.3.20.0030.03312.13
4.3.10.0000.02012.13
4.3.00.0000.03012.13

preferences:
41.11 ms | 401 KiB | 5 Q