3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Phrase { public function __construct($text, array $arguments = array()) { $this->_text = (string)$text; $this->_arguments = $arguments; } public function __toString() { return $this->render($this->_text, $this->_arguments); } public function render($text, array $arguments) { if ($arguments) { $placeholders = array(); for ($i = 1, $size = count($arguments); $i <= $size; $i++) { $placeholders[] = "%$i"; } $text = str_replace($placeholders, $arguments, $text); } return $text; } } functinon __(){ return new Phrase(func_get_arguments()); } echo __('sdgsa gsag sg %1 gas g%2 w4', 1111,222) ,'<br>'; echo __('sdgsa gsag sg %1 gas g%2 w4', 1111) ,'<br>';

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.0000.04717.18
5.5.00.0000.05017.19
5.4.170.0100.03718.88
5.4.160.0030.03718.97
5.4.150.0030.03719.04
5.4.140.0070.03316.35
5.4.130.0000.04716.35
5.4.120.0000.03716.34
5.4.110.0000.05316.44
5.4.100.0000.03716.43
5.4.90.0000.03716.61
5.4.80.0030.03316.41
5.4.70.0070.04016.46
5.4.60.0070.04016.41
5.4.50.0030.03316.29
5.4.40.0000.03716.48
5.4.30.0000.03716.42
5.4.20.0030.03716.20
5.4.10.0030.03316.31
5.4.00.0070.03015.86
5.3.270.0070.03714.46
5.3.260.0000.04014.63
5.3.250.0100.03014.57
5.3.240.0030.03714.62
5.3.230.0070.03314.46
5.3.220.0030.03314.64
5.3.210.0100.03014.65
5.3.200.0030.03314.59
5.3.190.0000.04714.64
5.3.180.0070.03314.78
5.3.170.0030.03714.61
5.3.160.0030.03314.62
5.3.150.0000.03714.60
5.3.140.0070.03314.78
5.3.130.0030.03714.61
5.3.120.0000.04014.40
5.3.110.0030.04714.56
5.3.100.0030.03314.09
5.3.90.0030.03314.06
5.3.80.0000.03714.06
5.3.70.0000.03713.86
5.3.60.0000.03714.04
5.3.50.0030.03313.96
5.3.40.0070.03014.03
5.3.30.0070.03013.91
5.3.20.0030.05313.72
5.3.10.0000.03713.67
5.3.00.0100.06713.70

preferences:
138.27 ms | 1386 KiB | 7 Q