3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Asia/Singapore'); $strvalidstart = '2014-01-22'; $strpointbal = '1640.0000'; function array_totaldays_in_month() { $totaldays_array = array("1"=>"", "2"=>"28", "3"=>"31", "4"=>"30", "5"=>"31", "6"=>"30", "7"=>"31", "8"=>"31", "9"=>"30", "10"=>"31", "11"=>"30", "12"=>"31"); return $totaldays_array; } /* 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 = 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.4.00.0060.01014.90
7.3.120.0180.00015.15
7.3.110.0030.01314.92
7.3.100.0090.00915.16
7.3.90.0000.00915.08
7.3.80.0030.01414.87
7.3.70.0040.00815.00
7.3.60.0000.01615.10
7.3.50.0040.01114.80
7.3.40.0100.00014.76
7.3.30.0130.00015.05
7.3.20.0070.00716.87
7.3.10.0030.00617.09
7.3.00.0030.01016.80
7.2.250.0190.00315.18
7.2.240.0090.00615.23
7.2.230.0070.00715.24
7.2.220.0070.00715.23
7.2.210.0090.00615.42
7.2.200.0000.01115.38
7.2.190.0060.00615.33
7.2.180.0000.00915.42
7.2.170.0100.00715.11
7.2.160.0070.01315.16
7.2.150.0000.01417.26
7.2.140.0030.00717.07
7.2.130.0090.00617.19
7.2.120.0030.00916.88
7.2.110.0060.01216.93
7.2.100.0090.00916.77
7.2.90.0100.00717.26
7.2.80.0000.01417.11
7.2.70.0030.00716.86
7.2.60.0090.00617.19
7.2.50.0110.00017.22
7.2.40.0040.00817.24
7.2.30.0070.00717.19
7.2.20.0040.01117.02
7.2.10.0100.00717.03
7.2.00.0030.01318.36
7.1.330.0060.01016.09
7.1.320.0040.00816.05
7.1.310.0060.00616.17
7.1.300.0070.00315.91
7.1.290.0090.00015.87
7.1.280.0000.01416.06
7.1.270.0000.01915.67
7.1.260.0040.00815.91
7.1.250.0030.00715.77
7.1.200.0030.01015.95
7.1.100.0070.01118.35
7.1.70.0000.00717.15
7.1.60.0040.01219.70
7.1.50.0100.01016.97
7.1.00.0070.07322.30
7.0.200.0030.00516.95
7.0.140.0100.07022.18
7.0.100.0030.08719.90
7.0.90.0070.08320.13
7.0.80.0070.08019.87
7.0.70.0070.04319.96
7.0.60.0100.07319.94
7.0.50.0130.07320.32
7.0.40.0070.06020.01
7.0.30.0000.06320.11
7.0.20.0030.08020.03
7.0.10.0030.08320.17
7.0.00.0070.07320.00
5.6.280.0070.07021.09
5.6.250.0070.07720.54
5.6.240.0070.08320.60
5.6.230.0070.08720.68
5.6.220.0100.08020.61
5.6.210.0100.07720.57
5.6.200.0170.08020.91
5.6.190.0070.08020.97
5.6.180.0100.07021.06
5.6.170.0030.07321.09
5.6.160.0070.07321.09
5.6.150.0000.06721.12
5.6.140.0070.07320.96
5.6.130.0170.06321.11
5.6.120.0100.07321.03
5.6.110.0100.07321.06
5.6.100.0070.04721.04
5.6.90.0030.08320.96
5.6.80.0030.05320.46
5.6.70.0030.08320.41
5.6.60.0070.04720.39
5.6.50.0070.07020.45
5.6.40.0000.06720.40
5.6.30.0100.07320.48
5.6.20.0000.06320.45
5.6.10.0070.07020.50
5.6.00.0130.07720.49
5.5.380.0030.09020.30
5.5.370.0130.09020.41
5.5.360.0100.08020.46
5.5.350.0070.08020.41
5.5.340.0030.08720.94
5.5.330.0100.07720.94
5.5.320.0100.04020.66
5.5.310.0130.04320.93
5.5.300.0030.08720.90
5.5.290.0030.08720.89
5.5.280.0170.06320.91
5.5.270.0100.08320.65
5.5.260.0100.06320.89
5.5.250.0130.06320.62
5.5.240.0070.05320.32
5.5.230.0130.07320.25
5.5.220.0100.07720.21
5.5.210.0100.05720.28
5.5.200.0030.05720.13
5.5.190.0070.07320.29
5.5.180.0130.05320.29
5.5.160.0030.07720.29
5.5.150.0070.07320.22
5.5.140.0100.07020.18
5.5.130.0170.07020.09
5.5.120.0230.05720.13
5.5.110.0070.07720.18
5.5.100.0100.03720.07
5.5.90.0030.08019.98
5.5.80.0100.08019.96
5.5.70.0100.07320.05
5.5.60.0030.07720.16
5.5.50.0100.05720.07
5.5.40.0130.06020.11
5.5.30.0100.07720.16
5.5.20.0070.07720.09
5.5.10.0100.07020.09
5.5.00.0030.08719.93
5.4.450.0130.07019.51
5.4.440.0130.07319.36
5.4.430.0070.05319.41
5.4.420.0070.08319.36
5.4.410.0030.08719.32
5.4.400.0070.05719.19
5.4.390.0100.06319.03
5.4.380.0070.06719.04
5.4.370.0100.06319.18
5.4.360.0030.07318.85
5.4.350.0070.04019.14
5.4.340.0030.07719.05
5.4.320.0070.07719.02
5.4.310.0070.04719.13
5.4.300.0030.04719.13
5.4.290.0070.04319.02
5.4.280.0130.06019.04
5.4.270.0130.07019.05
5.4.260.0070.06019.02
5.4.250.0100.05019.20
5.4.240.0030.08319.02
5.4.230.0100.07319.02
5.4.220.0030.06019.04
5.4.210.0070.06019.20
5.4.200.0130.07019.18
5.4.190.0000.07318.86
5.4.180.0100.07318.91
5.4.170.0070.07019.17
5.4.160.0130.06719.16
5.4.150.0000.04319.16
5.4.140.0100.06716.36
5.4.130.0030.07316.37
5.4.120.0130.05016.36
5.4.110.0070.04716.50
5.4.100.0030.07716.51
5.4.90.0100.06716.51
5.4.80.0030.07716.37
5.4.70.0130.06716.50
5.4.60.0100.07016.48
5.4.50.0000.04316.48
5.4.40.0070.05016.50
5.4.30.0070.07716.46
5.4.20.0030.06716.30
5.4.10.0070.06716.29
5.4.00.0000.05715.80
5.3.290.0070.07714.65
5.3.280.0070.04714.55
5.3.270.0130.07014.61
5.3.260.0100.07314.65
5.3.250.0100.06014.55
5.3.240.0030.08014.56
5.3.230.0100.07014.73
5.3.220.0030.04714.52
5.3.210.0070.06014.71
5.3.200.0070.04314.73
5.3.190.0100.06314.51
5.3.180.0000.08014.59
5.3.170.0070.07714.66
5.3.160.0030.08714.70
5.3.150.0070.07014.61
5.3.140.0130.06714.56
5.3.130.0100.07314.66
5.3.120.0100.07714.52
5.3.110.0070.04014.55
5.3.100.0000.04314.06
5.3.90.0030.07714.09
5.3.80.0030.04314.16
5.3.70.0070.03713.94
5.3.60.0100.06014.08
5.3.50.0030.08013.97
5.3.40.0000.05714.06
5.3.30.0100.04713.93
5.3.20.0030.04013.60
5.3.10.0070.07013.60
5.3.00.0070.05713.76
5.2.170.0100.06011.34
5.2.160.0000.06711.34
5.2.150.0030.05711.34
5.2.140.0100.05711.34
5.2.130.0030.06311.34
5.2.120.0070.05311.34
5.2.110.0000.06711.34
5.2.100.0070.06311.34
5.2.90.0100.05711.34
5.2.80.0030.03311.34
5.2.70.0030.06311.34
5.2.60.0030.06311.34
5.2.50.0100.05711.34
5.2.40.0030.06311.34
5.2.30.0100.05711.34
5.2.20.0070.05311.34
5.2.10.0100.05711.34
5.2.00.0030.04311.34
5.1.60.0070.04311.34
5.1.50.0070.03711.34
5.1.40.0170.05011.34
5.1.30.0100.04711.34
5.1.20.0070.05311.34
5.1.10.0130.04711.34
5.1.00.0000.05711.34
5.0.50.0070.03011.34
5.0.40.0070.03711.34
5.0.30.0030.06311.34
5.0.20.0070.03711.34
5.0.10.0030.04711.34
5.0.00.0000.05311.34
4.4.90.0000.02011.34
4.4.80.0030.02011.34
4.4.70.0070.03311.34
4.4.60.0030.03711.34
4.4.50.0000.02711.34
4.4.40.0000.05311.34
4.4.30.0070.03711.34
4.4.20.0070.02711.34
4.4.10.0030.03711.34
4.4.00.0030.05311.34
4.3.110.0030.02011.34
4.3.100.0100.01711.34
4.3.90.0030.03011.34
4.3.80.0000.03311.34
4.3.70.0030.01311.34
4.3.60.0000.03711.34
4.3.50.0030.03311.34
4.3.40.0000.05011.34
4.3.30.0000.03711.34
4.3.20.0000.03711.34
4.3.10.0030.03311.34
4.3.00.0000.03311.34

preferences:
41.75 ms | 400 KiB | 5 Q