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_word_count($description) 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.10.0040.01114.94
7.4.00.0030.01414.98
7.3.130.0060.01215.04
7.3.120.0070.01114.62
7.3.110.0130.00714.93
7.3.100.0080.00614.73
7.3.90.0030.01014.86
7.3.80.0030.00914.91
7.3.70.0070.00714.72
7.3.60.0070.00714.96
7.3.50.0050.00514.88
7.3.40.0110.00314.95
7.3.30.0070.00314.67
7.3.20.0110.00416.56
7.3.10.0000.01316.26
7.3.00.0030.00616.41
7.2.260.0030.01414.98
7.2.250.0070.01014.86
7.2.240.0000.01415.18
7.2.230.0060.01314.77
7.2.220.0090.00915.04
7.2.210.0030.01014.86
7.2.200.0030.01314.96
7.2.190.0060.00714.96
7.2.180.0080.00415.00
7.2.170.0030.01314.69
7.2.160.0040.00414.89
7.2.150.0070.01016.63
7.2.140.0030.01316.92
7.2.130.0000.01516.85
7.2.120.0070.00716.95
7.2.110.0080.00616.96
7.2.100.0040.01116.95
7.2.90.0030.01516.96
7.2.80.0040.01116.48
7.2.70.0040.01116.58
7.2.60.0110.00617.02
7.2.50.0090.00616.96
7.2.40.0120.00616.82
7.2.30.0100.00717.04
7.2.20.0030.00916.67
7.2.10.0090.00616.72
7.2.00.0040.01216.89
7.1.330.0000.01415.75
7.1.320.0070.00715.63
7.1.310.0090.00915.82
7.1.300.0080.00315.61
7.1.290.0120.00315.81
7.1.280.0070.00715.70
7.1.270.0060.00315.46
7.1.260.0000.00915.79
7.1.250.0030.00915.76
7.1.240.0040.00715.70
7.1.230.0060.00615.79
7.1.220.0060.00915.92
7.1.210.0030.01415.89
7.1.200.0000.00915.67
7.1.190.0060.00915.80
7.1.180.0100.00315.62
7.1.170.0100.00315.61
7.1.160.0120.00315.78
7.1.150.0090.00615.90
7.1.140.0030.00915.67
7.1.130.0040.00415.70
7.1.120.0130.00315.80
7.1.110.0030.01015.89
7.1.100.0060.00915.82
7.1.90.0130.00415.51
7.1.80.0000.01415.87
7.1.70.0030.01016.45
7.1.60.0030.01217.73
7.1.50.0070.01216.50
7.1.40.0000.01315.51
7.1.30.0030.01015.88
7.1.20.0030.01015.89
7.1.10.0110.00415.79
7.1.00.0030.04319.10
7.0.330.0030.01015.60
7.0.320.0090.00915.25
7.0.310.0030.00615.23
7.0.300.0000.00915.12
7.0.290.0070.00715.37
7.0.280.0060.00615.23
7.0.270.0030.00615.55
7.0.260.0100.00715.36
7.0.250.0030.01015.38
7.0.240.0110.00415.58
7.0.230.0030.01015.27
7.0.220.0060.00315.63
7.0.210.0060.00615.51
7.0.200.0030.00915.94
7.0.190.0040.01115.43
7.0.180.0030.00915.20
7.0.170.0070.00715.38
7.0.160.0060.00915.19
7.0.150.0110.00315.36
7.0.140.0050.04218.76
7.0.130.0030.01015.42
7.0.120.0030.01015.52
7.0.110.0000.00915.55
7.0.100.0030.02717.63
7.0.90.0050.02517.74
7.0.80.0040.04017.64
7.0.70.0000.03017.61
7.0.60.0060.02317.68
7.0.50.0020.02718.00
7.0.40.0030.02716.83
7.0.30.0030.02416.78
7.0.20.0050.02316.89
7.0.10.0050.01916.64
7.0.00.0050.02716.85
5.6.400.0000.00814.57
5.6.390.0090.00614.41
5.6.380.0030.01414.17
5.6.370.0000.01414.21
5.6.360.0090.00614.22
5.6.350.0120.00314.53
5.6.340.0080.00614.46
5.6.330.0060.00914.23
5.6.320.0000.01714.36
5.6.310.0090.00614.39
5.6.300.0060.00314.44
5.6.290.0000.01714.28
5.6.280.0020.04417.68
5.6.270.0030.01014.05
5.6.260.0000.01214.30
5.6.250.0060.02317.37
5.6.240.0030.03517.48
5.6.230.0070.03417.44
5.6.220.0020.02517.37
5.6.210.0050.02317.50
5.6.200.0030.02617.63
5.6.190.0030.02617.72
5.6.180.0070.02517.47
5.6.170.0030.02817.64
5.6.160.0070.02117.66
5.6.150.0020.03417.63
5.6.140.0070.02017.54
5.6.130.0070.02517.81
5.6.120.0040.03117.60
5.6.110.0040.03417.65
5.6.100.0080.04517.74
5.6.90.0070.02317.82
5.6.80.0100.02217.33
5.6.70.0160.03517.42
5.6.60.0070.04317.41
5.6.50.0050.02617.33
5.6.40.0020.04417.43
5.6.30.0030.04117.46
5.6.20.0100.03517.41
5.6.10.0070.04217.14
5.6.00.0120.03817.20
5.5.380.0070.03317.20
5.5.370.0020.02617.21
5.5.360.0090.02317.43
5.5.350.0090.01817.45
5.5.340.0020.02817.73
5.5.330.0130.01817.58
5.5.320.0040.02617.52
5.5.310.0080.02317.50
5.5.300.0060.02217.51
5.5.290.0010.02917.34
5.5.280.0070.02217.52
5.5.270.0030.04317.57
5.5.260.0070.03717.48
5.5.250.0070.03717.50
5.5.240.0100.03817.29
5.5.230.0100.04217.31
5.5.220.0080.04217.17
5.5.210.0100.04117.06
5.5.200.0070.03717.17
5.5.190.0080.03717.05
5.5.180.0050.02217.18
5.5.170.0030.01013.96
5.5.160.0040.03017.23
5.5.150.0050.03516.99
5.5.140.0030.03717.13
5.5.130.0100.04017.14
5.5.120.0100.04017.04
5.5.110.0110.02717.30
5.5.100.0050.04417.03
5.5.90.0040.03716.94
5.5.80.0080.04517.03
5.5.70.0150.03516.99
5.5.60.0140.03516.97
5.5.50.0050.03617.24
5.5.40.0070.04216.99
5.5.30.0050.04017.18
5.5.20.0080.04117.10
5.5.10.0070.04217.11
5.5.00.0030.04816.97
5.4.450.0010.02415.33
5.4.440.0050.03515.18
5.4.430.0120.03715.08
5.4.420.0030.04315.32
5.4.410.0020.04515.16
5.4.400.0100.03514.91
5.4.390.0020.03215.19
5.4.380.0050.04615.15
5.4.370.0120.02215.06
5.4.360.0040.02515.04
5.4.350.0050.04114.96
5.4.340.0080.04115.22
5.4.330.0030.00710.88
5.4.320.0080.03315.07
5.4.310.0030.03015.12
5.4.300.0020.02414.95
5.4.290.0050.04015.10
5.4.280.0050.02315.01
5.4.270.0050.04214.92
5.4.260.0070.03915.10
5.4.250.0080.03814.80
5.4.240.0050.04215.09
5.4.230.0070.04315.07
5.4.220.0070.04014.93
5.4.210.0080.04015.09
5.4.200.0020.02814.75
5.4.190.0030.03914.99
5.4.180.0100.03814.95
5.4.170.0070.03014.91
5.4.160.0050.02714.96
5.4.150.0070.04115.00
5.4.140.0080.04013.66
5.4.130.0050.03713.77
5.4.120.0070.03513.79
5.4.110.0060.04113.94
5.4.100.0050.04213.56
5.4.90.0060.03813.79
5.4.80.0050.04613.79
5.4.70.0080.03713.74
5.4.60.0040.02713.78
5.4.50.0070.04013.65
5.4.40.0010.02913.71
5.4.30.0030.02813.75
5.4.20.0060.02113.73
5.4.10.0050.04113.64
5.4.00.0050.02413.38
5.3.290.0020.04512.68
5.3.280.0070.04512.65
5.3.270.0070.04012.66
5.3.260.0120.03112.64
5.3.250.0050.03812.66
5.3.240.0070.03912.58
5.3.230.0070.03512.55
5.3.220.0060.02712.45
5.3.210.0070.04012.62
5.3.200.0060.03612.50
5.3.190.0050.04312.55
5.3.180.0030.04512.62
5.3.170.0120.03212.52
5.3.160.0070.03912.61
5.3.150.0090.03212.61
5.3.140.0000.04812.46
5.3.130.0060.03812.48
5.3.120.0050.04212.59
5.3.110.0110.03612.65
5.3.100.0080.03912.27
5.3.90.0030.04212.40
5.3.80.0080.04012.25
5.3.70.0020.04312.12
5.3.60.0070.03812.24
5.3.50.0050.03012.21
5.3.40.0060.04012.16
5.3.30.0080.03812.25
5.3.20.0020.04412.16
5.3.10.0080.03412.00
5.3.00.0020.04411.98
5.2.170.0000.03711.64
5.2.160.0100.05011.64
5.2.150.0000.06011.64
5.2.140.0030.06711.64
5.2.130.0000.06311.64
5.2.120.0030.06711.64
5.2.110.0030.05011.64
5.2.100.0070.04011.64
5.2.90.0070.06311.64
5.2.80.0030.06011.64
5.2.70.0070.05711.64
5.2.60.0000.05311.64
5.2.50.0070.05311.64
5.2.40.0070.06311.64
5.2.30.0100.05311.64
5.2.20.0070.06311.64
5.2.10.0070.05311.64
5.2.00.0000.06011.64
5.1.60.0030.04711.64
5.1.50.0100.04011.64
5.1.40.0030.05711.64
5.1.30.0100.05011.64
5.1.20.0030.03711.64
5.1.10.0070.04311.64
5.1.00.0100.02711.64
5.0.50.0030.03311.64
5.0.40.0000.04711.64
5.0.30.0030.05311.64
5.0.20.0030.04011.64
5.0.10.0030.03711.64
5.0.00.0070.05011.64
4.4.90.0000.04011.64
4.4.80.0030.03311.64
4.4.70.0000.03311.64
4.4.60.0000.01711.64
4.4.50.0000.03711.64
4.4.40.0030.05311.64
4.4.30.0000.03711.64
4.4.20.0000.03311.64
4.4.10.0030.03311.64
4.4.00.0030.05011.64
4.3.110.0000.03711.64
4.3.100.0030.02011.64
4.3.90.0000.03311.64
4.3.80.0030.02711.64
4.3.70.0070.02711.64
4.3.60.0000.03011.64
4.3.50.0030.02011.64
4.3.40.0030.03711.64
4.3.30.0000.02711.64
4.3.20.0000.02011.64
4.3.10.0030.02711.64
4.3.00.0000.02011.64

preferences:
39.56 ms | 401 KiB | 5 Q