3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Phrase { public function __construct($text, $arguments = array()) { $this->_text = (string)$text; $this->_arguments = $arguments; } public function __toString() { return $this->render($this->_text, $this->_arguments); } public function render($text, $arguments) { if ($arguments) { $placeholders = array(); for ($i = 1, $size = count($arguments); $i <= $size; $i++) { $placeholders[] = "%$i"; } $text = str_replace($placeholders, $arguments, $text); } return $text; } } function __(){ $argc = func_get_args(); return new Phrase(array_shift($argc), $argc); } try { throw new Exception(__('one %1 one' , 1111)); } catch (Exception $e) { var_dump(strpos($e->getMessage(), 'one 1111 one') !== FALSE); } $a = array(__('saadfdsa'), __('sdfgsda sa%1 ', 4), __('sdgsa gsag sg %1 gas g%2 w4', 1111,222)); echo implode($a);

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)
8.3.60.0030.01216.88
8.3.50.0110.00418.13
8.3.40.0180.00319.02
8.3.30.0100.00319.01
8.3.20.0080.00020.25
8.3.10.0080.00023.65
8.3.00.0030.00619.38
8.2.180.0060.01318.25
8.2.170.0040.01122.96
8.2.160.0150.00020.21
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00322.11
8.2.110.0090.00022.31
8.2.100.0030.00817.81
8.2.90.0090.00019.20
8.2.80.0040.00417.97
8.2.70.0000.00917.63
8.2.60.0000.00818.05
8.2.50.0030.00618.07
8.2.40.0030.00618.16
8.2.30.0030.00518.15
8.2.20.0000.00717.91
8.2.10.0040.00418.08
8.2.00.0000.00717.77
8.1.270.0050.00322.05
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00423.86
8.1.230.0080.00319.06
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0030.00717.23
8.1.190.0000.00817.42
8.1.180.0000.00918.10
8.1.170.0120.00518.48
8.1.160.0080.00022.06
8.1.150.0040.00418.74
8.1.140.0040.00417.45
8.1.130.0030.00317.86
8.1.120.0000.00717.52
8.1.110.0030.00517.53
8.1.100.0040.00417.40
8.1.90.0030.00517.43
8.1.80.0000.00717.45
8.1.70.0040.00417.45
8.1.60.0080.00017.62
8.1.50.0000.00817.49
8.1.40.0030.00517.48
8.1.30.0000.00817.51
8.1.20.0030.00517.58
8.1.10.0040.00417.51
8.1.00.0040.00417.59
8.0.300.0040.00418.77
8.0.290.0000.00717.28
8.0.280.0040.00418.50
8.0.270.0000.00717.23
8.0.260.0050.00316.96
8.0.250.0070.00016.95
8.0.240.0030.00316.93
8.0.230.0070.00016.92
8.0.220.0040.00416.89
8.0.210.0080.00016.93
8.0.200.0000.00717.08
8.0.190.0030.00516.92
8.0.180.0040.00417.03
8.0.170.0060.00317.08
8.0.160.0030.00516.88
8.0.150.0040.00416.91
8.0.140.0030.00616.98
8.0.130.0050.00013.30
8.0.120.0040.00416.95
8.0.110.0070.00016.99
8.0.100.0040.00417.02
8.0.90.0000.00717.04
8.0.80.0060.01816.99
8.0.70.0070.00017.01
8.0.60.0040.00416.82
8.0.50.0000.00717.04
8.0.30.0120.00817.14
8.0.20.0110.01117.40
8.0.10.0000.00717.07
8.0.00.0090.00916.69
7.4.330.0050.00015.00
7.4.320.0000.00716.65
7.4.300.0000.00616.57
7.4.290.0070.00016.48
7.4.280.0050.00316.54
7.4.270.0000.00816.42
7.4.260.0000.00716.53
7.4.250.0080.00016.44
7.4.240.0040.00416.52
7.4.230.0080.00016.30
7.4.220.0030.01416.57
7.4.210.0050.01116.61
7.4.200.0000.00716.63
7.4.190.0000.00716.61
7.4.160.0090.01516.59
7.4.150.0110.00517.40
7.4.140.0080.01017.86
7.4.130.0120.00616.55
7.4.120.0080.01016.66
7.4.110.0150.00316.66
7.4.100.0120.01316.63
7.4.90.0070.01116.64
7.4.80.0060.01319.39
7.4.70.0030.01216.49
7.4.60.0080.00816.43
7.4.50.0030.00516.15
7.4.40.0140.00022.77
7.4.30.0150.00316.63
7.4.00.0060.00615.04
7.3.330.0050.00013.41
7.3.320.0030.00313.40
7.3.310.0000.00716.52
7.3.300.0030.00316.45
7.3.290.0090.01216.51
7.3.280.0090.01016.43
7.3.270.0100.00717.40
7.3.260.0080.01516.46
7.3.250.0110.00716.49
7.3.240.0140.00316.66
7.3.230.0130.00316.43
7.3.210.0140.00316.69
7.3.200.0140.00519.39
7.3.190.0100.01316.40
7.3.180.0060.00916.68
7.3.170.0110.00516.61
7.3.160.0030.01716.68
7.3.120.0070.01014.95
7.3.10.0030.00616.66
7.3.00.0000.01116.21
7.2.330.0110.00616.73
7.2.320.0000.01616.88
7.2.310.0130.00316.48
7.2.300.0170.00016.61
7.2.290.0080.00816.60
7.2.130.0120.00016.92
7.2.120.0060.00616.47
7.2.110.0120.00016.71
7.2.100.0070.00716.88
7.2.90.0030.00716.69
7.2.80.0080.00816.54
7.2.70.0100.00316.75
7.2.60.0060.00616.88
7.2.50.0110.01116.95
7.2.40.0060.01216.70
7.2.30.0190.00616.94
7.2.20.0100.01016.61
7.2.10.0060.01216.90
7.2.00.0030.01016.86
7.1.250.0030.00615.37
7.1.70.0040.00417.25
7.1.60.0180.00719.33
7.1.50.0070.00716.84
7.1.00.0030.07722.33
7.0.200.0090.00616.93
7.0.140.0000.07722.00
7.0.60.0130.07719.99
7.0.50.0030.08317.98
7.0.40.0030.04320.18
7.0.30.0500.07720.16
7.0.20.0430.05320.33
7.0.10.0030.06720.07
7.0.00.0070.08720.09
5.6.280.0000.07720.91
5.6.210.0130.06720.61
5.6.200.0000.04318.29
5.6.190.0200.03320.57
5.6.180.0130.08320.68
5.6.170.0200.05020.55
5.6.160.0100.03720.57
5.6.150.0100.07718.15
5.6.140.0070.04718.14
5.6.130.0030.08718.13
5.6.120.0130.07721.05
5.6.110.0070.07020.97
5.6.100.0030.07320.98
5.6.90.0100.05320.99
5.6.80.0200.05320.28
5.6.70.4530.04020.30
5.5.350.0000.07720.38
5.5.340.0030.08017.95
5.5.330.0070.06020.21
5.5.320.0170.05320.25
5.5.310.0100.04720.37
5.5.300.0070.08318.07
5.5.290.0030.07717.95
5.5.280.0200.06320.89
5.5.270.0130.08320.80
5.5.260.0200.07020.87
5.5.250.0100.09020.76
5.5.240.0070.07720.13
5.4.450.0500.03019.57
5.4.440.1030.06019.38
5.4.430.1000.05019.16
5.4.420.0870.06019.47
5.4.410.0830.05719.50
5.4.400.1200.05019.38
5.4.390.0730.06019.26
5.4.380.0200.06318.76
5.4.370.0130.06318.58
5.4.360.0200.06318.54
5.4.350.0370.06018.79
5.4.340.0200.05018.58
5.4.320.0090.04212.51
5.4.310.0070.03812.50
5.4.300.0020.04012.51
5.4.290.0060.03812.50
5.4.280.0050.03612.40
5.4.270.0080.04112.40
5.4.260.0080.03812.40
5.4.250.0040.03812.40
5.4.240.0050.03712.41
5.4.230.0060.04312.39
5.4.220.0030.03712.39
5.4.210.0060.03412.40
5.4.200.0060.04312.39
5.4.190.0070.04012.39
5.4.180.0070.04212.39
5.4.170.0150.04312.38
5.4.160.0310.09312.37
5.4.150.0140.04612.37
5.4.140.0120.04512.05
5.4.130.0140.04412.05
5.4.120.0120.04412.00
5.4.110.0120.04412.00
5.4.100.0130.04812.00
5.4.90.0150.04312.00
5.4.80.0180.06912.00
5.4.70.0170.03912.00
5.4.60.0200.03611.99
5.4.50.0180.03811.99
5.4.40.0120.04411.98
5.4.30.0230.06711.97
5.4.20.0150.04311.97
5.4.10.0120.04411.97
5.4.00.0110.04411.46
5.3.290.0070.04012.80
5.3.280.0050.04612.71
5.3.270.0130.04712.72
5.3.260.0160.04412.72
5.3.250.0170.04312.72
5.3.240.0240.06712.72
5.3.230.0150.04712.71
5.3.220.0160.04512.68
5.3.210.0180.04412.68
5.3.200.0120.04912.68
5.3.190.0170.04512.68
5.3.180.0220.04212.67
5.3.170.0250.06712.67
5.3.160.0170.04312.68
5.3.150.0150.04512.67
5.3.140.0180.04312.66
5.3.130.0170.04312.66
5.3.120.0160.04412.66
5.3.110.0200.04312.66
5.3.100.0220.07012.13
5.3.90.0190.04212.12
5.3.80.0200.04112.09
5.3.70.0100.05212.10
5.3.60.0160.04412.08
5.3.50.0200.04012.04
5.3.40.0150.04512.03
5.3.30.0400.07912.00
5.3.20.0140.04511.78
5.3.10.0120.04511.74
5.3.00.0180.03911.72
5.2.170.0110.0369.23
5.2.160.0150.0329.23
5.2.150.0100.0379.23
5.2.140.0120.0359.23
5.2.130.0130.0329.19
5.2.120.0300.0779.19
5.2.110.0120.0359.19
5.2.100.0140.0329.20
5.2.90.0120.0349.19
5.2.80.0130.0339.19
5.2.70.0100.0369.19
5.2.60.0130.0339.14
5.2.50.0170.0609.10
5.2.40.0100.0379.08
5.2.30.0130.0339.05
5.2.20.0130.0369.05
5.2.10.0140.0348.96
5.2.00.0100.0348.81
5.1.60.0130.0268.09
5.1.50.0130.0278.09
5.1.40.0110.0308.08
5.1.30.0140.0328.43
5.1.20.0110.0328.45
5.1.10.0160.0278.18
5.1.00.0110.0328.17
5.0.50.0140.0226.65
5.0.40.0290.0646.51
5.0.30.0110.0366.32
5.0.20.0070.0256.29
5.0.10.0110.0246.27
5.0.00.0110.0386.26
4.4.90.0080.0174.78
4.4.80.0070.0184.76
4.4.70.0050.0214.76
4.4.60.0090.0184.75
4.4.50.0060.0204.77
4.4.40.0070.0294.71
4.4.30.0070.0194.76
4.4.20.0090.0174.85
4.4.10.0110.0154.84
4.4.00.0060.0314.76
4.3.110.0060.0194.67
4.3.100.0080.0164.66
4.3.90.0070.0174.63
4.3.80.0070.0294.58
4.3.70.0080.0164.63
4.3.60.0090.0154.63
4.3.50.0050.0194.63
4.3.40.0290.0704.54
4.3.30.0030.0203.31
4.3.20.0020.0213.29
4.3.10.0070.0183.26
4.3.00.0270.01315.61

preferences:
57.78 ms | 400 KiB | 5 Q