3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Asia/Singapore'); $strvalidstart = '2014-01-22'; $strpointbal = '1640.0000'; /* this section for emember num days */ // $strvalidstart = "2012-03-01"; // debug $emember_numdays = 0; $param_day_multiplier = 24 * 60 * 60; $stremember_finaldate = ""; if ($strvalidstart != "") { $curr_timestamp = time(); $start_timestamp = strtotime($strvalidstart); if (floatval($strpointbal) <= 0) { // if no receipts / no points, start counting from current date $start_timestamp = $curr_timestamp; } $timediff = $curr_timestamp - $start_timestamp; // $end_timestamp = $start_timestamp + (90 * $param_day_multiplier); /* modified by ZY 13 Jul 2012, calc 3 months on the exact day */ $end_yy = intval(date("Y", $curr_timestamp)); $end_mm = intval(date("m", $curr_timestamp)); $end_dd = intval(date("d", $curr_timestamp)); if ($end_mm >= 10) { $end_yy++; $end_mm = $end_mm + 3 - 12; } else { $end_mm = $end_mm + 3; } $end_timestamp = strtotime($end_yy ."-". $end_mm ."-". $end_dd); $leapyear_flag = date("L", $end_timestamp); $totaldays_array = $this->array_totaldays_in_month(); $strkey = strval($end_mm); $month_totaldays = $totaldays_array[$strkey]; if ($end_mm == 2 && strval($leapyear_flag) == "1") { $month_totaldays = "29"; } $month_totaldays = intval($month_totaldays); if ($end_dd > $month_totaldays) { // if end-day is larger than total num of days in this month, set end-day to the last day of month $end_dd = $month_totaldays; } $end_timestamp = strtotime($end_yy ."-". $end_mm ."-". $end_dd); $emember_numdays = floor($timediff / $param_day_multiplier); if ($emember_numdays < 0) { $emember_numdays = 0; } else { $emember_numdays = 90 - $emember_numdays; if ($emember_numdays < 0) $emember_numdays = 0; } $stremember_finaldate = date("d-M-Y", $end_timestamp); } $strfinal_emember_numdays = $emember_numdays; // $strfinal_emember_numdays = $strvalidstart ." , ". $emember_numdays ." days"; // debug /* modified by ZY 6 Aug 2012, show - if no receipts */ if (floatval($strpointbal) <= 0) { // if no receipts / no points, change to dash $stremember_finaldate = "-"; }

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)
7.2.60.0100.00716.87
7.2.00.0040.00819.82
7.1.200.0060.00616.13
7.1.100.0030.01018.36
7.1.70.0000.00917.06
7.1.60.0100.01319.70
7.1.50.0000.01217.33
7.1.00.0000.08022.30
7.0.200.0030.00617.09
7.0.140.0070.07022.04
7.0.100.0030.05020.01
7.0.90.0170.07320.02
7.0.80.0130.04020.02
7.0.70.0170.06319.89
7.0.60.0030.08020.03
7.0.50.0200.07720.25
7.0.40.0070.05320.08
7.0.30.0100.08320.02
7.0.20.0030.08720.20
7.0.10.0070.08320.02
7.0.00.0070.06319.95
5.6.280.0100.06721.01
5.6.250.0030.07320.64
5.6.240.0030.05720.64
5.6.230.0000.08020.79
5.6.220.0070.07720.59
5.6.210.0100.08320.45
5.6.200.0070.05721.07
5.6.190.0230.07320.96
5.6.180.0100.04320.94
5.6.170.0100.07321.06
5.6.160.0130.06321.14
5.6.150.0130.07721.05
5.6.140.0130.06721.14
5.6.130.0070.05021.11
5.6.120.0070.07021.18
5.6.110.0030.05321.02
5.6.100.0100.08020.94
5.6.90.0030.08021.00
5.6.80.0030.04020.50
5.6.70.0070.04320.51
5.6.60.0130.03720.43
5.6.50.0070.07720.40
5.6.40.0130.07320.37
5.6.30.0030.08320.40
5.6.20.0030.05720.33
5.6.10.0100.06320.33
5.6.00.0070.07720.48
5.5.380.0030.04720.41
5.5.370.0070.08020.58
5.5.360.0170.07320.44
5.5.350.0000.05720.41
5.5.340.0130.07720.81
5.5.330.0070.08320.94
5.5.320.0070.08320.91
5.5.310.0170.07720.88
5.5.300.0030.08720.74
5.5.290.0030.05020.66
5.5.280.0070.08320.62
5.5.270.0000.08020.89
5.5.260.0030.09020.83
5.5.250.0100.08720.70
5.5.240.0170.06720.04
5.5.230.0030.08320.31
5.5.220.0070.07320.10
5.5.210.0030.08720.26
5.5.200.0030.07320.29
5.5.190.0100.07320.14
5.5.180.0070.04020.00
5.5.160.0100.07020.27
5.5.150.0130.07320.25
5.5.140.0100.06020.13
5.5.130.0100.07319.97
5.5.120.0000.05720.09
5.5.110.0030.06320.23
5.5.100.0100.08020.09
5.5.90.0000.08320.10
5.5.80.0100.04720.10
5.5.70.0100.08020.07
5.5.60.0070.06320.16
5.5.50.0030.04719.97
5.5.40.0070.04320.01
5.5.30.0070.08320.05
5.5.20.0130.07020.09
5.5.10.0030.04719.97
5.5.00.0130.04020.06
5.4.450.0100.08019.44
5.4.440.0030.09019.40
5.4.430.0100.06019.46
5.4.420.0130.04719.29
5.4.410.0100.07019.25
5.4.400.0100.06719.08
5.4.390.0000.08319.02
5.4.380.0170.06719.07
5.4.370.0200.06319.03
5.4.360.0100.05019.04
5.4.350.0070.07318.93
5.4.340.0070.07019.11
5.4.320.0100.06018.90
5.4.310.0070.08019.12
5.4.300.0100.07719.12
5.4.290.0130.06719.12
5.4.280.0100.07019.07
5.4.270.0070.06319.14
5.4.260.0070.07319.14
5.4.250.0170.04718.80
5.4.240.0070.08019.11
5.4.230.0070.03719.14
5.4.220.0070.07018.82
5.4.210.0070.04319.13
5.4.200.0000.04719.02
5.4.190.0030.08018.77
5.4.180.0030.04019.08
5.4.170.0170.07019.01
5.4.160.0000.08719.22
5.4.150.0100.06718.88
5.4.140.0130.07016.41
5.4.130.0200.06316.35
5.4.120.0100.06316.33
5.4.110.0100.05016.36
5.4.100.0070.07716.48
5.4.90.0070.07716.40
5.4.80.0130.06716.37
5.4.70.0070.06016.27
5.4.60.0170.06016.30
5.4.50.0070.04016.23
5.4.40.0100.03316.25
5.4.30.0030.07016.34
5.4.20.0100.07316.37
5.4.10.0170.06716.27
5.4.00.0170.03015.71
5.3.290.0030.08014.54
5.3.280.0100.07314.57
5.3.270.0130.06314.44
5.3.260.0030.07714.57
5.3.250.0000.07714.48
5.3.240.0130.04714.60
5.3.230.0030.06314.47
5.3.220.0100.06314.45
5.3.210.0130.07014.41
5.3.200.0070.07714.42
5.3.190.0200.03014.57
5.3.180.0070.07314.56
5.3.170.0030.04314.59
5.3.160.0030.07714.59
5.3.150.0100.07714.43
5.3.140.0070.07714.48
5.3.130.0130.07714.50
5.3.120.0030.04714.43
5.3.110.0030.04314.39
5.3.100.0100.07314.03
5.3.90.0000.04713.89
5.3.80.0000.08014.02
5.3.70.0030.07713.94
5.3.60.0070.07313.79
5.3.50.0100.07013.82
5.3.40.0070.07013.95
5.3.30.0070.07313.90
5.3.20.0000.07713.61
5.3.10.0030.07313.65
5.3.00.0000.07713.66
5.2.170.0030.04311.09
5.2.160.0030.06011.18
5.2.150.0070.06011.15
5.2.140.0000.06011.20
5.2.130.0030.05311.09
5.2.120.0030.03311.09
5.2.110.0070.04311.09
5.2.100.0070.06311.09
5.2.90.0030.06011.12
5.2.80.0030.05011.16
5.2.70.0070.04311.09
5.2.60.0030.03311.12
5.2.50.0000.06011.09
5.2.40.0100.05311.09
5.2.30.0000.06311.09
5.2.20.0070.05011.09
5.2.10.0130.05011.09
5.2.00.0070.06311.09
5.1.60.0030.05711.09
5.1.50.0000.04011.09
5.1.40.0070.03711.09
5.1.30.0100.04711.09
5.1.20.0130.04711.09
5.1.10.0100.03011.09
5.1.00.0000.04711.09
5.0.50.0000.02311.09
5.0.40.0000.03711.09
5.0.30.0030.03011.09
5.0.20.0000.03711.09
5.0.10.0000.03011.09
5.0.00.0000.04711.09
4.4.90.0030.01711.09
4.4.80.0030.03311.09
4.4.70.0030.03711.09
4.4.60.0000.04011.09
4.4.50.0030.03711.09
4.4.40.0100.04011.09
4.4.30.0030.03311.09
4.4.20.0000.03311.09
4.4.10.0030.03011.09
4.4.00.0030.05311.09
4.3.110.0100.02311.09
4.3.100.0000.03711.09
4.3.90.0030.01711.09
4.3.80.0000.04311.09
4.3.70.0030.02011.09
4.3.60.0030.03011.09
4.3.50.0000.02011.09
4.3.40.0100.04311.09
4.3.30.0030.03311.09
4.3.20.0030.03311.09
4.3.10.0000.03711.09
4.3.00.0030.03011.09

preferences:
41.36 ms | 401 KiB | 5 Q