3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Creating dummy variables for ($i = 0; $i < 500; ++$i) ${md5(microtime(true))} = openssl_random_pseudo_bytes(mt_rand(1, 1000)); $items = ["one", "two", "three"]; $ignore = "two"; $iterations = 1000; $preStartTime = microtime(true); for ($i = 0; $i < $iterations; ++$i) { array_filter($items, call_user_func(function ($context·cfcd208495d565ef66e7dff9f98764da) { return function ($item) use ($context·cfcd208495d565ef66e7dff9f98764da) { extract($context·cfcd208495d565ef66e7dff9f98764da); return $item !== $ignore; }; }, get_defined_vars())); } $preTime = microtime(true) - $preStartTime; $vanillaStartTime = microtime(true); for ($i = 0; $i < $iterations; ++$i) { array_filter($items, function ($item) use ($ignore) { return $item !== $ignore; }); } $vanillaTime = microtime(true) - $vanillaStartTime; echo 'Pre: '.($preTime*1000).'ms'.PHP_EOL; echo 'Vanilla: '.($vanillaTime*1000).'ms'.PHP_EOL;

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)
7.4.10.0040.01314.79
7.4.00.0060.01114.85
7.3.130.0090.00914.85
7.3.120.0090.00814.77
7.3.110.0110.00614.85
7.3.100.0040.01114.62
7.3.90.0030.01014.76
7.3.80.0080.00914.66
7.3.70.0040.00714.89
7.3.60.0070.00614.75
7.3.50.0000.01214.74
7.3.40.0080.00614.71
7.3.30.0070.00714.73
7.3.20.0050.01216.71
7.3.10.0050.00616.45
7.3.00.0080.00616.55
7.2.260.0080.01114.82
7.2.250.0040.01114.92
7.2.240.0060.00914.90
7.2.230.0090.00515.16
7.2.220.0050.01014.94
7.2.210.0050.00815.06
7.2.200.0030.00814.92
7.2.190.0060.01015.00
7.2.180.0060.00914.75
7.2.170.0060.00514.71
7.2.160.0020.01314.86
7.2.150.0030.01316.88
7.2.140.0020.01016.83
7.2.130.0060.00716.63
7.2.120.0090.00616.72
7.2.110.0110.00716.72
7.2.100.0080.00816.63
7.2.90.0050.01016.66
7.2.80.0060.01016.61
7.2.70.0080.00616.80
7.2.60.0060.00716.74
7.2.50.0100.00716.67
7.2.40.0080.00716.73
7.2.30.0090.00816.73
7.2.20.0080.00816.74
7.2.10.0090.01016.73
7.2.00.0090.00716.80
7.1.330.0060.00815.79
7.1.320.0100.00515.68
7.1.310.0050.00815.72
7.1.300.0050.00715.62
7.1.290.0070.00915.65
7.1.280.0060.00815.55
7.1.270.0080.00915.65
7.1.260.0050.00515.64
7.1.250.0050.00915.53
7.1.240.0050.00815.76
7.1.230.0000.00915.86
7.1.220.0050.00915.74
7.1.210.0030.01215.84
7.1.200.0040.01015.59
7.1.190.0070.00615.72
7.1.180.0030.01015.64
7.1.170.0060.00615.75
7.1.160.0080.00715.80
7.1.150.0050.00715.62
7.1.140.0040.00815.67
7.1.130.0030.01015.72
7.1.120.0060.00415.57
7.1.110.0060.00715.68
7.1.100.0050.01015.79
7.1.90.0060.00915.56
7.1.80.0060.00715.65
7.1.70.0070.02116.31
7.1.60.0100.00716.29
7.1.50.0020.02016.26
7.1.40.0030.00815.60
7.1.30.0050.00815.84
7.1.20.0040.01215.59
7.1.10.0050.02917.92
7.1.00.0040.03217.94
7.0.330.0050.00515.40
7.0.320.0080.00315.36
7.0.310.0070.00415.29
7.0.300.0040.00915.24
7.0.290.0040.00715.26
7.0.280.0080.00615.37
7.0.270.0080.00415.25
7.0.260.0050.00915.26
7.0.250.0070.00615.47
7.0.240.0070.00915.35
7.0.230.0070.00615.43
7.0.220.0050.00815.38
7.0.210.0080.00615.31
7.0.200.0060.01915.81
7.0.190.0010.00815.48
7.0.180.0060.01115.36
7.0.170.0120.00415.41
7.0.160.0080.00515.30
7.0.150.0060.03117.61
7.0.140.0020.03517.49
7.0.130.0030.03417.64
7.0.120.0060.03117.52
7.0.110.0080.03117.45
7.0.100.0020.03517.53
7.0.90.0060.03517.52
7.0.80.0050.03017.53
7.0.70.0070.03117.46
7.0.60.0090.02817.54
7.0.50.0050.03217.53
7.0.40.0080.02816.17
7.0.30.0080.04416.25
7.0.20.0040.03416.30
7.0.10.0050.03516.14
7.0.00.0060.03416.24
5.6.400.0040.00814.36
5.6.390.0040.00914.24
5.6.380.0040.00614.42
5.6.370.0050.00714.11
5.6.360.0080.01013.96
5.6.350.0030.01014.34
5.6.340.0050.01114.16
5.6.330.0030.01014.00
5.6.320.0050.00814.22
5.6.310.0060.00714.14
5.6.300.0070.00714.55
5.6.290.0020.00714.12
5.6.280.0080.00714.21
5.6.270.0050.00714.17
5.6.260.0030.00914.36
5.6.250.0060.00814.04
5.6.240.0100.00314.36
5.6.230.0100.00114.22
5.6.220.0060.00914.37
5.6.210.0030.00914.15
5.6.200.0020.00814.09
5.6.190.0030.01014.28
5.6.180.0050.01014.22
5.6.170.0030.01014.21
5.6.160.0110.00214.30
5.6.150.0060.00814.10
5.6.140.0040.00714.37
5.6.130.0090.00614.24
5.6.120.0050.00514.19
5.6.110.0080.00614.12
5.6.100.0080.00814.14
5.6.90.0050.01014.08
5.6.80.0050.01114.24
5.6.70.0040.00914.18
5.6.60.0040.00913.97
5.6.50.0020.00914.36
5.6.40.0040.00814.21
5.6.30.0040.01114.21
5.6.20.0080.00614.39
5.6.10.0070.00714.24
5.6.00.0060.00314.14

preferences:
33.12 ms | 403 KiB | 5 Q