3v4l.org

run code in 300+ PHP versions simultaneously
<?php $grades = array( "PK", "K", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ); function normalizeLexileScore($ability, $grade_level = null, $cast = false) { if( $grade_level == null ) { return $ability; } if ($cast) { $grade_level = (int)$grade_level; } $grade_level = max(min($grade_level, 9), 2); $gli_cap = array(NULL, NULL, 975, 1070, 1165, 1250, 1300, 1370, 1420, 1500); $normalized = @min($ability, @$gli_cap[$grade_level]); return $normalized; } foreach ($grades as $grade) { $minBad = normalizeLexileScore(0, $grade, false); $maxBad = normalizeLexileScore(2000, $grade, false); $minGood = normalizeLexileScore(0, $grade, true); $maxGood = normalizeLexileScore(2000, $grade, true); printf("Grade %2s: Bad: %4d < %4d, Good: %4d < %4d\n", $grade, $minBad, $maxBad, $minGood, $maxGood); }

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.0000.01418.43
8.3.50.0110.01021.02
8.3.40.0040.01118.70
8.3.30.0000.01419.06
8.3.20.0050.00320.29
8.3.10.0080.00020.70
8.3.00.0040.00419.38
8.2.180.0120.00918.41
8.2.170.0180.00322.96
8.2.160.0100.00320.49
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00822.06
8.2.110.0070.00321.10
8.2.100.0060.00617.84
8.2.90.0050.00319.20
8.2.80.0020.00517.97
8.2.70.0060.00317.63
8.2.60.0000.00818.05
8.2.50.0040.00418.10
8.2.40.0040.00420.59
8.2.30.0000.00819.14
8.2.20.0000.00717.84
8.2.10.0080.00018.14
8.2.00.0030.00617.91
8.1.280.0130.00725.92
8.1.270.0030.00622.14
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0030.00622.67
8.1.230.0070.00417.57
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0030.00617.25
8.1.190.0050.00317.22
8.1.180.0030.00518.10
8.1.170.0060.00318.65
8.1.160.0030.00522.16
8.1.150.0040.00418.91
8.1.140.0000.00717.53
8.1.130.0070.00017.90
8.1.120.0030.00517.54
8.1.110.0000.00717.46
8.1.100.0030.00317.39
8.1.90.0070.00017.47
8.1.80.0000.00717.50
8.1.70.0000.00717.42
8.1.60.0030.00617.59
8.1.50.0040.00417.51
8.1.40.0030.00617.59
8.1.30.0040.00417.66
8.1.20.0040.00417.64
8.1.10.0000.00717.50
8.1.00.0040.00417.55
8.0.300.0070.00418.77
8.0.290.0000.00816.88
8.0.280.0000.00818.51
8.0.270.0030.00317.21
8.0.260.0070.00017.18
8.0.250.0000.00717.07
8.0.240.0000.00817.06
8.0.230.0030.00316.95
8.0.220.0020.00516.89
8.0.210.0000.00716.98
8.0.200.0030.00317.04
8.0.190.0050.00317.04
8.0.180.0070.00016.89
8.0.170.0000.00817.02
8.0.160.0040.00417.09
8.0.150.0070.00016.92
8.0.140.0000.00716.98
8.0.130.0000.00513.41
8.0.120.0040.00416.82
8.0.110.0000.00716.97
8.0.100.0080.00017.00
8.0.90.0070.00016.87
8.0.80.0070.01117.02
8.0.70.0040.00416.86
8.0.60.0030.00516.96
8.0.50.0070.00016.88
8.0.30.0090.00917.04
8.0.20.0080.01517.40
8.0.10.0000.00816.95
8.0.00.0090.01016.80
7.4.330.0020.00215.09
7.4.320.0030.00316.66
7.4.300.0030.00316.50
7.4.290.0080.00016.51
7.4.280.0040.00416.65
7.4.270.0000.00716.50
7.4.260.0070.00016.59
7.4.250.0080.00016.47
7.4.240.0040.00416.58
7.4.230.0070.00016.47
7.4.220.0090.00916.69
7.4.210.0120.00916.55
7.4.200.0050.00316.64
7.4.160.0130.01016.55
7.4.150.0140.00717.40
7.4.140.0130.00817.86
7.4.130.0100.00716.58
7.4.120.0050.01216.50
7.4.110.0030.01316.56
7.4.100.0060.01116.52
7.4.90.0150.01216.55
7.4.80.0060.01219.37
7.4.70.0120.00416.37
7.4.60.0100.01016.51
7.4.50.0050.00316.28
7.4.40.0110.00516.65
7.4.30.0140.00516.73
7.4.10.0030.01414.93
7.4.00.0050.01215.04
7.3.330.0040.00413.21
7.3.320.0060.00013.17
7.3.310.0030.00316.37
7.3.300.0000.00716.23
7.3.290.0060.00916.42
7.3.280.0080.00816.41
7.3.270.0120.00917.40
7.3.260.0130.00416.43
7.3.250.0140.00516.54
7.3.240.0110.00716.43
7.3.230.0040.01416.39
7.3.210.0140.00316.68
7.3.200.0120.00919.39
7.3.190.0100.00616.40
7.3.180.0090.00616.45
7.3.170.0090.00616.49
7.3.160.0040.01216.68
7.3.130.0130.00614.81
7.3.120.0090.00614.88
7.3.110.0100.01014.90
7.3.100.0070.01014.95
7.3.90.0030.01014.95
7.3.80.0040.01215.07
7.3.70.0030.00814.82
7.3.60.0070.00714.64
7.3.50.0030.01014.50
7.3.40.0110.00314.96
7.3.30.0060.01214.79
7.3.20.0040.00816.75
7.3.10.0080.00816.66
7.3.00.0090.00316.81
7.2.330.0070.01016.85
7.2.320.0110.00616.76
7.2.310.0090.01016.81
7.2.300.0070.01016.48
7.2.290.0070.01016.66
7.2.260.0120.00315.00
7.2.250.0130.00715.35
7.2.240.0130.00314.58
7.2.230.0040.01515.23
7.2.220.0070.00715.20
7.2.210.0060.00615.02
7.2.200.0030.00915.00
7.2.190.0060.00914.89
7.2.180.0070.01115.03
7.2.170.0030.01015.15
7.2.160.0080.00815.25
7.2.150.0000.00916.88
7.2.140.0040.00817.00
7.2.130.0030.01016.90
7.2.120.0060.01017.09
7.2.110.0090.00317.02
7.2.100.0060.00917.00
7.2.90.0090.00317.01
7.2.80.0030.01417.09
7.2.70.0070.00716.61
7.2.60.0030.01016.91
7.2.50.0060.00916.87
7.2.40.0070.00317.02
7.2.30.0060.00616.90
7.2.20.0060.00916.96
7.2.10.0000.01117.18
7.2.00.0050.01018.26
7.1.330.0060.00315.96
7.1.320.0080.00315.77
7.1.310.0030.00715.63
7.1.300.0030.01015.96
7.1.290.0090.00915.77
7.1.280.0000.01415.69
7.1.270.0070.00315.82
7.1.260.0000.01315.80
7.1.250.0080.00415.90
7.1.240.0040.00715.56
7.1.230.0030.01015.80
7.1.220.0000.01515.77
7.1.210.0040.00815.88
7.1.200.0060.00915.83
7.1.190.0120.00016.02
7.1.180.0000.01215.73
7.1.170.0060.00615.82
7.1.160.0140.00015.93
7.1.150.0070.00715.98
7.1.140.0080.00415.67
7.1.130.0080.00415.74
7.1.120.0030.01215.89
7.1.110.0040.00915.71
7.1.100.0050.00716.98
7.1.90.0060.01015.48
7.1.80.0000.01515.66
7.1.70.0050.00316.49
7.1.60.0090.00917.54
7.1.50.0050.01416.09
7.1.40.0060.00615.71
7.1.30.0040.00415.83
7.1.20.0050.00515.63
7.1.10.0030.01015.75
7.1.00.0020.04219.03
7.0.330.0070.00715.33
7.0.320.0070.00715.29
7.0.310.0030.01315.38
7.0.300.0060.00615.41
7.0.290.0070.00315.22
7.0.280.0040.01215.61
7.0.270.0030.01015.25
7.0.260.0030.00615.46
7.0.250.0090.00015.20
7.0.240.0050.00515.49
7.0.230.0070.00715.50
7.0.220.0070.00715.46
7.0.210.0060.00615.40
7.0.200.0040.00415.97
7.0.190.0030.00615.49
7.0.180.0000.01415.43
7.0.170.0040.00415.19
7.0.160.0080.00415.53
7.0.150.0030.00515.48
7.0.140.0020.04218.79
7.0.130.0070.00715.62
7.0.120.0050.00315.20
7.0.110.0130.04217.45
7.0.100.0110.04417.69
7.0.90.0100.02717.57
7.0.80.0120.04017.79
7.0.70.0100.04317.79
7.0.60.0100.03617.65
7.0.50.0100.02217.88
7.0.40.0120.01816.78
7.0.30.0050.02516.70
7.0.20.0030.03516.65
7.0.10.0110.03916.75
7.0.00.0120.04016.79
5.6.400.0000.00914.71
5.6.390.0100.00314.39
5.6.380.0090.00314.42
5.6.370.0030.01314.43
5.6.360.0060.00614.25
5.6.350.0000.01114.23
5.6.340.0060.00914.67
5.6.330.0030.00714.70
5.6.320.0030.01014.32
5.6.310.0090.00914.56
5.6.300.0060.00814.25
5.6.290.0070.00714.63
5.6.280.0060.03817.67
5.6.270.0030.01014.29
5.6.260.0030.04717.51
5.6.250.0070.04217.52
5.6.240.0030.04817.54
5.6.230.0120.04217.56
5.6.220.0120.03517.38
5.6.210.0050.02817.52
5.6.200.0070.02717.75
5.6.190.0120.01717.67
5.6.180.0020.02517.63
5.6.170.0070.02317.77
5.6.160.0050.04517.73
5.6.150.0000.04517.72
5.6.140.0050.04717.86
5.6.130.0070.04917.63
5.6.120.0090.02217.87
5.6.110.0040.03217.92
5.6.100.0050.02817.84
5.6.90.0080.02517.71
5.6.80.0030.02317.43
5.6.70.0030.02517.30
5.6.60.0030.02317.40
5.6.50.0070.02317.28
5.6.40.0050.02117.16
5.6.30.0090.02017.43
5.6.20.0050.03917.46
5.6.10.0050.02317.46
5.6.00.0030.03117.41
5.5.380.0060.04517.40
5.5.370.0050.04517.38
5.5.360.0070.04317.19
5.5.350.0070.02317.27
5.5.340.0060.02417.46
5.5.330.0050.02317.45
5.5.320.0040.04517.49
5.5.310.0070.02117.71
5.5.300.0050.04317.61
5.5.290.0090.04417.70
5.5.280.0050.02317.68
5.5.270.0070.04017.54
5.5.260.0080.02717.63
5.5.250.0050.03517.48
5.5.240.0030.02217.32
5.5.230.0050.02617.18
5.5.220.0040.02417.29
5.5.210.0050.02417.28
5.5.200.0040.02417.24
5.5.190.0070.02317.33
5.5.180.0030.02617.20
5.5.170.0100.00314.09
5.5.160.0050.02317.32
5.5.150.0060.02517.19
5.5.140.0050.02317.18
5.5.130.0010.02417.31
5.5.120.0050.02317.32
5.5.110.0030.02717.29
5.5.100.0070.02717.28
5.5.90.0060.01917.05
5.5.80.0060.02417.30
5.5.70.0050.02817.26
5.5.60.0050.03717.22
5.5.50.0070.04117.13
5.5.40.0040.04417.01
5.5.30.0110.03617.18
5.5.20.0070.03717.33
5.5.10.0110.04117.29
5.5.00.0120.04317.15
5.4.450.0060.02215.27
5.4.440.0050.02315.43
5.4.430.0060.02015.29
5.4.420.0100.04015.13
5.4.410.0050.02015.35
5.4.400.0060.02115.09
5.4.390.0030.02215.15
5.4.380.0030.02315.14
5.4.370.0070.01615.06
5.4.360.0040.02915.03
5.4.350.0050.03015.24
5.4.340.0050.01815.03
5.4.330.0000.01011.07
5.4.320.0020.02715.25
5.4.310.0030.02215.00
5.4.300.0030.02014.97
5.4.290.0020.02315.00
5.4.280.0030.02315.09
5.4.270.0050.02215.09
5.4.260.0030.03215.00
5.4.250.0020.02314.88
5.4.240.0030.02315.19
5.4.230.0050.02015.30
5.4.220.0050.02515.12
5.4.210.0080.03715.16
5.4.200.0040.04014.91
5.4.190.0030.02515.13
5.4.180.0000.04815.03
5.4.170.0070.02115.03
5.4.160.0070.03714.91
5.4.150.0070.04315.21
5.4.140.0020.04213.83
5.4.130.0070.04113.76
5.4.120.0030.03413.87
5.4.110.0100.03113.85
5.4.100.0060.03513.85
5.4.90.0070.02313.78
5.4.80.0040.03013.73
5.4.70.0080.03513.71
5.4.60.0080.03513.70
5.4.50.0090.03713.75
5.4.40.0070.03913.83
5.4.30.0050.03813.72
5.4.20.0030.02813.76
5.4.10.0080.03613.84
5.4.00.0050.04013.54
5.3.290.0030.04014.68
5.3.280.0000.06314.56
5.3.270.0030.06714.61
5.3.260.0030.06314.64
5.3.250.0170.06314.64
5.3.240.0100.07014.63
5.3.230.0070.06014.71
5.3.220.0100.05714.80
5.3.210.0030.04714.43
5.3.200.0030.07714.55
5.3.190.0070.07714.61
5.3.180.0000.05714.53
5.3.170.0070.04714.53
5.3.160.0100.07314.70
5.3.150.0030.08014.58
5.3.140.0030.07014.52
5.3.130.0170.07014.41
5.3.120.0130.07314.53
5.3.110.0130.07014.56
5.3.100.0170.06714.13
5.3.90.0070.06314.00
5.3.80.0030.07714.01
5.3.70.0070.07314.10
5.3.60.0030.05713.96
5.3.50.0170.06313.96
5.3.40.0030.07714.01
5.3.30.0130.06314.05
5.3.20.0000.07713.70
5.3.10.0100.07013.67
5.3.00.0030.03713.63
5.2.170.0100.05711.12
5.2.160.0070.06011.15
5.2.150.0000.04011.29
5.2.140.0130.05311.16
5.2.130.0030.06711.12
5.2.120.0030.05311.09
5.2.110.0000.03711.33
5.2.100.0130.05011.06
5.2.90.0000.07011.11
5.2.80.0100.06011.13
5.2.70.0030.06311.09
5.2.60.0000.07011.03
5.2.50.0100.05711.05
5.2.40.0070.06011.02
5.2.30.0000.04011.00
5.2.20.0070.04311.05
5.2.10.0070.05710.86
5.2.00.0030.05010.84
5.1.60.0030.05310.84
5.1.50.0000.05710.84
5.1.40.0000.04310.84
5.1.30.0000.06010.84
5.1.20.0030.05710.84
5.1.10.0030.05710.84
5.1.00.0030.04310.84
5.0.50.0070.04710.84
5.0.40.0030.03710.84
5.0.30.0030.06310.84
5.0.20.0100.04010.84
5.0.10.0000.04710.84
5.0.00.0100.05010.84
4.4.90.0000.04010.84
4.4.80.0030.03710.84
4.4.70.0000.03710.84
4.4.60.0100.03010.84
4.4.50.0070.03010.84
4.4.40.0170.03710.84
4.4.30.0030.03710.84
4.4.20.0030.01710.84
4.4.10.0000.04010.84
4.4.00.0030.05310.84
4.3.110.0030.03310.84
4.3.100.0030.03710.84
4.3.90.0030.02310.84
4.3.80.0070.05310.84
4.3.70.0070.03010.84
4.3.60.0000.02710.84
4.3.50.0070.03310.84
4.3.40.0030.05310.84
4.3.30.0000.02010.84
4.3.20.0000.02710.84
4.3.10.0000.03310.84
4.3.00.0000.01710.84

preferences:
37.5 ms | 401 KiB | 5 Q