3v4l.org

run code in 300+ PHP versions simultaneously
<?php class string { protected $_string; public function __construct($string) { if(is_string($string)) $this->_string = $string; elseif(is_int($string)) $this->_string = $this->intToAscii($string); else $this->_string = null; echo('Error, string::__construct() argument 1 must be a string!'); } public function __toString() { return $this->_string; } public function ascii() { $code = ''; if(strlen($this->_string)==1) return ord($this->_string); else for($i = 0; $i < strlen($this->_string); $i++) { $code .= ord($this->_string[$i]); } return $code; } }

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.0.00.0100.05020.14
5.6.280.0000.05721.11
5.6.250.0100.08020.76
5.6.240.0070.08320.52
5.6.230.0100.08720.68
5.6.220.0030.08020.69
5.6.210.0070.05020.49
5.6.200.0100.08320.95
5.6.190.0130.06721.05
5.6.180.0130.07321.12
5.6.170.0100.08321.02
5.6.160.0070.06021.03
5.6.150.0100.08321.05
5.6.140.0030.09021.06
5.6.130.0130.07021.14
5.6.120.0100.08721.04
5.6.110.0130.08321.01
5.6.100.0170.07721.08
5.6.90.0130.08021.11
5.6.80.0070.06720.40
5.6.70.0100.07720.48
5.6.60.0070.06020.52
5.6.50.0070.04720.57
5.6.40.0000.04720.42
5.6.30.0100.04020.43
5.6.20.0070.03720.38
5.6.10.0100.03320.38
5.6.00.0000.04320.52
5.5.380.0170.07020.43
5.5.370.0070.07720.39
5.5.360.0070.08720.35
5.5.350.0130.07720.38
5.5.340.0200.07020.87
5.5.330.0070.05020.74
5.5.320.0170.07320.87
5.5.310.0100.04720.79
5.5.300.0030.05320.92
5.5.290.0030.07320.88
5.5.280.0000.09320.82
5.5.270.0070.08320.76
5.5.260.0170.06720.91
5.5.250.0130.07720.74
5.5.240.0070.03720.03
5.5.230.0030.05720.10
5.5.220.0030.05720.21
5.5.210.0100.03320.26
5.5.200.0000.04720.12
5.5.190.0030.04020.04
5.5.180.0070.03720.24
5.5.160.0000.04020.25
5.5.150.0030.04020.15
5.5.140.0030.04020.16
5.5.130.0000.04020.24
5.5.120.0070.04020.16
5.5.110.0030.04020.27
5.5.100.0100.03020.10
5.5.90.0000.07320.11
5.5.80.0100.05020.08
5.5.70.0070.04320.07
5.5.60.0030.06020.09
5.5.50.0070.03319.97
5.5.40.0100.07320.15
5.5.30.0030.07720.03
5.5.20.0130.02719.95
5.5.10.0030.08320.12
5.5.00.0170.06020.11

preferences:
137.15 ms | 1394 KiB | 7 Q