3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private static $_count = 0; private $_number; function __construct() { $this->_number = ++static::$_count; } public function __toString(){ return static::$_count . ' | ' . $this->_number . "\n"; } public function __invoke(){ return $this->_number; } } class B { private $_status = C::newInstance; public function show (){echo $this->_status;} } class C { private $message; public function __construct($message){ $this->message = $message; } public static function newInstance($message){ return new C($message); } public __toString(){ return $this->message . " | "; } } $_b = new B(); $a = new A(); $b = new A(); $c = new A(); $d = new A(); echo $a, $b, $c, $d; echo $a(), $b(), $c(), $d();

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.4.340.0070.03612.04
5.4.320.0060.03712.53
5.4.310.0030.04712.52
5.4.300.0040.03812.52
5.4.290.0080.03812.52
5.4.280.0030.03912.42
5.4.270.0040.03812.42
5.4.260.0080.04712.41
5.4.250.0060.04212.42
5.4.240.0030.03912.42
5.4.230.0080.03912.41
5.4.220.0080.03312.41
5.4.210.0130.04212.41
5.4.200.0050.04012.41
5.4.190.0100.03912.41
5.4.180.0040.03712.41
5.4.170.0070.03412.41
5.4.160.0030.03912.41
5.4.150.0070.03412.40
5.4.140.0050.03712.09
5.4.130.0060.03512.07
5.4.120.0070.05112.04
5.4.110.0090.04612.04
5.4.100.0090.04412.04
5.4.90.0020.04112.04
5.4.80.0050.03712.04
5.4.70.0070.03312.04
5.4.60.0060.03412.04
5.4.50.0060.03712.04
5.4.40.0090.03112.02
5.4.30.0040.03712.02
5.4.20.0050.03712.02
5.4.10.0050.03612.02
5.4.00.0050.03711.51
5.3.290.0070.03812.80
5.3.280.0030.04612.71
5.3.270.0100.03712.72
5.3.260.0060.04212.72
5.3.250.0070.05312.72
5.3.240.0090.04312.72
5.3.230.0090.03812.71
5.3.220.0070.04112.68
5.3.210.0080.03612.68
5.3.200.0100.03212.68
5.3.190.0040.04312.68
5.3.180.0060.03812.67
5.3.170.0040.04012.66
5.3.160.0060.03712.68
5.3.150.0070.03612.68
5.3.140.0050.05712.66
5.3.130.0060.03912.66
5.3.120.0050.04012.66
5.3.110.0080.03812.65
5.3.100.0070.03712.14
5.3.90.0070.03912.12
5.3.80.0090.04412.11
5.3.70.0070.03712.11
5.3.60.0050.05112.09
5.3.50.0070.05012.04
5.3.40.0080.03712.03
5.3.30.0070.03612.00
5.3.20.0040.03811.77
5.3.10.0090.03811.75
5.3.00.0110.03311.73
5.2.170.0020.0349.22
5.2.160.0070.0289.23
5.2.150.0040.0319.23
5.2.140.0050.0369.22
5.2.130.0070.0409.18
5.2.120.0050.0409.18
5.2.110.0060.0399.19
5.2.100.0060.0399.18
5.2.90.0080.0439.18
5.2.80.0060.0439.17
5.2.70.0070.0429.18
5.2.60.0070.0419.13
5.2.50.0030.0409.09
5.2.40.0030.0319.07
5.2.30.0040.0309.05
5.2.20.0070.0279.04
5.2.10.0070.0278.95
5.2.00.0040.0298.81
5.1.60.0070.0268.09
5.1.50.0030.0268.09
5.1.40.0040.0258.07
5.1.30.0100.0328.42
5.1.20.0070.0358.45
5.1.10.0040.0328.16
5.1.00.0050.0258.16
5.0.50.0030.0216.64
5.0.40.0050.0186.50
5.0.30.0030.0326.32
5.0.20.0060.0176.28
5.0.10.0050.0186.26
5.0.00.0030.0316.25
4.4.90.0030.0154.78
4.4.80.0030.0154.75
4.4.70.0040.0204.76
4.4.60.0060.0124.75
4.4.50.0050.0154.77
4.4.40.0010.0274.71
4.4.30.0030.0154.76
4.4.20.0010.0174.84
4.4.10.0040.0144.85
4.4.00.0030.0254.76
4.3.110.0020.0164.67
4.3.100.0050.0124.66
4.3.90.0000.0174.63
4.3.80.0010.0264.59
4.3.70.0010.0164.63
4.3.60.0020.0154.63
4.3.50.0020.0164.62
4.3.40.0040.0224.54
4.3.30.0020.0173.30
4.3.20.0030.0153.28
4.3.10.0020.0153.23
4.3.00.0200.0176.99

preferences:
144.38 ms | 1394 KiB | 7 Q