3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $pay_date = '20140808'; $cutoff_date = '20140728'; $next_bill_date = '20140808'; $recurrence = '3'; $rec = '3'; $today = date_create(); $cutoff_date = date_create_from_format('Ymd',$cutoff_date); $next_bill_date = date_create_from_format('Ymd',$next_bill_date); $pay_date = $next_bill_date; $outputstring = $pay_date->format('Ymd'); echo $outputstring; $days = ((int)date_format($pay_date, 'j'))-1; if ( $days > 0 ) { date_modify($pay_date, "-$days day"); } if($rec > 0){ $history = array ( 'account_id' => 'account', 'pay_amount' => '20.00', 'charity_id' => 'charity' ); if ($today > $cutoff_date) { date_modify($pay_date, '+1 month'); } for( $i = 1; $i <= $rec; ++$i ) { $history['pay_month'] = date_format($pay_date,'n'); $history['pay_year'] = date_format($pay_date,'Y'); print_r($history); if ( $i == $rec ) break; date_modify($pay_date, '+1 month'); } } else { $newData = array( 'charity_id' => $data['charity_id'], 'account_id' => $data['account'], 'action' => 'Unselected Charity : charity' ); print_r($newData); }

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.0140.00716.63
8.3.50.0130.00722.05
8.3.40.0100.01018.92
8.3.30.0110.00319.17
8.3.20.0040.00420.04
8.3.10.0000.00823.53
8.3.00.0040.00419.08
8.2.180.0070.01516.88
8.2.170.0090.00622.96
8.2.160.0100.00320.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.51
8.2.110.0100.00022.14
8.2.100.0110.00017.97
8.2.90.0080.00019.16
8.2.80.0040.00418.00
8.2.70.0090.00017.88
8.2.60.0000.00818.15
8.2.50.0060.00318.07
8.2.40.0000.00820.20
8.2.30.0040.00418.48
8.2.20.0000.00817.93
8.2.10.0040.00418.27
8.2.00.0040.00419.65
8.1.280.0080.00825.92
8.1.270.0040.00423.88
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.94
8.1.230.0070.00419.35
8.1.220.0050.00317.91
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0030.00617.59
8.1.180.0030.00618.10
8.1.170.0040.00418.64
8.1.160.0000.00722.07
8.1.150.0060.00318.95
8.1.140.0030.00517.75
8.1.130.0000.00718.01
8.1.120.0000.00717.73
8.1.110.0060.00317.77
8.1.100.0040.00417.71
8.1.90.0000.00817.67
8.1.80.0000.00717.70
8.1.70.0030.00317.69
8.1.60.0000.00817.79
8.1.50.0060.00317.59
8.1.40.0030.00517.70
8.1.30.0060.00317.84
8.1.20.0040.00417.81
8.1.10.0000.00717.77
8.1.00.0080.00017.82
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0040.00418.50
8.0.270.0030.00317.42
8.0.260.0000.00617.39
8.0.250.0040.00417.14
8.0.240.0070.00017.28
8.0.230.0030.00317.11
8.0.220.0040.00417.22
8.0.210.0000.00717.19
8.0.200.0000.00717.10
8.0.190.0030.00517.08
8.0.180.0040.00417.14
8.0.170.0000.00817.19
8.0.160.0030.00417.11
8.0.150.0040.00417.01
8.0.140.0040.00417.16
8.0.130.0000.00613.52
8.0.120.0000.00817.12
8.0.110.0040.00417.21
8.0.100.0070.00017.14
8.0.90.0000.00717.05
8.0.80.0030.01417.23
8.0.70.0080.00017.01
8.0.60.0040.00417.28
8.0.50.0040.00417.11
8.0.30.0130.00617.33
8.0.20.0080.01117.54
8.0.10.0040.00417.16
8.0.00.0080.00817.07
7.4.330.0030.00315.22
7.4.320.0040.00416.70
7.4.300.0060.00016.74
7.4.290.0080.00016.77
7.4.280.0050.00316.71
7.4.270.0070.00016.82
7.4.260.0000.00716.75
7.4.250.0070.00016.69
7.4.240.0040.00316.80
7.4.230.0050.00316.91
7.4.220.0150.01016.81
7.4.210.0070.01116.67
7.4.200.0000.00716.53
7.4.160.0070.01016.88
7.4.150.0100.00717.40
7.4.140.0100.00717.86
7.4.130.0050.01516.80
7.4.120.0090.00816.79
7.4.110.0090.00917.00
7.4.100.0140.01116.87
7.4.90.0090.00916.70
7.4.80.0110.01319.39
7.4.70.0150.00016.86
7.4.60.0110.00716.76
7.4.50.0000.00916.71
7.4.40.0080.00816.88
7.4.30.0090.00616.75
7.4.00.0080.00915.34
7.3.330.0000.00613.37
7.3.320.0060.00013.38
7.3.310.0070.00016.38
7.3.300.0000.00716.54
7.3.290.0070.01316.57
7.3.280.0130.00616.57
7.3.270.0130.00617.40
7.3.260.0060.01116.53
7.3.250.0060.01516.67
7.3.240.0130.00616.65
7.3.230.0090.00916.75
7.3.210.0070.01016.60
7.3.200.0110.01116.81
7.3.190.0030.01816.96
7.3.180.0060.00916.78
7.3.170.0090.00916.80
7.3.160.0170.00616.56
7.3.120.0050.01015.06
7.3.110.0050.01215.15
7.3.100.0060.01314.90
7.3.90.0020.01415.12
7.3.80.0070.00715.19
7.3.70.0050.00614.99
7.3.60.0040.01314.97
7.3.50.0100.00515.05
7.3.40.0030.01015.15
7.3.30.0070.00615.02
7.3.20.0110.00316.86
7.3.10.0020.01416.99
7.3.00.0080.00516.95
7.2.330.0150.00416.90
7.2.320.0060.01617.00
7.2.310.0150.00416.70
7.2.300.0110.00616.98
7.2.290.0180.00016.87
7.2.250.0060.01315.21
7.2.240.0060.01115.28
7.2.230.0090.00615.30
7.2.220.0060.00615.31
7.2.210.0030.01015.28
7.2.200.0040.01015.18
7.2.190.0040.01115.20
7.2.180.0030.00915.28
7.2.170.0070.01115.41
7.2.160.0070.01015.29
7.2.150.0060.00717.24
7.2.140.0030.01317.27
7.2.130.0030.01317.38
7.2.120.0040.01516.94
7.2.110.0050.00517.17
7.2.100.0100.00717.03
7.2.90.0090.00617.22
7.2.80.0050.00816.82
7.2.70.0060.01216.86
7.2.60.0060.01116.99
7.2.50.0040.01217.36
7.2.40.0090.00616.93
7.2.30.0060.00617.17
7.2.20.0090.00617.20
7.2.10.0030.00717.04
7.2.00.0050.00818.33
7.1.330.0090.00915.89
7.1.320.0050.00716.01
7.1.310.0030.01116.13
7.1.300.0060.00316.08
7.1.290.0040.01016.05
7.1.280.0050.01115.95
7.1.270.0060.01016.14
7.1.260.0040.01116.12
7.1.250.0040.00815.86
7.1.240.0030.00615.79
7.1.230.0000.01516.06
7.1.220.0040.01115.91
7.1.210.0060.00916.16
7.1.200.0050.00916.11
7.1.190.0070.00716.21
7.1.180.0000.01516.08
7.1.170.0000.01215.77
7.1.160.0030.01316.00
7.1.150.0090.00616.13
7.1.140.0070.00416.06
7.1.130.0030.01415.98
7.1.120.0040.01215.71
7.1.110.0000.01316.16
7.1.100.0020.00817.15
7.1.90.0080.00816.20
7.1.80.0030.00715.85
7.1.70.0020.00916.59
7.1.60.0120.00817.72
7.1.50.0090.00916.48
7.1.40.0060.00915.98
7.1.30.0030.01016.04
7.1.20.0030.01316.06
7.1.10.0000.01316.14
7.1.00.0050.04019.13
7.0.330.0070.01015.30
7.0.320.0000.01615.73
7.0.310.0090.00315.77
7.0.300.0040.01215.49
7.0.290.0070.00715.71
7.0.280.0130.00015.59
7.0.270.0090.00615.32
7.0.260.0040.01115.63
7.0.250.0060.00615.62
7.0.240.0040.00815.57
7.0.230.0000.01715.54
7.0.220.0100.00315.43
7.0.210.0050.00515.63
7.0.200.0030.00616.30
7.0.190.0060.00915.53
7.0.180.0030.01215.70
7.0.170.0070.01015.67
7.0.160.0000.00915.66
7.0.150.0040.00815.46
7.0.140.0050.03818.87
7.0.130.0070.00715.26
7.0.120.0070.00715.50
7.0.110.0040.00415.64
7.0.100.0040.01115.61
7.0.90.0030.01315.56
7.0.80.0040.01215.59
7.0.70.0040.00815.54
7.0.60.0030.04017.82
7.0.50.0080.04216.60
7.0.40.0020.04716.90
7.0.30.0180.02816.69
7.0.20.0150.03316.94
7.0.10.0180.03516.84
7.0.00.0090.02916.94
5.6.400.0000.01414.79
5.6.390.0040.00814.62
5.6.380.0030.01014.61
5.6.370.0080.00614.95
5.6.360.0130.00014.79
5.6.350.0030.01014.22
5.6.340.0030.01314.44
5.6.330.0100.00714.57
5.6.320.0030.01014.78
5.6.310.0040.00814.61
5.6.300.0060.01214.75
5.6.290.0080.00414.83
5.6.280.0090.03518.00
5.6.270.0030.00914.48
5.6.260.0030.00914.55
5.6.250.0070.00714.49
5.6.240.0090.00014.56
5.6.230.0070.00314.57
5.6.220.0100.00314.55
5.6.210.0070.02517.54
5.6.200.0050.03016.27
5.6.190.0050.04717.70
5.6.180.0080.02517.64
5.6.170.0130.03517.47
5.6.160.0060.04717.49
5.6.150.0070.02916.36
5.6.140.0060.03016.40
5.6.130.0130.03716.42
5.6.120.0050.03817.94
5.6.110.0080.04317.91
5.6.100.0050.03917.71
5.6.90.0030.04317.81
5.6.80.0080.04417.62
5.6.70.0280.03317.52
5.6.60.0110.00414.26
5.6.50.0030.01014.62
5.6.40.0040.01114.46
5.6.30.0070.00714.53
5.6.20.0090.00614.69
5.6.10.0060.00914.45
5.6.00.0030.01214.48
5.5.380.0070.00714.68
5.5.370.0120.00314.54
5.5.360.0080.00814.57
5.5.350.0030.03217.44
5.5.340.0070.02716.17
5.5.330.0070.04617.54
5.5.320.0110.03317.50
5.5.310.0120.02917.27
5.5.300.0080.02016.16
5.5.290.0100.04516.38
5.5.280.0100.04417.77
5.5.270.0040.02517.71
5.5.260.0140.02717.55
5.5.250.0070.04117.56
5.5.240.0050.02417.16
5.5.230.0060.00614.60
5.5.220.0060.00914.80
5.5.210.0040.01114.67
5.5.200.0130.00314.67
5.5.190.0070.00714.56
5.5.180.0070.00714.61
5.5.170.0000.01214.52
5.5.160.0100.00314.47
5.5.150.0060.00614.75
5.5.140.0030.00914.48
5.5.130.0080.00414.71
5.5.120.0080.00414.61
5.5.110.0110.00014.61
5.5.100.0040.00814.74
5.5.90.0000.01414.41
5.5.80.0090.00314.30
5.5.70.0030.00914.61
5.5.60.0040.00714.55
5.5.50.0030.00914.80
5.5.40.0030.01014.48
5.5.30.0030.00614.72
5.5.20.0060.00914.38
5.5.10.0060.00614.57
5.5.00.0040.01114.20
5.4.450.0200.02320.09
5.4.440.0190.02817.66
5.4.430.0240.01516.50
5.4.420.0150.02316.41
5.4.410.0800.03015.40
5.4.400.0130.02516.20
5.4.390.0180.02716.23
5.4.380.0180.02515.03
5.4.370.0150.03814.96
5.4.360.0120.03014.90
5.4.350.0170.02714.93
5.4.340.0120.03214.77
5.4.330.0000.01211.20
5.4.320.0030.02311.95
5.4.310.0050.02211.78
5.4.300.0070.02111.73
5.4.290.0050.02311.98
5.4.280.0070.02411.82
5.4.270.0050.02011.87
5.4.260.0050.02411.80
5.4.250.0090.02411.76
5.4.240.0070.02311.73
5.4.230.0060.02211.82
5.4.220.0050.02211.88
5.4.210.0070.02111.68
5.4.200.0110.01611.70
5.4.190.0070.02111.73
5.4.180.0040.02311.66
5.4.170.0090.01911.81
5.4.160.0050.02011.75
5.4.150.0070.02111.65
5.4.140.0080.02011.65
5.4.130.0090.01711.62
5.4.120.0070.01911.46
5.4.110.0040.02111.61
5.4.100.0070.02011.63
5.4.90.0060.02311.62
5.4.80.0040.02511.59
5.4.70.0050.02111.59
5.4.60.0080.02011.63
5.4.50.0050.01911.60
5.4.40.0080.01911.53
5.4.30.0040.02311.59
5.4.20.0050.02411.53
5.4.10.0080.02311.63
5.4.00.0050.02511.21
5.3.290.0040.02311.82
5.3.280.0060.02311.61
5.3.270.0040.02311.69
5.3.260.0070.02011.68
5.3.250.0050.02311.68
5.3.240.0080.02111.72
5.3.230.0020.02511.75
5.3.220.0060.01911.60
5.3.210.0060.02111.65
5.3.200.0030.02311.63
5.3.190.0050.02411.68
5.3.180.0060.02311.77
5.3.170.0040.02411.76
5.3.160.0020.02511.74
5.3.150.0050.02011.76
5.3.140.0040.02311.72
5.3.130.0070.02111.61
5.3.120.0060.02311.64
5.3.110.0050.02411.70
5.3.100.0070.02411.35
5.3.90.0070.02111.41
5.3.80.0050.02111.30
5.3.70.0040.02111.34
5.3.60.0060.02011.36
5.3.50.0090.02211.30
5.3.40.0050.02111.33
5.3.30.0050.02411.29
5.3.20.0020.02411.15
5.3.10.0060.02310.99
5.3.00.0070.02411.07
5.2.170.0030.0349.20
5.2.160.0060.0289.20
5.2.150.0060.0309.20
5.2.140.0040.0329.20
5.2.130.0030.0319.16
5.2.120.0050.0299.16
5.2.110.0050.0299.16
5.2.100.0040.0299.16
5.2.90.0040.0309.16
5.2.80.0040.0319.16
5.2.70.0040.0319.16
5.2.60.0020.0339.11
5.2.50.0070.0289.07
5.2.40.0060.0289.05
5.2.30.0050.0309.04
5.2.20.0090.0279.02
5.2.10.0050.0338.95
5.2.00.0040.0308.80
5.1.60.0080.0268.09
5.1.50.0070.0238.09
5.1.40.0050.0248.06
5.1.30.0060.0248.41
5.1.20.0040.0328.43
5.1.10.0050.0258.16
5.1.00.0090.0218.16
5.0.50.0020.0226.64
5.0.40.0050.0206.50
5.0.30.0020.0346.32
5.0.20.0040.0206.29
5.0.10.0020.0266.27
5.0.00.0070.0286.25
4.4.90.0030.0184.78
4.4.80.0040.0154.75
4.4.70.0040.0154.75
4.4.60.0020.0164.75
4.4.50.0020.0224.77
4.4.40.0040.0294.70
4.4.30.0010.0184.76
4.4.20.0050.0144.84
4.4.10.0020.0234.85
4.4.00.0030.0274.76
4.3.110.0030.0164.67
4.3.100.0020.0154.67
4.3.90.0030.0144.64
4.3.80.0030.0244.58
4.3.70.0020.0154.63
4.3.60.0020.0164.63
4.3.50.0030.0154.63
4.3.40.0020.0244.54
4.3.30.0030.0153.30
4.3.20.0010.0173.28
4.3.10.0030.0163.24
4.3.00.0330.02713.50

preferences:
44.2 ms | 401 KiB | 5 Q