3v4l.org

run code in 300+ PHP versions simultaneously
<?php function field_field($date, $field) { // Format yyyy-mm-dd or yyyy-mm or yyyy $length = strlen($date); if ( $length >= 4 ) { $year = substr($date, 0, 4); if ( $length >= 7 ) { $month = substr($date, 5, 2); if ( $length >= 9 ) { $day = substr($date, 8, 2); $start = "$year-$month-$day 00:00"; $day = str_pad(++$day,2,'0',STR_PAD_LEFT); $end = "$year-$month-$day 00:00"; } else { $start = "$year-$month-01 00:00"; $month = str_pad(++$month,2,'0',STR_PAD_LEFT); $end = "$year-$month-01 00:00"; } } else { $start = "$year-01-01 00:00"; $year = str_pad(++$year,2,'0',STR_PAD_LEFT); $end = "$year-01-01 00:00"; } return "$field >= '$start' AND $field < '$end'"; } else { return ' 1=1 '; } } echo field_field( '2010', 'me');

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.0090.00618.31
8.3.50.0140.00416.49
8.3.40.0070.00718.90
8.3.30.0070.00719.20
8.3.20.0080.00020.33
8.3.10.0080.00023.65
8.3.00.0080.00019.19
8.2.180.0110.00716.50
8.2.170.0070.01022.96
8.2.160.0150.00621.97
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.19
8.2.110.0040.00420.43
8.2.100.0040.00817.72
8.2.90.0000.00917.75
8.2.80.0040.00418.66
8.2.70.0030.00517.92
8.2.60.0080.00018.16
8.2.50.0060.00319.20
8.2.40.0040.00421.23
8.2.30.0000.00719.21
8.2.20.0050.00317.77
8.2.10.0040.00418.02
8.2.00.0000.00717.88
8.1.280.0040.01125.92
8.1.270.0060.00318.93
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0000.00922.04
8.1.230.0130.00017.77
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0050.00517.13
8.1.190.0030.00517.13
8.1.180.0090.00018.88
8.1.170.0040.00418.59
8.1.160.0050.00218.97
8.1.150.0050.00318.80
8.1.140.0040.00417.47
8.1.130.0000.00717.81
8.1.120.0030.00317.45
8.1.110.0040.00417.30
8.1.100.0000.00717.41
8.1.90.0070.00017.41
8.1.80.0070.00017.43
8.1.70.0070.00017.40
8.1.60.0060.00617.64
8.1.50.0030.00517.48
8.1.40.0070.00317.40
8.1.30.0050.00317.59
8.1.20.0070.00017.56
8.1.10.0070.00017.54
8.1.00.0030.00617.41
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0070.00018.47
8.0.270.0000.00717.19
8.0.260.0030.00317.34
8.0.250.0000.00817.00
8.0.240.0030.00316.85
8.0.230.0000.00716.95
8.0.220.0040.00416.88
8.0.210.0030.00316.91
8.0.200.0000.00616.93
8.0.190.0040.00416.86
8.0.180.0040.00416.93
8.0.170.0030.00616.97
8.0.160.0000.00716.88
8.0.150.0000.00716.75
8.0.140.0040.00316.90
8.0.130.0040.00413.34
8.0.120.0080.00016.91
8.0.110.0050.00316.76
8.0.100.0000.00716.89
8.0.90.0000.00716.83
8.0.80.0160.00016.86
8.0.70.0080.00016.74
8.0.60.0000.00716.93
8.0.50.0050.00316.76
8.0.30.0080.01517.28
8.0.20.0090.01417.40
8.0.10.0040.00416.84
8.0.00.0150.01216.86
7.4.330.0050.00015.03
7.4.320.0030.00316.46
7.4.300.0030.00316.54
7.4.290.0070.00016.58
7.4.280.0070.00016.52
7.4.270.0050.00216.61
7.4.260.0000.00716.60
7.4.250.0000.00816.47
7.4.240.0020.00516.57
7.4.230.0000.00716.33
7.4.220.0130.00716.63
7.4.210.0100.01016.69
7.4.200.0000.00716.50
7.4.160.0090.00616.50
7.4.150.0070.01017.40
7.4.140.0130.00717.86
7.4.130.0120.01016.48
7.4.120.0050.01316.57
7.4.110.0120.00616.55
7.4.100.0090.00916.45
7.4.90.0100.00716.42
7.4.80.0060.01519.39
7.4.70.0110.00416.48
7.4.60.0070.01016.52
7.4.50.0040.00416.43
7.4.40.0040.01416.69
7.4.30.0060.01116.46
7.4.00.0070.00815.17
7.3.330.0060.00013.45
7.3.320.0000.00613.36
7.3.310.0050.00316.20
7.3.300.0030.00316.39
7.3.290.0100.00516.40
7.3.280.0100.00916.38
7.3.270.0100.01317.40
7.3.260.0140.01116.42
7.3.250.0100.00916.62
7.3.240.0130.00316.42
7.3.230.0070.01016.58
7.3.210.0100.01316.72
7.3.200.0090.01319.39
7.3.190.0040.01116.37
7.3.180.0060.00916.40
7.3.170.0100.00716.50
7.3.160.0090.00616.61
7.3.120.0070.01014.86
7.3.110.0000.01614.92
7.3.100.0090.00615.16
7.3.90.0090.00614.86
7.3.80.0090.00615.21
7.3.70.0070.00714.91
7.3.60.0100.00014.89
7.3.50.0060.00915.02
7.3.40.0070.01014.71
7.3.30.0060.00914.92
7.3.20.0000.00916.69
7.3.10.0040.00816.63
7.3.00.0030.00616.73
7.2.330.0110.00616.54
7.2.320.0060.01216.50
7.2.310.0000.01616.65
7.2.300.0100.00716.71
7.2.290.0030.02016.76
7.2.250.0130.00615.03
7.2.240.0120.00615.04
7.2.230.0030.01515.07
7.2.220.0070.00414.83
7.2.210.0070.00715.20
7.2.200.0040.00715.06
7.2.190.0140.00415.02
7.2.180.0000.01315.14
7.2.170.0040.01115.13
7.2.60.0060.00616.71
7.2.00.0120.00418.86
7.1.330.0030.01015.83
7.1.320.0060.00915.84
7.1.310.0070.01015.75
7.1.300.0000.01115.81
7.1.290.0070.00415.87
7.1.280.0030.01315.80
7.1.270.0030.01315.75
7.1.260.0070.00715.59
7.1.200.0120.00415.78
7.1.100.0060.00617.92
7.1.70.0000.01017.12
7.1.60.0110.01419.22
7.1.50.0170.01734.95
7.1.00.0130.06722.50
7.0.200.0100.00316.82
7.0.140.0030.05322.14
7.0.60.0170.07719.93
7.0.50.0170.07717.75
7.0.40.0170.07320.20
7.0.30.0330.07320.09
7.0.20.0300.07020.27
7.0.10.0070.04020.11
7.0.00.0030.06020.19
5.6.280.0000.07721.10
5.6.210.0130.06720.46
5.6.200.0030.08718.25
5.6.190.0030.07720.63
5.6.180.0230.04720.41
5.6.170.0100.04720.62
5.6.160.0070.04320.54
5.6.150.0100.05018.15
5.6.140.0030.06718.18
5.6.130.0130.07718.17
5.6.120.0130.07021.12
5.6.110.0100.07721.04
5.6.100.0000.07021.10
5.6.90.0170.07020.99
5.6.80.0070.07320.52
5.5.350.0300.07320.31
5.5.340.0070.04317.95
5.5.330.0070.09020.29
5.5.320.0470.05320.20
5.5.310.0270.08020.24
5.5.300.0100.05717.98
5.5.290.0130.05317.97
5.5.280.0100.05320.75
5.5.270.0100.03720.89
5.5.260.0030.09720.70
5.5.250.0200.07020.72
5.5.240.0100.06020.16
5.4.450.0830.04019.20
5.4.440.0230.06019.65
5.4.430.0270.04719.50
5.4.420.0270.04719.31
5.4.410.0130.05319.27
5.4.400.0170.05019.11
5.4.390.0270.05718.75
5.4.380.0330.05018.58
5.4.370.0230.06018.84
5.4.360.0430.04018.76
5.4.350.0470.05718.84
5.4.340.0330.05318.76
5.4.320.0330.05318.75
5.4.310.0370.04718.66
5.4.300.0230.06018.47
5.4.290.0370.05018.75
5.4.280.0300.05318.58
5.4.270.0330.05318.63
5.4.260.0270.06018.73
5.4.250.0300.05318.70
5.4.240.0230.06018.75
5.4.230.0200.05718.61
5.4.220.0400.04318.61
5.4.210.0370.04318.61
5.4.200.0230.05316.79
5.4.190.0300.05018.46
5.4.180.0430.05318.52
5.4.170.0470.07018.73
5.4.160.0370.05718.55
5.4.150.0370.06718.48
5.4.140.0500.05716.46
5.4.130.0500.05716.23
5.4.120.0500.05716.28
5.4.110.0270.05716.24
5.4.100.0370.05316.20
5.4.90.0300.05016.23
5.4.80.0430.04716.25
5.4.70.0200.06016.27
5.4.60.0300.05316.31
5.4.50.0370.04316.18
5.4.40.0200.05316.29
5.4.30.0030.05316.26
5.4.20.0100.05016.27
5.4.10.0070.06016.11
5.4.00.1230.04715.77
5.3.290.1100.04314.86
5.3.280.1100.05314.62
5.3.270.1070.05014.62
5.3.260.1130.04714.62
5.3.250.1070.05014.75
5.3.240.1170.05314.86
5.3.230.1070.06014.63
5.3.220.1230.06714.71
5.3.210.1270.06014.72
5.3.200.1200.07014.56
5.3.190.1100.05314.60
5.3.180.0900.06314.72
5.3.170.1000.05314.63
5.3.160.1000.05014.61
5.3.150.1170.05014.68
5.3.140.1130.05014.79
5.3.130.1230.05314.54
5.3.120.1300.04314.67
5.3.110.1270.04714.67
5.3.100.1230.04314.10
5.3.90.1100.05714.16
5.3.80.1130.05714.08
5.3.70.1130.05314.20
5.3.60.1200.04314.06
5.3.50.1130.05314.00
5.3.40.1030.04714.17
5.3.30.0870.06014.09
5.3.20.1130.05013.91
5.3.10.1130.04313.74
5.3.00.0970.06313.69
5.2.170.0930.04011.36
5.2.160.0870.04711.36
5.2.150.0830.05011.36
5.2.140.0900.04711.27
5.2.130.1000.03711.13
5.2.120.0900.05011.14
5.2.110.0900.04011.33
5.2.100.0900.04311.22
5.2.90.0870.04711.24
5.2.80.0970.04311.11
5.2.70.0870.04711.22
5.2.60.0930.04011.19
5.2.50.0830.04311.01
5.2.40.0700.04011.21
5.2.30.0730.04011.03
5.2.20.0800.04011.02
5.2.10.0730.04011.01
5.2.00.0770.03710.75
5.1.60.0700.03710.05
5.1.50.0630.04310.21
5.1.40.0730.03710.01
5.1.30.0830.03710.56
5.1.20.0670.04010.55
5.1.10.0630.04310.16
5.1.00.0570.04310.16
5.0.50.0330.0308.70
5.0.40.0370.0308.52
5.0.30.0370.0478.44
5.0.20.0330.0338.35
5.0.10.0400.0278.22
5.0.00.0330.0478.21
4.4.90.0370.0275.97
4.4.80.0330.0275.93
4.4.70.0300.0276.03
4.4.60.0300.0235.90
4.4.50.0270.0235.94
4.4.40.0300.0335.95
4.4.30.0330.0235.98
4.4.20.0330.0205.95
4.4.10.0030.0275.97
4.4.00.0000.0406.00
4.3.110.0070.0205.91
4.3.100.0130.0135.86
4.3.90.0000.0235.80
4.3.80.0030.0335.80
4.3.70.0030.0205.82
4.3.60.0030.0205.85
4.3.50.0030.0235.80
4.3.40.0000.0375.79
4.3.30.0000.0235.27
4.3.20.0230.0175.27
4.3.10.0200.0205.27
4.3.00.0030.0236.68

preferences:
59.81 ms | 400 KiB | 5 Q