3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thesaurus { protected $synonyms = array( array('wonderful', 'great', 'amazing', 'fabulous'), array('look', 'see', 'observe') ); public 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.0100.01015.07
7.3.120.0060.00914.72
7.3.110.0030.01314.92
7.3.100.0070.00914.80
7.3.90.0020.01114.87
7.3.80.0050.00914.71
7.3.70.0060.00614.75
7.3.60.0020.01114.66
7.3.50.0010.01314.83
7.3.40.0020.01214.67
7.3.30.0000.01114.46
7.3.20.0040.00516.69
7.3.10.0080.00616.43
7.3.00.0030.00816.55
7.2.250.0130.00314.84
7.2.240.0070.00815.24
7.2.230.0050.00715.23
7.2.220.0070.00615.15
7.2.210.0050.00815.08
7.2.200.0050.00514.99
7.2.190.0050.01015.02
7.2.180.0060.00814.78
7.2.170.0100.00515.16
7.2.160.0070.00315.03
7.2.150.0090.00317.02
7.2.140.0040.00816.62
7.2.130.0040.01216.77
7.2.120.0040.01117.11
7.2.110.0050.00517.09
7.2.100.0040.00916.69
7.2.90.0060.00616.82
7.2.80.0030.00717.21
7.2.70.0040.00817.13
7.2.60.0040.01116.93
7.2.50.0120.00016.93
7.2.40.0060.00616.82
7.2.30.0090.00616.71
7.2.20.0110.00316.98
7.2.10.0000.01016.82
7.2.00.0030.01217.08
7.1.330.0060.00815.65
7.1.320.0040.00815.58
7.1.310.0120.00515.92
7.1.300.0080.00615.75
7.1.290.0060.00715.77
7.1.280.0050.00715.66
7.1.270.0050.00915.58
7.1.260.0060.00615.74
7.1.250.0030.00715.94
7.1.70.0130.00316.90
7.1.60.0150.00919.70
7.1.50.0070.01717.02
7.1.00.0000.08022.35
7.0.200.0000.00816.88
7.0.140.0000.07722.12
7.0.70.0000.04021.74
7.0.60.0030.07021.76
7.0.50.0070.06722.06
7.0.40.0030.07020.13
7.0.30.0100.03320.17
7.0.20.0000.07020.19
7.0.10.0030.08720.02
7.0.00.0070.08319.94
5.6.280.0030.07720.87
5.6.220.0100.07720.68
5.6.210.0000.04320.65
5.6.200.0030.09321.03
5.6.190.0100.07021.06
5.6.180.0070.08721.14
5.6.170.0070.08721.04
5.6.160.0070.06021.07
5.6.150.0030.08321.10
5.6.140.0100.08720.96
5.6.130.0030.07020.96
5.6.120.0130.07721.08
5.6.110.0100.07721.10
5.6.100.0030.08021.08
5.6.90.0000.06721.15
5.6.80.0030.08320.47
5.6.70.0070.08020.48
5.6.60.0030.06020.32
5.6.50.0100.07720.43
5.6.40.0100.07720.32
5.6.30.0000.04320.37
5.6.20.0170.07320.42
5.6.10.0030.05720.33
5.6.00.0170.06720.38
5.5.360.0000.05020.36
5.5.350.0030.08320.34
5.5.340.0100.08320.88
5.5.330.0070.08020.91
5.5.320.0000.05720.78
5.5.310.0000.08720.86
5.5.300.0000.07320.94
5.5.290.0070.07320.73
5.5.280.0070.07720.84
5.5.270.0030.05020.79
5.5.260.0000.07020.82
5.5.250.0000.09020.70
5.5.240.0000.08720.21
5.5.230.0070.07320.31
5.5.220.0100.07320.27
5.5.210.0000.05320.25
5.5.200.0070.07720.19
5.5.190.0030.06320.16
5.5.180.0030.06320.21
5.5.160.0070.07720.27
5.5.150.0030.08020.08
5.5.140.0000.08720.13
5.5.130.0100.05020.27
5.5.120.0070.07320.12
5.5.110.0130.08020.25
5.5.100.0070.08020.11
5.5.90.0000.05320.05
5.5.80.0030.08020.16
5.5.70.0030.06020.07
5.5.60.0070.05720.16
5.5.50.0030.08320.12
5.5.40.0070.05320.00
5.5.30.0030.07320.08
5.5.20.0070.03719.93
5.5.10.0030.04320.02
5.5.00.0030.08720.11
5.4.450.0070.06019.42
5.4.440.0070.06019.45
5.4.430.0000.04319.19
5.4.420.0030.05319.41
5.4.410.0030.04019.14
5.4.400.0000.04319.03
5.4.390.0070.05319.16
5.4.380.0170.06719.05
5.4.370.0030.07719.15
5.4.360.0030.07019.18
5.4.350.0070.04718.88
5.4.340.0070.07319.12
5.4.320.0070.06018.95
5.4.310.0100.07718.95
5.4.300.0030.07719.04
5.4.290.0000.08718.95
5.4.280.0030.08018.87
5.4.270.0100.08019.16
5.4.260.0100.05718.95
5.4.250.0030.06319.25
5.4.240.0070.06019.22
5.4.230.0030.05019.04
5.4.220.0130.07018.87
5.4.210.0070.07719.13
5.4.200.0100.07319.13
5.4.190.0000.05019.13
5.4.180.0030.07719.04
5.4.170.0000.04019.13
5.4.160.0170.06719.03
5.4.150.0000.04319.12
5.4.140.0000.07716.41
5.4.130.0030.07016.41
5.4.120.0130.03016.34
5.4.110.0030.07716.51
5.4.100.0000.07316.39
5.4.90.0070.07316.34
5.4.80.0070.07016.59
5.4.70.0000.06316.50
5.4.60.0030.07716.46
5.4.50.0070.07016.33
5.4.40.0000.07016.46
5.4.30.0030.07016.36
5.4.20.0000.07316.32
5.4.10.0000.07716.41
5.4.00.0070.06015.79
5.3.290.0070.04714.66
5.3.280.0030.04314.70
5.3.270.0070.07014.63
5.3.260.0030.08014.66
5.3.250.0000.06014.55
5.3.240.0000.08714.53
5.3.230.0030.04014.67
5.3.220.0000.04714.50
5.3.210.0070.07714.68
5.3.200.0070.04714.58
5.3.190.0000.07014.64
5.3.180.0030.06314.68
5.3.170.0030.07714.50
5.3.160.0030.04014.54
5.3.150.0070.07714.60
5.3.140.0070.05714.57
5.3.130.0000.07714.50
5.3.120.0030.08714.62
5.3.110.0100.07014.61
5.3.100.0000.07014.02
5.3.90.0000.07014.09
5.3.80.0030.07314.08
5.3.70.0030.07714.13
5.3.60.0000.04713.91
5.3.50.0000.03713.97
5.3.40.0030.03314.01
5.3.30.0030.07714.02
5.3.20.0000.05313.75
5.3.10.0000.03713.75
5.3.00.0030.06013.78
5.2.170.0000.06012.37
5.2.160.0000.05712.37
5.2.150.0000.03012.37
5.2.140.0000.06012.37
5.2.130.0000.06012.37
5.2.120.0000.06712.37
5.2.110.0000.02712.37
5.2.100.0030.02712.37
5.2.90.0000.03012.37
5.2.80.0000.03312.37
5.2.70.0030.03712.37
5.2.60.0000.06012.37
5.2.50.0030.06012.37
5.2.40.0000.06012.37
5.2.30.0030.03712.37
5.2.20.0030.02712.37
5.2.10.0000.04012.37
5.2.00.0000.06012.37
5.1.60.0070.05012.37
5.1.50.0030.03312.37
5.1.40.0000.03312.37
5.1.30.0070.05012.37
5.1.20.0030.03712.37
5.1.10.0030.05312.37
5.1.00.0100.04712.37
5.0.50.0000.02712.37
5.0.40.0030.05012.37
5.0.30.0000.06712.37
5.0.20.0000.02312.37
5.0.10.0070.03712.37
5.0.00.0000.05012.37
4.4.90.0030.02712.37
4.4.80.0030.02712.37
4.4.70.0000.02012.37
4.4.60.0000.03712.37
4.4.50.0000.03012.37
4.4.40.0000.05312.37
4.4.30.0030.02312.37
4.4.20.0030.03312.37
4.4.10.0030.02012.37
4.4.00.0000.05312.37
4.3.110.0000.02712.37
4.3.100.0000.03312.37
4.3.90.0000.02712.37
4.3.80.0030.05012.37
4.3.70.0000.03312.37
4.3.60.0000.02712.37
4.3.50.0000.03712.37
4.3.40.0000.02712.37
4.3.30.0000.01712.37
4.3.20.0000.01712.37
4.3.10.0000.01712.37
4.3.00.0000.03712.37

preferences:
38.39 ms | 400 KiB | 5 Q