3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thesaurus { protected $synonyms = array( array('wonderful', 'great', 'amazing', 'fabulous'), array('look', 'see', 'observe') ); protected function replace($word) { foreach ($this->synonyms as $synonym) { if (in_array($word, $synonym)) { return $synonym[ array_rand($synonym) ]; } } return $word; } } $thesaurus = new Thesaurus; $description = 'This is my wonderful description. It really is wonderful. Look how wonderful it is.'; foreach (str_split($description, 2) as $word) { $description = str_replace($word, $thesaurus->replace($word), $description); } echo $description, 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.00.0000.01614.89
7.3.120.0070.01114.86
7.3.110.0090.00915.07
7.3.100.0090.00314.84
7.3.90.0080.00814.67
7.3.80.0000.01114.86
7.3.70.0090.00614.70
7.3.60.0000.01114.86
7.3.50.0030.00614.84
7.3.40.0030.01314.85
7.3.30.0040.01114.87
7.3.20.0030.00716.58
7.3.10.0110.00416.68
7.3.00.0000.01416.61
7.2.250.0030.01415.26
7.2.240.0070.01315.20
7.2.230.0070.01415.05
7.2.220.0100.01014.97
7.2.210.0000.01815.03
7.2.200.0040.01515.06
7.2.190.0030.01315.13
7.2.180.0070.00715.12
7.2.170.0060.00915.16
7.2.00.0030.00919.39
7.1.330.0030.01415.90
7.1.320.0000.01015.88
7.1.310.0090.00915.76
7.1.300.0040.00415.60
7.1.290.0070.00715.93
7.1.280.0030.01315.50
7.1.270.0030.01015.80
7.1.260.0040.00715.80
7.1.70.0100.00317.19
7.1.60.0060.01919.70
7.1.50.0140.01016.64
7.1.00.0000.07722.48
7.0.200.0000.00816.80
7.0.140.0000.07722.00
7.0.110.0070.05020.06
7.0.100.0130.07020.13
7.0.90.0070.08719.95
7.0.80.0070.08019.88
7.0.70.0070.05020.01
7.0.60.0030.05020.00
7.0.50.0130.07320.30
7.0.40.0100.07320.25
7.0.30.0070.08320.16
7.0.20.0100.07020.25
7.0.10.0070.08319.95
7.0.00.0100.07720.00
5.6.280.0070.07021.11
5.6.250.0230.06720.66
5.6.240.0130.07720.61
5.6.230.0170.07720.55
5.6.220.0130.07020.57
5.6.210.0070.04720.60
5.6.200.0200.07021.15
5.6.190.0130.07720.95
5.6.180.0100.07321.03
5.6.170.0070.09021.22
5.6.160.0030.08021.29
5.6.150.0070.08321.12
5.6.140.0170.07321.11
5.6.130.0070.07721.13
5.6.120.0030.06021.07
5.6.110.0170.06321.21
5.6.100.0070.07720.94
5.6.90.0100.08320.97
5.6.80.0100.06020.52
5.6.70.0170.04020.44
5.6.60.0100.06020.32
5.6.50.0070.04020.48
5.6.40.0100.07320.58
5.6.30.0130.08020.47
5.6.20.0100.08020.29
5.6.10.0070.08020.48
5.6.00.0070.05320.54
5.5.380.0130.07020.53
5.5.370.0130.07720.55
5.5.360.0170.06720.56
5.5.350.0030.08720.48
5.5.340.0130.07320.85
5.5.330.0030.08320.89
5.5.320.0070.07720.88
5.5.310.0100.07720.78
5.5.300.0070.06020.89
5.5.290.0000.08320.87
5.5.280.0070.08320.96
5.5.270.0130.07321.01
5.5.260.0100.08320.84
5.5.250.0030.07720.70
5.5.240.0070.07720.17
5.5.230.0070.07020.29
5.5.220.0130.07320.22
5.5.210.0070.08020.37
5.5.200.0030.08020.30
5.5.190.0070.08320.13
5.5.180.0030.08320.26
5.5.160.0100.07020.10
5.5.150.0130.07320.16
5.5.140.0170.06320.30
5.5.130.0000.08320.32
5.5.120.0130.06720.26
5.5.110.0030.05320.15
5.5.100.0070.07720.26
5.5.90.0070.08020.26
5.5.80.0070.07320.18
5.5.70.0100.07320.04
5.5.60.0100.03720.26
5.5.50.0070.07320.15
5.5.40.0070.05020.24
5.5.30.0030.08020.03
5.5.20.0070.04720.13
5.5.10.0070.07720.12
5.5.00.0070.07720.13
5.4.450.0030.08719.27
5.4.440.0170.07319.64
5.4.430.0170.06019.28
5.4.420.0030.08719.55
5.4.410.0070.07719.29
5.4.400.0200.06718.95
5.4.390.0130.07019.02
5.4.380.0030.08019.20
5.4.370.0100.07318.95
5.4.360.0070.04719.18
5.4.350.0130.07319.32
5.4.340.0130.07019.03
5.4.320.0070.06019.15
5.4.310.0070.07319.24
5.4.300.0070.07319.09
5.4.290.0070.08019.23
5.4.280.0030.08019.03
5.4.270.0000.08018.95
5.4.260.0130.07019.01
5.4.250.0100.04319.16
5.4.240.0070.07318.97
5.4.230.0070.07019.22
5.4.220.0100.06719.00
5.4.210.0030.08018.98
5.4.200.0070.07318.94
5.4.190.0030.07319.32
5.4.180.0070.07719.00
5.4.170.0130.07019.21
5.4.160.0130.07019.01
5.4.150.0070.07319.14
5.4.140.0070.07716.38
5.4.130.0000.06316.55
5.4.120.0030.07316.54
5.4.110.0100.05016.27
5.4.100.0070.07316.56
5.4.90.0030.07716.36
5.4.80.0130.06316.30
5.4.70.0170.05716.58
5.4.60.0000.07716.49
5.4.50.0000.04016.38
5.4.40.0070.06716.49
5.4.30.0130.06716.43
5.4.20.0100.06716.46
5.4.10.0030.08016.47
5.4.00.0030.05315.77
5.3.290.0030.07714.68
5.3.280.0100.07314.75
5.3.270.0030.04714.64
5.3.260.0030.07714.62
5.3.250.0070.04714.84
5.3.240.0070.07714.59
5.3.230.0130.06014.63
5.3.220.0030.04714.56
5.3.210.0070.04314.80
5.3.200.0100.06314.66
5.3.190.0130.06714.57
5.3.180.0130.07014.58
5.3.170.0170.07014.55
5.3.160.0100.06714.59
5.3.150.0070.07014.64
5.3.140.0100.07014.64
5.3.130.0030.06714.41
5.3.120.0000.04014.64
5.3.110.0070.07714.53
5.3.100.0070.07314.18
5.3.90.0030.06714.16
5.3.80.0230.05314.02
5.3.70.0100.07014.02
5.3.60.0070.07314.03
5.3.50.0030.07014.00
5.3.40.0000.05014.18
5.3.30.0030.07014.14
5.3.20.0070.07013.92
5.3.10.0070.06713.79
5.3.00.0070.07013.65
5.2.170.0030.06711.16
5.2.160.0030.06711.13
5.2.150.0130.05311.12
5.2.140.0070.05311.16
5.2.130.0100.05711.24
5.2.120.0030.06311.21
5.2.110.0030.06311.24
5.2.100.0030.06011.11
5.2.90.0030.06311.17
5.2.80.0100.05711.23
5.2.70.0070.05311.07
5.2.60.0100.05711.07
5.2.50.0030.03711.03
5.2.40.0000.04011.02
5.2.30.0030.05311.00
5.2.20.0070.06011.05
5.2.10.0070.05310.83
5.2.00.0030.05710.68
5.1.60.0030.04310.27
5.1.50.0000.05310.27
5.1.40.0000.04010.27
5.1.30.0000.03010.48
5.1.20.0030.02010.50
5.1.10.0000.02310.27
5.1.00.0000.03010.27
5.0.50.0030.04310.27
5.0.40.0070.04010.27
5.0.30.0070.05710.27
5.0.20.0070.03710.27
5.0.10.0070.04010.27
5.0.00.0070.06010.27
4.4.90.0070.03310.27
4.4.80.0000.03310.27
4.4.70.0000.04010.27
4.4.60.0000.03010.27
4.4.50.0000.02710.27
4.4.40.0000.06010.27
4.4.30.0100.02710.27
4.4.20.0030.01010.27
4.4.10.0000.01310.27
4.4.00.0000.06310.27
4.3.110.0030.02310.27
4.3.100.0000.03710.27
4.3.90.0030.02010.27
4.3.80.0000.04310.27
4.3.70.0030.03310.27
4.3.60.0030.03310.27
4.3.50.0030.02310.27
4.3.40.0000.05310.27
4.3.30.0000.03710.27
4.3.20.0100.02310.27
4.3.10.0030.03310.27
4.3.00.0000.02710.27

preferences:
30.86 ms | 401 KiB | 5 Q