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 = "-"; } echo $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.10.0120.00615.26
7.4.00.0060.01215.32
7.3.130.0160.00414.97
7.3.120.0140.00515.09
7.3.110.0120.00615.28
7.3.100.0080.00815.11
7.3.90.0060.00614.76
7.3.80.0070.01114.78
7.3.70.0030.01415.09
7.3.60.0030.01215.00
7.3.50.0070.00714.96
7.3.40.0040.00815.11
7.3.30.0100.00615.03
7.3.20.0040.01116.87
7.3.10.0050.01016.77
7.3.00.0140.00316.80
7.2.260.0130.00715.31
7.2.250.0160.00615.25
7.2.240.0120.00415.40
7.2.230.0110.00715.32
7.2.220.0040.01314.88
7.2.210.0110.00415.38
7.2.200.0130.00315.40
7.2.190.0040.00915.31
7.2.180.0030.00814.98
7.2.170.0040.01615.28
7.2.160.0060.01015.40
7.2.150.0030.01416.95
7.2.140.0070.01017.15
7.2.130.0050.00817.13
7.2.120.0040.01217.15
7.2.110.0100.00517.02
7.2.100.0160.00016.93
7.2.90.0070.01017.16
7.2.80.0100.00717.24
7.2.70.0130.00716.81
7.2.60.0030.01116.96
7.2.50.0080.00817.27
7.2.40.0110.00417.26
7.2.30.0050.01317.30
7.2.20.0000.01416.87
7.2.10.0040.01117.15
7.2.00.0050.01118.42
7.1.330.0090.00915.95
7.1.320.0060.01016.08
7.1.310.0170.00015.92
7.1.300.0070.00315.93
7.1.290.0030.00915.93
7.1.280.0110.00615.96
7.1.270.0060.01016.05
7.1.260.0100.00515.72
7.1.250.0040.01215.78
7.1.240.0000.01616.02
7.1.230.0000.01615.71
7.1.220.0060.00916.05
7.1.210.0110.00515.73
7.1.200.0030.01315.90
7.1.190.0070.00716.07
7.1.180.0030.01016.00
7.1.170.0030.01415.91
7.1.160.0070.00716.08
7.1.150.0030.01315.80
7.1.140.0100.00715.80
7.1.130.0100.00615.89
7.1.120.0070.01015.82
7.1.110.0040.01416.05
7.1.100.0070.01217.34
7.1.90.0060.00916.13
7.1.80.0060.00615.70
7.1.70.0080.00416.65
7.1.60.0130.00817.94
7.1.50.0080.00616.51
7.1.40.0000.01216.04
7.1.30.0030.01316.04
7.1.20.0080.00815.83
7.1.10.0100.00315.97
7.1.00.0080.03819.18
7.0.330.0000.01815.61
7.0.320.0070.01115.64
7.0.310.0090.00915.54
7.0.300.0030.01015.66
7.0.290.0040.01215.27
7.0.280.0120.00015.54
7.0.270.0000.01415.46
7.0.260.0030.01215.61
7.0.250.0080.00415.52
7.0.240.0070.01015.55
7.0.230.0070.01015.63
7.0.220.0080.00315.58
7.0.210.0080.00815.67
7.0.200.0080.00516.30
7.0.190.0040.00715.41
7.0.180.0080.00415.36
7.0.170.0030.01015.50
7.0.160.0120.00315.56
7.0.150.0090.00615.66
7.0.140.0070.03818.87
7.0.130.0000.01415.52
7.0.120.0030.00615.50
7.0.110.0070.01015.54
7.0.100.0060.01015.24
7.0.90.0150.04317.75
7.0.80.0030.03017.79
7.0.70.0070.03717.81
7.0.60.0080.03817.64
7.0.50.0020.03617.95
7.0.40.0040.03916.79
7.0.30.0100.03216.94
7.0.20.0130.04116.79
7.0.10.0030.03016.97
7.0.00.0090.02616.82
5.6.400.0030.00914.56
5.6.390.0060.00914.56
5.6.380.0040.01514.86
5.6.370.0030.01414.69
5.6.360.0040.01114.79
5.6.350.0040.01114.72
5.6.340.0030.01014.38
5.6.330.0030.01014.80
5.6.320.0060.00614.39
5.6.310.0070.00714.83
5.6.300.0000.01414.55
5.6.290.0050.00714.54
5.6.280.0070.03717.76
5.6.270.0000.01314.65
5.6.260.0070.01114.46
5.6.250.0040.01414.65
5.6.240.0050.04617.63
5.6.230.0050.04817.57
5.6.220.0080.04417.69
5.6.210.0060.04117.62
5.6.200.0130.03217.77
5.6.190.0020.04917.83
5.6.180.0050.04617.84
5.6.170.0010.03317.80
5.6.160.0100.04217.73
5.6.150.0100.03317.79
5.6.140.0150.03917.89
5.6.130.0020.04517.88
5.6.120.0050.03817.91
5.6.110.0070.04317.87
5.6.100.0100.04317.70
5.6.90.0050.04517.78
5.6.80.0090.02617.64
5.6.70.0060.04317.39
5.6.60.0080.03917.32
5.6.50.0080.04517.40
5.6.40.0090.03817.46
5.6.30.0100.04117.48
5.6.20.0080.02517.34
5.6.10.0050.02717.56
5.6.00.0080.03517.46
5.5.380.0080.04317.43
5.5.370.0100.04117.48
5.5.360.0060.04617.57
5.5.350.0080.04417.44
5.5.340.0110.04217.74
5.5.330.0050.04117.66
5.5.320.0080.03217.82
5.5.310.0100.03317.78
5.5.300.0080.02617.68
5.5.290.0050.02717.62
5.5.280.0140.02817.59
5.5.270.0100.03517.72
5.5.260.0070.04517.57
5.5.250.0070.04717.52
5.5.240.0080.04717.33
5.5.230.0030.04917.43
5.5.220.0090.04317.12
5.5.210.0050.02717.21
5.5.200.0110.03717.29
5.5.190.0090.04217.17
5.5.180.0070.04417.16
5.5.170.0060.00914.50
5.5.160.0100.03917.40
5.5.150.0000.03017.30
5.5.140.0120.02717.29
5.5.130.0060.02617.14
5.5.120.0070.04217.15
5.5.110.0000.03117.33
5.5.100.0060.02817.23
5.5.90.0070.03717.25
5.5.80.0080.04017.27
5.5.70.0080.04517.23
5.5.60.0120.03817.15
5.5.50.0170.02017.19
5.5.40.0120.03517.18
5.5.30.0130.04017.25
5.5.20.0050.04317.41
5.5.10.0030.04517.27
5.5.00.0140.03016.99
5.4.450.0030.03515.15
5.4.440.0060.04115.26
5.4.430.0100.03815.20
5.4.420.0110.03015.13
5.4.410.0050.02215.27
5.4.400.0050.04315.15
5.4.390.0030.02415.19
5.4.380.0050.04315.19
5.4.370.0030.03015.18
5.4.360.0090.03615.21
5.4.350.0060.03815.19
5.4.340.0050.03315.21
5.4.330.0100.00011.34
5.4.320.0060.02115.06
5.4.310.0060.02715.09
5.4.300.0100.03715.08
5.4.290.0020.03114.94
5.4.280.0100.03714.94
5.4.270.0070.02315.15
5.4.260.0030.04015.11
5.4.250.0050.02715.14
5.4.240.0030.02715.04
5.4.230.0110.03714.99
5.4.220.0110.03415.00
5.4.210.0050.04315.08
5.4.200.0030.04115.22
5.4.190.0120.03315.21
5.4.180.0030.02515.21
5.4.170.0050.04314.86
5.4.160.0050.03314.93
5.4.150.0030.03215.16
5.4.140.0020.04213.60
5.4.130.0050.04013.92
5.4.120.0020.03913.80
5.4.110.0150.03213.79
5.4.100.0050.02613.86
5.4.90.0110.03013.86
5.4.80.0060.02913.64
5.4.70.0050.02413.75
5.4.60.0070.03713.79
5.4.50.0040.02013.77
5.4.40.0080.03313.87
5.4.30.0060.03813.90
5.4.20.0070.03513.74
5.4.10.0130.02713.85
5.4.00.0020.04213.57
5.3.290.0050.02212.86
5.3.280.0080.03812.62
5.3.270.0050.04012.64
5.3.260.0050.03712.61
5.3.250.0060.03812.78
5.3.240.0030.04012.73
5.3.230.0080.03812.76
5.3.220.0070.03612.64
5.3.210.0060.02312.57
5.3.200.0030.02912.68
5.3.190.0060.02912.69
5.3.180.0050.03312.66
5.3.170.0030.02812.63
5.3.160.0070.03912.73
5.3.150.0050.02512.77
5.3.140.0030.04512.67
5.3.130.0090.02212.65
5.3.120.0020.02812.59
5.3.110.0050.03512.75
5.3.100.0080.02512.35
5.3.90.0030.02212.50
5.3.80.0050.02012.44
5.3.70.0050.02712.40
5.3.60.0050.04012.29
5.3.50.0020.03712.29
5.3.40.0050.04112.35
5.3.30.0060.04012.44
5.3.20.0060.02312.09
5.3.10.0070.01712.21
5.3.00.0100.03312.11
5.2.170.0000.05711.27
5.2.160.0100.05711.28
5.2.150.0100.06311.30
5.2.140.0030.06311.22
5.2.130.0030.06311.17
5.2.120.0000.03711.02
5.2.110.0070.06711.11
5.2.100.0070.04011.00
5.2.90.0070.06011.24
5.2.80.0030.05711.17
5.2.70.0000.03711.18
5.2.60.0100.02711.16
5.2.50.0030.03710.97
5.2.40.0030.03011.13
5.2.30.0030.03011.00
5.2.20.0000.03011.11
5.2.10.0000.03010.78
5.2.00.0030.03010.88
5.1.60.0030.02010.41
5.1.50.0000.02710.41
5.1.40.0000.02710.41
5.1.30.0000.02710.42
5.1.20.0070.02010.45
5.1.10.0070.02010.41
5.1.00.0030.02310.41
5.0.50.0030.02010.41
5.0.40.0030.02710.41
5.0.30.0030.05310.41
5.0.20.0000.02010.41
5.0.10.0070.02710.41
5.0.00.0000.02710.41
4.4.90.0000.02310.41
4.4.80.0000.01710.41
4.4.70.0030.01310.41
4.4.60.0030.01310.41
4.4.50.0000.01710.41
4.4.40.0000.02010.41
4.4.30.0000.01710.41
4.4.20.0030.01310.41
4.4.10.0000.01710.41
4.4.00.0030.02010.41
4.3.110.0000.01310.41
4.3.100.0000.02010.41
4.3.90.0000.01710.41
4.3.80.0030.02310.41
4.3.70.0070.02310.41
4.3.60.0030.01310.41
4.3.50.0000.01710.41
4.3.40.0000.02710.41
4.3.30.0030.01010.41
4.3.20.0030.01310.41
4.3.10.0030.01310.41
4.3.00.0070.01310.41

preferences:
32.42 ms | 401 KiB | 5 Q