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 %1 one')); } $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)
5.5.10.0100.07717.37
5.5.00.0030.07717.31
5.4.170.0030.07719.01
5.4.160.0000.07719.07
5.4.150.0070.07318.96
5.4.140.0000.04716.41
5.4.130.0030.07316.47
5.4.120.0070.06316.51
5.4.110.0070.05316.43
5.4.100.0130.06016.54
5.4.90.0170.06016.40
5.4.80.0100.05716.49
5.4.70.0100.06016.38
5.4.60.0070.07016.45
5.4.50.0070.05016.36
5.4.40.0070.07716.46
5.4.30.0130.07016.34
5.4.20.0030.03716.40
5.4.10.0030.04716.42
5.4.00.0030.04015.91
5.3.270.0030.05314.66
5.3.260.0100.07314.67
5.3.250.0130.04314.66
5.3.240.0100.04314.84
5.3.230.0000.08714.68
5.3.220.0070.06014.58
5.3.210.0030.05014.43
5.3.200.0000.05014.68
5.3.190.0070.05314.53
5.3.180.0000.08314.43
5.3.170.0070.06014.54
5.3.160.0070.07014.68
5.3.150.0070.07314.54
5.3.140.0000.08014.52
5.3.130.0100.07714.61
5.3.120.0000.08314.58
5.3.110.0070.07714.66
5.3.100.0000.04014.01
5.3.90.0000.04014.12
5.3.80.0030.06014.07
5.3.70.0100.03314.23
5.3.60.0070.03314.00
5.3.50.0070.06014.00
5.3.40.0070.03313.94
5.3.30.0130.03713.92
5.3.20.0030.05313.59
5.3.10.0030.03313.71
5.3.00.0030.06713.65

preferences:
141.13 ms | 1394 KiB | 7 Q