3v4l.org

run code in 300+ PHP versions simultaneously
<?php class String { private $_stringValue; public function __construct($stringValue = '') { $this->_stringValue = ''.$stringValue; } public function __toString() { return $this->_stringValue; } public function getLength() { return mb_strlen($this->_stringValue); } } abstract class AbsTestClass { protected $_privateProperty = 'World'; public function __construct($name) { $this->_privateProperty = $name; } public function getName() { return $this->_privateProperty; } public function getWelcomingMessage() { return 'Hello '.$this->getName().'!'; } abstract public function setName(String $name); } class TestClass extends AbsTestClass { public function setName(String $name) { $this->_privateProperty = $name->__toString(); } } $message = new TestClass('World'); echo $message->getWelcomingMessage()."\n"; $message->setName(new String('Jahala')); echo $message->getWelcomingMessage()."\n";

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.6.280.0030.07021.13
5.6.210.0100.08020.63
5.6.200.0030.07318.27
5.6.190.0030.09720.69
5.6.180.3600.06320.61
5.6.170.0270.06320.48
5.6.160.0130.07720.46
5.6.150.0070.06318.27
5.6.140.0130.03018.17
5.6.130.0030.08318.23
5.6.120.0030.05321.03
5.6.110.0030.05021.05
5.6.100.0130.08720.99
5.6.90.0100.06020.98
5.6.80.0000.04320.41
5.6.70.4370.04320.38
5.5.350.0200.03320.43
5.5.340.0070.04317.98
5.5.330.0200.08020.19
5.5.320.0030.06720.27
5.5.310.0200.07720.34
5.5.300.0000.08317.95
5.5.290.0000.05317.97
5.5.280.0100.06320.78
5.5.270.0030.04020.80
5.5.260.0100.08320.99
5.5.250.0100.03320.80
5.5.240.0270.07320.38
5.4.450.0100.04019.48
5.4.440.0100.05019.33
5.4.430.0130.06019.17
5.4.420.0100.09019.56
5.4.410.0200.06719.40
5.4.400.0030.03719.24
5.4.390.0070.03719.14
5.4.380.0030.03719.25
5.4.370.0000.04019.20
5.4.360.0030.04719.14
5.4.350.0070.08019.15
5.4.340.0070.03718.98
5.4.320.0100.04318.86
5.4.310.0070.03718.87
5.4.300.0030.04319.14
5.4.290.0030.07719.14
5.4.280.0130.05718.92
5.4.270.0070.04319.14
5.4.260.0100.04719.17
5.4.250.0070.04718.92
5.4.240.0070.06019.23
5.4.230.0100.07319.14
5.4.220.0030.06718.85
5.4.210.0070.07019.23
5.4.200.0030.04318.97
5.4.190.0000.04319.13
5.4.180.0000.04319.13
5.4.170.0070.04019.19
5.4.160.0070.03318.96
5.4.150.0070.04319.13
5.4.140.0030.06716.47
5.4.130.0070.03716.40
5.4.120.0030.07716.31
5.4.110.0070.07316.48
5.4.100.0070.07316.46
5.4.90.0170.06016.35
5.4.80.0130.06316.33
5.4.70.0030.06316.43
5.4.60.0000.05716.38
5.4.50.0130.03016.37
5.4.40.0100.07016.36
5.4.30.0000.07716.27
5.4.20.0130.06316.39
5.4.10.0100.04316.27
5.4.00.0000.04715.92
5.3.290.0070.03714.56
5.3.280.0100.04014.63
5.3.270.0100.03714.64
5.3.260.0030.05014.61
5.3.250.0000.04014.66
5.3.240.0000.06314.61
5.3.230.0070.06314.66
5.3.220.0070.07314.63
5.3.210.0070.07014.74
5.3.200.0070.05314.50
5.3.190.0070.05714.50
5.3.180.0100.07714.59
5.3.170.0100.05014.62
5.3.160.0170.06714.48
5.3.150.0100.05314.57
5.3.140.0100.03714.56
5.3.130.0100.07314.50
5.3.120.0100.07314.57
5.3.110.0070.07714.57
5.3.100.0070.04014.09
5.3.90.0030.04314.04
5.3.80.0100.07314.19
5.3.70.0070.04313.96
5.3.60.0000.04314.18
5.3.50.0100.06714.02
5.3.40.0030.06314.12
5.3.30.0130.04713.99
5.3.20.0070.05013.75
5.3.10.0070.03313.68
5.3.00.0030.04013.71
5.2.170.0070.03311.33
5.2.160.0100.05711.08
5.2.150.0100.05711.23
5.2.140.0030.03711.32
5.2.130.0070.03011.12
5.2.120.0000.03311.18
5.2.110.0030.03011.16
5.2.100.0070.02711.19
5.2.90.0070.05011.08
5.2.80.0030.06011.08
5.2.70.0100.02711.12
5.2.60.0000.03311.13
5.2.50.0000.06311.19
5.2.40.0030.06311.06
5.2.30.0000.03010.95
5.2.20.0070.05011.13
5.2.10.0100.02010.91
5.2.00.0030.02710.69
5.1.60.0000.04710.03
5.1.50.0070.02310.07
5.1.40.0070.02010.04
5.1.30.0000.04310.50
5.1.20.0100.05010.44
5.1.10.0100.0539.99
5.1.00.0070.04310.13
5.0.50.0100.0308.88
5.0.40.0000.0238.88
5.0.30.0030.0508.88
5.0.20.0070.0338.88
5.0.10.0030.0508.88
5.0.00.0000.0678.88
4.4.90.0030.0238.88
4.4.80.0000.0278.88
4.4.70.0070.0138.88
4.4.60.0000.0178.88
4.4.50.0000.0208.88
4.4.40.0030.0278.88
4.4.30.0000.0308.88
4.4.20.0000.0208.88
4.4.10.0000.0408.88
4.4.00.0000.0338.88
4.3.110.0000.0178.88
4.3.100.0030.0338.88
4.3.90.0000.0378.88
4.3.80.0000.0538.88
4.3.70.0000.0378.88
4.3.60.0000.0308.88
4.3.50.0000.0378.88
4.3.40.0100.0438.88
4.3.30.0000.0208.88
4.3.20.0030.0408.88
4.3.10.0030.0338.88
4.3.00.0030.0238.88

preferences:
141.53 ms | 1394 KiB | 7 Q