3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['black', 'white and black', 'lion', 'fast', 'zebra', 'lion is fast', 'zebra is white']; $str = "zebra is white and black, and lion is fast"; function sortl($a,$b){ return strlen($b)-strlen($a); } usort($arr,'sortl'); foreach($arr as $s){ if(strpos($str, $s) !== false){ $new[] = $s; $str = str_replace($s, "", $str); } } Var_dump($new);

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.5.10.0080.01016.73
8.5.00.0130.00920.06
8.4.150.0010.00214.05
8.4.140.0120.00917.50
8.4.130.0090.01217.83
8.4.120.0060.00420.72
8.4.110.0090.01020.56
8.4.100.0040.00518.87
8.4.90.0050.00320.38
8.4.80.0120.00518.83
8.4.70.0100.01118.04
8.4.60.0120.00917.58
8.4.50.0100.01017.89
8.4.40.0140.00419.36
8.4.30.0120.00317.79
8.4.20.0080.01220.48
8.4.10.0000.00917.70
8.3.280.0120.00918.57
8.3.270.0150.00616.67
8.3.260.0030.00716.66
8.3.250.0110.00718.83
8.3.240.0090.00417.30
8.3.230.0120.00716.76
8.3.220.0110.00718.91
8.3.210.0050.00318.54
8.3.200.0040.00516.45
8.3.190.0080.01116.75
8.3.180.0120.00718.43
8.3.170.0040.00417.41
8.3.160.0070.01118.60
8.3.150.0130.00320.70
8.3.140.0050.00516.48
8.3.130.0090.00618.55
8.3.120.0000.00820.89
8.3.110.0080.00020.94
8.3.100.0080.00024.06
8.3.90.0080.00026.77
8.3.80.0060.00316.48
8.3.70.0090.01216.88
8.3.60.0110.00418.55
8.3.50.0070.00518.19
8.3.40.0120.00318.86
8.3.30.0090.00618.73
8.3.20.0080.00019.34
8.3.10.0080.00023.66
8.3.00.0080.00020.62
8.2.290.0110.00620.20
8.2.280.0110.00718.30
8.2.270.0150.00417.05
8.2.260.0000.00818.46
8.2.250.0000.00916.48
8.2.240.0060.00317.16
8.2.230.0090.00022.58
8.2.220.0090.00037.54
8.2.210.0120.00326.77
8.2.200.0000.00816.63
8.2.190.0090.00916.58
8.2.180.0140.00425.92
8.2.170.0130.00619.09
8.2.160.0100.00320.44
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00018.21
8.2.120.0040.00426.35
8.2.110.0060.00322.14
8.2.100.0120.00017.91
8.2.90.0040.00417.91
8.2.80.0030.00619.34
8.2.70.0040.00417.93
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0000.00819.29
8.2.30.0040.00419.37
8.2.20.0040.00418.18
8.2.10.0040.00418.16
8.2.00.0030.00617.77
8.1.330.0110.00821.96
8.1.320.0090.01016.28
8.1.310.0110.00718.65
8.1.300.0130.00616.30
8.1.290.0030.00718.88
8.1.280.0150.00325.92
8.1.270.0000.00818.94
8.1.260.0050.00326.35
8.1.250.0120.00628.09
8.1.240.0040.00422.66
8.1.230.0070.00421.04
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0130.00017.35
8.1.190.0090.00017.23
8.1.180.0050.00318.10
8.1.170.0030.00618.46
8.1.160.0060.00318.89
8.1.150.0000.00718.90
8.1.140.0030.00322.12
8.1.130.0070.00020.16
8.1.120.0000.00717.45
8.1.110.0000.00917.46
8.1.100.0030.00317.35
8.1.90.0050.00317.38
8.1.80.0000.00717.30
8.1.70.0040.00417.45
8.1.60.0040.00417.51
8.1.50.0030.00517.54
8.1.40.0000.00817.41
8.1.30.0000.00817.55
8.1.20.0030.00617.59
8.1.10.0030.00517.54
8.1.00.0060.00317.32
8.0.300.0000.00920.16
8.0.290.0080.00016.75
8.0.280.0050.00218.32
8.0.270.0040.00417.25
8.0.260.0000.00618.44
8.0.250.0080.00016.99
8.0.240.0030.00316.90
8.0.230.0030.00317.00
8.0.220.0050.00316.98
8.0.210.0000.00717.00
8.0.200.0040.00416.96
8.0.190.0050.00216.94
8.0.180.0050.00316.94
8.0.170.0050.00316.92
8.0.160.0070.00016.78
8.0.150.0030.00516.79
8.0.140.0070.00016.81
8.0.130.0000.00513.35
8.0.120.0040.00416.90
8.0.110.0040.00416.94
8.0.100.0030.00516.82
8.0.90.0040.00416.79
8.0.80.0050.01016.91
8.0.70.0050.00316.75
8.0.60.0050.00216.90
8.0.50.0000.00716.77
8.0.30.0120.00716.99
8.0.20.0140.00617.40
8.0.10.0040.00416.85
8.0.00.0100.00916.76
7.4.330.0030.00315.55
7.4.320.0030.00316.58
7.4.300.0000.00716.50
7.4.290.0030.00316.53
7.4.280.0000.00816.57
7.4.270.0040.00416.43
7.4.260.0050.00216.48
7.4.250.0000.00816.43
7.4.240.0000.00816.52
7.4.230.0000.00716.70
7.4.220.0030.00516.60
7.4.210.0110.01116.53
7.4.200.0030.00316.48
7.4.160.0090.00716.54
7.4.140.0110.00917.86
7.4.130.0040.01816.63
7.4.120.0130.00816.54
7.4.110.0120.01016.62
7.4.100.0070.01316.54
7.4.90.0150.00416.41
7.4.80.0090.00919.39
7.4.70.0100.01016.60
7.4.60.0060.01016.51
7.4.50.0070.00716.18
7.4.40.0130.00416.60
7.4.00.0060.00614.98
7.3.330.0000.00513.22
7.3.320.0030.00313.23
7.3.310.0030.00616.41
7.3.300.0000.00716.27
7.3.290.0000.00716.23
7.3.280.0100.01016.33
7.3.260.0100.00716.38
7.3.240.0080.01116.51
7.3.230.0120.00616.34
7.3.210.0060.01216.65
7.3.200.0130.00316.36
7.3.190.0100.01016.38
7.3.180.0130.00316.39
7.3.170.0090.00616.34
7.3.160.0080.00816.35
7.2.330.0140.00616.68
7.2.320.0110.01416.55
7.2.310.0060.01216.86
7.2.300.0060.01216.46
7.2.290.0040.01716.63
7.2.110.0110.00316.68
7.2.100.0060.00616.70
7.2.90.0140.00316.69
7.2.80.0120.00416.65
7.2.70.0100.00616.71
7.2.60.0070.01016.63
7.2.50.0090.00617.02
7.2.40.0070.00716.93
7.2.30.0070.00716.97
7.2.20.0130.00316.92
7.2.10.0100.00717.04
7.2.00.0110.00717.13
7.1.230.0090.00815.68
7.1.220.0100.00315.84
7.1.210.0080.00415.87
7.1.200.0090.00315.87
7.1.190.0130.00015.74
7.1.180.0040.01115.59
7.1.170.0120.00315.53
7.1.160.0100.00315.63
7.1.150.0130.00015.73
7.1.140.0030.01315.61
7.1.130.0060.00915.84
7.1.120.0030.01015.59
7.1.110.0030.01015.84
7.1.100.0060.00915.64
7.1.90.0000.01715.89
7.1.80.0100.00515.55
7.1.70.0060.00615.64
7.1.60.0330.00733.78
7.1.50.0250.00633.71
7.1.40.0240.00733.56
7.1.30.0280.01033.71
7.1.20.0220.01033.75
7.1.10.0000.01615.59
7.1.00.0090.00315.35
5.6.380.0000.01414.27

preferences:
169.15 ms | 403 KiB | 5 Q