3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getBaconSentences($len) { $paragraph = ""; $words = array( "upper" => array("The", "A", "One", "Some", "Any"), "lower" => array("the", "a", "one", "some", "any"), "noun" => array("boy", "girl", "dog", "town", "car"), "verb" => array("drove", "jumped", "ran", "walked", "skipped"), "prep" => array("to", "from", "over", "under", "on"), "adj" => array('tiny', 'freezing', 'lazy','boiling','filthy') ); $structures = array( array('upper', 'noun', 'verb', 'prep', 'lower', 'noun'), array('upper', 'noun', 'verb', 'prep', 'lower', 'adj', 'noun') ); while($len--) { $sentence = array(); $randStructure = array_rand($structures); for($i=0; $i<count($structures[$randStructure]); $i++) { echo json_encode($randStructure); $word = ' ';//array_rand($words[$randStructure[$i]]); $sentence[] = $word ; } $paragraph .= implode(" ", $sentence) . '. '; } return $paragraph; } echo getBaconSentences(10);

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.0090.00915.13
7.3.120.0020.01614.77
7.3.110.0070.00914.65
7.3.100.0120.00314.92
7.3.90.0000.01214.76
7.3.80.0100.00314.82
7.3.70.0060.00614.70
7.3.60.0060.01014.84
7.3.50.0100.00214.83
7.3.40.0050.00914.75
7.3.30.0030.01114.98
7.3.20.0050.01016.64
7.3.10.0050.00916.46
7.3.00.0080.00516.34
7.2.250.0060.01415.05
7.2.240.0050.01215.03
7.2.230.0100.00515.07
7.2.220.0030.01015.15
7.2.210.0100.00714.97
7.2.200.0100.00615.03
7.2.190.0080.00715.04
7.2.180.0060.00814.88
7.2.170.0050.01115.20
7.2.00.0030.01019.26
7.1.330.0040.01015.86
7.1.320.0040.01115.97
7.1.310.0040.01215.72
7.1.300.0070.00715.75
7.1.290.0050.00815.71
7.1.280.0060.00515.69
7.1.270.0090.00615.84
7.1.260.0100.00215.73
7.1.70.0070.00317.25
7.1.60.0140.01019.31
7.1.50.0070.00716.73
7.1.00.0000.06322.40
7.0.200.0040.00416.50
7.0.140.0030.07322.08
7.0.120.0030.06722.17
7.0.110.0370.09020.08
7.0.100.0400.04720.01
7.0.90.0530.07719.86
7.0.80.0300.04019.86
7.0.70.0570.04319.88
7.0.60.0600.06719.95
7.0.50.0430.05019.99
7.0.40.0000.08319.71
7.0.30.0100.07719.64
7.0.20.0070.08019.77
7.0.10.0030.04319.86
7.0.00.0100.03319.73
5.6.280.0000.07721.02
5.6.260.0070.07320.67
5.6.250.0100.03720.67
5.6.240.0070.08020.50
5.6.230.0070.08020.71
5.6.220.0070.03720.55
5.6.210.0030.07720.64
5.6.200.0000.04020.60
5.6.190.0030.04320.67
5.6.180.0100.08320.57
5.6.170.0070.08020.60
5.6.160.0170.06320.65
5.6.150.0070.06720.71
5.6.140.0030.08020.58
5.6.130.0070.08020.60
5.6.120.0030.07320.57
5.6.110.0070.07720.61
5.6.100.0070.07720.65
5.6.90.0000.04020.65
5.6.80.0000.05320.00
5.6.70.0030.07320.08
5.6.60.0100.07019.93
5.6.50.0070.06720.25
5.6.40.0070.07320.01
5.6.30.0270.05319.96
5.6.20.0030.04320.03
5.6.10.0030.06720.05
5.6.00.0030.04720.07
5.5.380.0030.03717.72
5.5.370.0070.07017.67
5.5.360.0000.07017.71
5.5.350.0070.06317.54
5.5.340.0070.08018.09
5.5.330.0030.08718.10
5.5.320.0200.05718.13
5.5.310.0030.06018.13
5.5.300.0000.03717.93
5.5.290.0130.07718.23
5.5.280.0030.03318.12
5.5.270.0070.03318.13
5.5.260.0030.03317.90
5.5.250.0070.06718.04
5.5.240.0000.04017.53
5.5.230.0030.07717.29
5.5.220.0100.04717.29
5.5.210.0000.04717.63
5.5.200.0030.04017.61
5.5.190.0030.07717.28
5.5.180.0000.08017.48
5.5.160.0030.08017.50
5.5.150.0000.04017.31
5.5.140.0030.08017.45
5.5.130.0130.05317.43
5.5.120.0030.03317.44
5.5.110.0070.05017.45
5.5.100.0000.08017.21
5.5.90.0130.07017.08
5.5.80.0000.03317.19
5.5.70.0030.03317.36
5.5.60.0000.03717.15
5.5.50.0000.03717.34
5.5.40.0100.07317.34
5.5.30.0070.06317.15
5.5.20.0170.06017.49
5.5.10.0030.04317.47
5.5.00.0000.05717.32
5.4.450.0130.06019.34
5.4.440.0030.08319.49
5.4.430.0100.07019.48
5.4.420.0100.03719.34
5.4.410.0100.02719.42
5.4.400.0030.07019.34
5.4.390.0030.06319.01
5.4.380.0030.05719.16
5.4.370.0030.07719.04
5.4.360.0030.03319.02
5.4.350.0070.03319.34
5.4.340.0170.07318.94
5.4.320.0030.04019.09
5.4.310.0030.07319.25
5.4.300.0070.06719.01
5.4.290.0070.07719.16
5.4.280.0100.07719.31
5.4.270.0030.03319.18
5.4.260.0030.06719.14
5.4.250.0070.03719.24
5.4.240.0030.03719.33
5.4.230.0000.06719.07
5.4.220.0100.07019.33
5.4.210.0070.03019.16
5.4.200.0070.05718.94
5.4.190.0000.06719.32
5.4.180.0070.06019.00
5.4.170.0100.06719.23
5.4.160.0030.04718.98
5.4.150.0070.03018.97
5.4.140.0100.02716.47
5.4.130.0070.06716.39
5.4.120.0070.03016.54
5.4.110.0000.04016.37
5.4.100.0070.03016.41
5.4.90.0030.03316.46
5.4.80.0000.04016.41
5.4.70.0000.03316.46
5.4.60.0170.05316.39
5.4.50.0000.04016.40
5.4.40.0130.06016.44
5.4.30.0030.07016.24
5.4.20.0070.07016.51
5.4.10.0070.03016.45
5.4.00.0130.04715.82
5.3.290.0100.03014.82
5.3.280.0000.03714.70
5.3.270.0000.04014.63
5.3.260.0030.03714.66
5.3.250.0030.05014.66
5.3.240.0030.03314.85
5.3.230.0000.08314.76
5.3.220.0030.03014.59
5.3.210.0030.03714.61
5.3.200.0030.07714.72
5.3.190.0030.05714.61
5.3.180.0030.07314.60
5.3.170.0170.02014.61
5.3.160.0030.04014.61
5.3.150.0000.04014.60
5.3.140.0070.08314.59
5.3.130.0070.06314.79
5.3.120.0000.07714.65
5.3.110.0070.07314.57
5.3.100.0030.07714.18
5.3.90.0000.05714.04
5.3.80.0070.04713.99
5.3.70.0030.04014.05
5.3.60.0000.04314.05
5.3.50.0070.06014.05
5.3.40.0000.04713.83
5.3.30.0000.04014.01
5.3.20.0100.03013.93
5.3.10.0000.03713.77
5.3.00.0030.03313.71
5.2.170.0030.04011.76
5.2.160.0130.02011.76
5.2.150.0000.03311.76
5.2.140.0000.03311.76
5.2.130.0030.02711.76
5.2.120.0200.01011.76
5.2.110.0000.03011.76
5.2.100.0000.03011.76
5.2.90.0030.02711.76
5.2.80.0030.02711.76
5.2.70.0030.02711.76
5.2.60.0000.05011.76
5.2.50.0000.02711.76
5.2.40.0000.03311.76
5.2.30.0030.03711.76
5.2.20.0000.02711.76
5.2.10.0030.02311.76
5.2.00.0030.03011.76
5.1.60.0030.02311.76
5.1.50.0030.02311.76
5.1.40.0070.02011.76
5.1.30.0000.02311.76
5.1.20.0000.02311.76
5.1.10.0030.02711.76
5.1.00.0030.02011.76
5.0.50.0000.01711.76
5.0.40.0030.01711.76
5.0.30.0000.03011.76
5.0.20.0000.01711.76
5.0.10.0000.02011.76
5.0.00.0000.02711.76
4.4.90.0030.01311.76
4.4.80.0000.01711.76
4.4.70.0030.01311.76
4.4.60.0030.01011.76
4.4.50.0030.01311.76
4.4.40.0000.02711.76
4.4.30.0030.01011.76
4.4.20.0000.01711.76
4.4.10.0030.01011.76
4.4.00.0000.02311.76
4.3.110.0000.01311.76
4.3.100.0000.01311.76
4.3.90.0030.01311.76
4.3.80.0000.02311.76
4.3.70.0070.01011.76
4.3.60.0070.01311.76
4.3.50.0030.01011.76
4.3.40.0000.02011.76
4.3.30.0000.01311.76
4.3.20.0000.01311.76
4.3.10.0030.01011.76
4.3.00.0000.01311.76

preferences:
34.3 ms | 401 KiB | 5 Q