3v4l.org

run code in 300+ PHP versions simultaneously
<?php $interesting_words = [ 'test' => [ 'number_of_occurances' => 0, 'connected_words' => [ 'TEST', 'TESTER', 'TESTING' ] ], 'foobar' => [ 'number_of_occurances' => 0, 'connected_words' => [ 'FOO', 'FOOBAR', 'BAR' ] ] ]; $str = 'Lorem ipsum TEST sit amet, consectetur TESTER elit. Sed in turpis dui. Maecenas venenatis FOOBAR facilisis. Quisque dictum, diam consequat mollis TESTING, orci tellus aliquet nisl, BAR molestie FOO augue at est. In TESTING vehicula lectus. Curabitur ac varius ligula. Pellentesque orci urdna.'; $str = preg_replace('/[\.\,]/i','',$str); $str = strtolower($str); $str_arr = explode(" ",$str); $str_occurance_counts = array_count_values($str_arr); foreach($interesting_words as $k=>&$v){ foreach($v['connected_words'] as $c=>$cVal){ $v['number_of_occurances'] += $str_occurance_counts[strtolower($cVal)]; } echo "Number of occurances for '$k': ".$v['number_of_occurances']."\n"; } print_r($interesting_words ); ?>

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.0030.01418.68
8.3.50.0040.01418.31
8.3.40.0090.00619.10
8.3.30.0080.00818.93
8.3.20.0030.00619.02
8.3.10.0040.00423.61
8.3.00.0040.00421.82
8.2.180.0040.01118.72
8.2.170.0000.01522.96
8.2.160.0120.00319.40
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00819.55
8.2.110.0040.00721.10
8.2.100.0030.00917.97
8.2.90.0050.00317.88
8.2.80.0040.00417.97
8.2.70.0030.00617.93
8.2.60.0030.00618.22
8.2.50.0040.00418.10
8.2.40.0050.00219.50
8.2.30.0000.00720.63
8.2.20.0070.00018.22
8.2.10.0040.00418.13
8.2.00.0040.00419.46
8.1.280.0180.00025.92
8.1.270.0090.00020.82
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0030.00620.75
8.1.230.0000.01022.14
8.1.220.0080.00017.88
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0030.00517.48
8.1.180.0060.00318.10
8.1.170.0050.00318.54
8.1.160.0080.00019.06
8.1.150.0050.00219.03
8.1.140.0050.00218.99
8.1.130.0000.00820.13
8.1.120.0030.00617.48
8.1.110.0000.00717.48
8.1.100.0000.00717.52
8.1.90.0040.00417.62
8.1.80.0050.00317.65
8.1.70.0030.00517.64
8.1.60.0050.00317.75
8.1.50.0040.00417.70
8.1.40.0030.00517.58
8.1.30.0080.00017.77
8.1.20.0030.00617.77
8.1.10.0030.00517.63
8.1.00.0000.00817.64
8.0.300.0000.00718.77
8.0.290.0000.00916.88
8.0.280.0000.00718.38
8.0.270.0030.00317.33
8.0.260.0040.00420.27
8.0.250.0000.01117.12
8.0.240.0000.00717.09
8.0.230.0000.00917.13
8.0.220.0040.00817.11
8.0.210.0000.00717.05
8.0.200.0060.00317.07
8.0.190.0030.00517.17
8.0.180.0000.00817.09
8.0.170.0030.00616.97
8.0.160.0080.00017.02
8.0.150.0040.00416.91
8.0.140.0040.00417.00
8.0.130.0000.00613.48
8.0.120.0040.00417.11
8.0.110.0040.00417.09
8.0.100.0000.00716.98
8.0.90.0040.00417.02
8.0.80.0050.01017.09
8.0.70.0000.00816.96
8.0.60.0050.00217.05
8.0.50.0000.00717.12
8.0.30.0110.00817.40
8.0.20.0120.00817.40
8.0.10.0000.00717.26
8.0.00.0140.00317.02
7.4.330.0050.00015.55
7.4.320.0070.00016.93
7.4.300.0000.00616.88
7.4.290.0000.00816.78
7.4.280.0030.00616.92
7.4.270.0030.00316.80
7.4.260.0040.00416.80
7.4.250.0040.00416.34
7.4.240.0000.00716.68
7.4.230.0000.00716.70
7.4.220.0030.00616.78
7.4.210.0070.01016.86
7.4.200.0040.00416.94
7.4.160.0120.00516.78
7.4.140.0080.01217.86
7.4.130.0130.00816.84
7.4.120.0080.01116.75
7.4.110.0090.01516.84
7.4.100.0090.01216.77
7.4.90.0080.01016.89
7.4.80.0070.01019.39
7.4.70.0000.01716.55
7.4.60.0090.00916.51
7.4.50.0100.00716.91
7.4.40.0100.01316.61
7.4.10.0070.01115.09
7.4.00.0050.01115.05
7.3.330.0050.00013.30
7.3.320.0050.00013.34
7.3.310.0000.00716.41
7.3.300.0000.00716.52
7.3.290.0030.00316.52
7.3.280.0110.00816.48
7.3.260.0110.00916.69
7.3.240.0110.00816.59
7.3.230.0100.00716.85
7.3.210.0060.01416.66
7.3.200.0040.01916.47
7.3.190.0130.00416.48
7.3.180.0000.02216.49
7.3.170.0090.01216.74
7.3.160.0120.00416.47
7.3.130.0080.00814.93
7.3.120.0120.00614.79
7.3.110.0060.01214.73
7.3.100.0030.00915.08
7.3.90.0060.00914.84
7.3.80.0030.01314.88
7.3.70.0090.00614.83
7.3.60.0030.00914.84
7.3.50.0130.00014.98
7.3.40.0030.00915.07
7.3.30.0160.00014.93
7.3.20.0030.01016.85
7.3.10.0110.00216.68
7.3.00.0070.00516.58
7.2.330.0150.00416.96
7.2.320.0130.00316.73
7.2.310.0040.01316.76
7.2.300.0120.00416.96
7.2.290.0080.00816.77
7.2.260.0030.01415.40
7.2.250.0120.00915.27
7.2.240.0060.01014.92
7.2.230.0110.00715.06
7.2.220.0080.00415.15
7.2.210.0000.01515.30
7.2.200.0080.00815.48
7.2.190.0060.00615.36
7.2.180.0090.00314.90
7.2.170.0030.01214.79
7.2.160.0030.01015.18
7.2.150.0090.00016.82
7.2.140.0000.01216.96
7.2.130.0050.01117.11
7.2.120.0060.00817.32
7.2.110.0160.00316.75
7.2.100.0080.00816.96
7.2.90.0680.00816.00
7.2.80.0830.00416.09
7.2.70.0780.00716.25
7.2.60.0830.00816.13
7.2.50.0810.00716.11
7.2.40.0910.00916.18
7.2.30.0660.00816.08
7.2.20.0790.00816.20
7.2.10.0650.00516.16
7.2.00.0680.00816.24
7.1.330.0040.01416.01
7.1.320.0040.00715.83
7.1.310.0070.01015.83
7.1.300.0080.00615.69
7.1.290.0040.01116.19
7.1.280.0150.00016.00
7.1.270.0040.01415.70
7.1.260.0030.00916.07
7.1.250.0030.00815.87
7.1.240.0000.01315.95
7.1.230.0060.00615.81
7.1.220.0030.00916.16
7.1.210.1220.00914.83
7.1.200.0970.00814.62
7.1.190.0890.00414.67
7.1.180.0910.00714.86
7.1.170.1080.00614.65
7.1.160.1050.00914.74
7.1.150.0790.01114.69
7.1.140.1150.01114.61
7.1.130.0990.00814.73
7.1.120.0980.00614.78
7.1.110.0870.00714.79
7.1.100.0990.01014.62
7.1.90.1240.01014.65
7.1.80.1210.00714.58
7.1.70.0840.00614.64
7.1.60.0820.00826.71
7.1.50.1690.01026.82
7.1.40.1070.00626.71
7.1.30.1070.00926.75
7.1.20.1150.01426.69
7.1.10.0920.00714.63
7.1.00.0870.00614.64
7.0.330.0070.00715.63
7.0.320.0070.00315.70
7.0.310.0930.00914.26
7.0.300.1140.00514.12
7.0.290.0780.01414.63
7.0.280.0860.00614.33
7.0.270.0900.00614.69
7.0.260.0710.00714.29
7.0.250.0790.00214.79
7.0.240.0970.00314.84
7.0.230.0760.00814.65
7.0.220.0640.00914.69
7.0.210.0420.01114.87
7.0.200.0630.01414.77
7.0.190.0510.01414.63
7.0.180.0450.00814.75
7.0.170.0400.00814.70
7.0.160.0630.00714.75
7.0.150.0560.00714.54
7.0.140.0480.00514.59
7.0.130.0410.01114.74
7.0.120.0350.01014.59
7.0.110.0570.00314.49
7.0.100.0350.01214.72
7.0.90.0370.00614.50
7.0.80.0420.00514.58
7.0.70.0310.01014.52
7.0.60.0240.01414.53
7.0.50.0420.00914.68
7.0.40.0430.00713.80
7.0.30.0410.01013.54
7.0.20.0350.01113.56
7.0.10.0290.00513.59
7.0.00.0520.00513.70
5.6.400.0000.01114.44
5.6.390.0000.00914.46
5.6.380.0100.00314.44
5.6.370.0080.00414.63
5.6.360.0100.01014.25
5.6.350.0070.00714.19
5.6.340.0030.00914.14
5.6.330.0030.01014.04
5.6.320.0100.00714.50
5.6.310.0030.01314.52
5.6.300.0130.00414.43
5.6.290.0100.01014.66
5.6.280.0120.00914.76
5.6.270.0090.01114.55
5.6.260.0090.00814.56
5.6.250.0080.01214.26
5.6.240.0090.01114.47
5.6.230.0050.01114.33
5.6.220.0070.01314.41
5.6.210.0100.00714.34
5.6.200.0090.00714.14
5.6.190.0120.00514.32
5.6.180.0050.01014.56
5.6.170.0140.00514.41
5.6.160.0100.00814.35
5.6.150.0070.01514.22
5.6.140.0100.00714.31
5.6.130.0090.00414.46
5.6.120.0160.00514.50
5.6.110.0090.01014.38
5.6.100.0090.00914.33
5.6.90.0030.01314.23
5.6.80.0100.00914.15
5.6.70.0070.00714.29
5.6.60.0090.00814.55
5.6.50.0090.00514.51
5.6.40.0130.00414.40
5.6.30.0080.00714.31
5.6.20.0070.00714.27
5.6.10.0110.00914.43
5.6.00.0110.00514.26
5.5.380.0130.00411.48
5.5.370.0110.00711.23
5.5.360.0120.00611.39
5.5.350.0130.00411.27
5.5.340.0080.00811.46
5.5.330.0120.00311.42
5.5.320.0080.00811.24
5.5.310.0180.00011.52
5.5.300.0090.00611.05
5.5.290.0100.00611.23
5.5.280.0140.00411.46
5.5.270.0090.00511.18
5.5.260.0090.00611.20
5.5.250.0110.00711.20
5.5.240.0180.00011.37
5.5.230.0050.01011.31
5.5.220.0100.00611.27
5.5.210.0090.00911.41
5.5.200.0070.00711.35
5.5.190.0080.00811.24
5.5.180.0090.00911.29
5.5.170.0140.01014.54
5.5.160.0100.00711.39
5.5.150.0080.00811.39
5.5.140.0110.00511.07
5.5.130.0130.00411.32
5.5.120.0090.00911.05
5.5.110.0170.00011.12
5.5.100.0120.00411.44
5.5.90.0180.00011.27
5.5.80.0090.00811.49
5.5.70.0090.00911.38
5.5.60.0100.00511.34
5.5.50.0110.00611.21
5.5.40.0100.00311.35
5.5.30.0080.00610.95
5.5.20.0120.00711.41
5.5.10.0180.00311.09
5.5.00.0180.00011.09
5.4.450.0130.00611.13
5.4.440.0180.00011.11
5.4.430.0080.00811.21
5.4.420.0130.00211.39
5.4.410.0110.00311.12
5.4.400.0120.00411.43
5.4.390.0130.00411.06
5.4.380.0100.00511.11
5.4.370.0030.01011.09
5.4.360.0090.00910.99
5.4.350.0160.00011.07
5.4.340.0090.00611.02
5.4.330.0080.00810.86
5.4.320.0100.00711.14
5.4.310.0090.00511.32
5.4.300.0140.00311.29
5.4.290.0170.00011.46
5.4.280.0080.00611.06
5.4.270.0090.00511.32
5.4.260.0100.00311.15
5.4.250.0100.00711.24
5.4.240.0160.00311.22
5.4.230.0080.00510.89
5.4.220.0050.01011.03
5.4.210.0000.01510.93
5.4.200.0110.00511.16
5.4.190.0100.00310.91
5.4.180.0110.00710.95
5.4.170.0090.00410.88
5.4.160.0080.00811.20
5.4.150.0080.00811.36
5.4.140.0100.00711.19
5.4.130.0050.01011.16
5.4.120.0100.00811.12
5.4.110.0040.01211.06
5.4.100.0120.00311.27
5.4.90.0100.00711.14
5.4.80.0160.00311.32
5.4.70.0070.00811.18
5.4.60.0080.00811.45
5.4.50.0160.00011.00
5.4.40.0120.00411.23
5.4.30.0060.00911.32
5.4.20.0100.00511.09
5.4.10.0160.00011.26
5.4.00.0090.00710.81
5.3.290.0110.00410.46
5.3.280.0040.00710.46
5.3.270.0060.00710.46
5.3.260.0120.00010.46
5.3.250.0060.00610.46
5.3.240.0080.00410.46
5.3.230.0070.00710.46
5.3.220.0050.01010.46
5.3.210.0120.00310.46
5.3.200.0090.00210.46
5.3.190.0040.01110.46
5.3.180.0130.00010.46
5.3.170.0090.00510.46
5.3.160.0080.00510.46
5.3.150.0090.00310.46
5.3.140.0080.00410.46
5.3.130.0070.00710.46
5.3.120.0080.00410.46
5.3.110.0070.00710.46
5.3.100.0090.00610.46
5.3.90.0020.01210.46
5.3.80.0120.00010.46
5.3.70.0080.00510.46
5.3.60.0100.00310.46
5.3.50.0040.00910.46
5.3.40.0060.00610.46
5.3.30.0080.00610.46
5.3.20.0040.00710.46
5.3.10.0070.00410.46
5.3.00.0090.00310.46
5.2.170.0080.00410.46
5.2.160.0080.00410.46
5.2.150.0070.00410.46
5.2.140.0030.00610.46
5.2.130.0070.00710.46
5.2.120.0050.00510.46
5.2.110.0110.00010.46
5.2.100.0080.00310.46
5.2.90.0090.00310.46
5.2.80.0090.00010.46
5.2.70.0080.00310.46
5.2.60.0070.00510.46
5.2.50.0080.00310.46
5.2.40.0100.00310.46
5.2.30.0040.00710.46
5.2.20.0050.00510.46
5.2.10.0110.00010.46
5.2.00.0040.00810.46
5.1.60.0050.00310.46
5.1.50.0000.00910.46
5.1.40.0080.00210.46
5.1.30.0050.00510.46
5.1.20.0110.00010.46
5.1.10.0080.00410.46
5.1.00.0100.00010.46
5.0.50.0040.00410.46
5.0.40.0040.00410.46
5.0.30.0060.00310.46
5.0.20.0080.00010.46
5.0.10.0000.00710.46
5.0.00.0080.00010.46
4.4.90.0060.00010.46
4.4.80.0070.00010.46
4.4.70.0050.00310.46
4.4.60.0000.00810.46
4.4.50.0050.00310.46
4.4.40.0060.00010.46
4.4.30.0000.00710.46
4.4.20.0050.00210.46
4.4.10.0000.00610.46
4.4.00.0030.00310.46
4.3.110.0000.00610.46
4.3.100.0050.00310.46
4.3.90.0020.00510.46
4.3.80.0000.00510.46
4.3.70.0040.00410.46
4.3.60.0020.00410.46
4.3.50.0060.00010.46
4.3.40.0050.00010.46
4.3.30.0000.00510.46
4.3.20.0000.00610.46
4.3.10.0000.00510.46
4.3.00.0000.00610.46

preferences:
69.2 ms | 400 KiB | 5 Q