3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Master { /** @var static $instance - singleton each class into its own! */ protected static $instance; /** * @return static */ final public static function getInstance() { if(static::$instance === null) { static::$instance = new static(); } return static::$instance; } protected function __construct() { echo "construct".__CLASS__." as ".static::class . " via " . self::class.PHP_EOL; } } class Slave extends Master { /** @var static $instance - singleton each class into its own! */ protected static $instance; protected function __construct() { echo "construct".__CLASS__." as ".static::class . " via " . self::class.PHP_EOL; } } class AnotherSlave extends Slave { /** @var static $instance - singleton each class into its own! */ protected static $instance; protected function __construct() { echo "construct".__CLASS__." as ".static::class . " via " . self::class.PHP_EOL; } } class FailedSlave extends Slave { // protected static $instance; protected function __construct() { echo "construct".__CLASS__." as ".static::class . " via " . self::class.PHP_EOL; } } $master = Master::getInstance(); $master = Master::getInstance(); $master = Master::getInstance(); $slave = Slave::getInstance(); $slave = Slave::getInstance(); $slave = Slave::getInstance(); $anotherSlave = AnotherSlave::getInstance(); $anotherSlave = AnotherSlave::getInstance(); $anotherSlave = AnotherSlave::getInstance(); $failedSlave = FailedSlave::getInstance(); $failedSlave = FailedSlave::getInstance(); $failedSlave = FailedSlave::getInstance();

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)
8.5.00.0110.01020.02
8.4.150.0020.00014.05
8.4.140.0120.00917.64
8.4.130.0140.00617.95
8.4.120.0110.00820.59
8.4.110.0050.00418.98
8.4.100.0110.01017.73
8.4.90.0080.01217.87
8.4.80.0110.00817.74
8.4.70.0080.00817.95
8.4.60.0370.00617.67
8.4.50.0330.00617.73
8.4.40.0250.00917.45
8.4.30.0360.01217.30
8.4.20.0390.01217.52
8.4.10.0380.01117.39
8.3.280.0030.00014.05
8.3.270.0100.01116.77
8.3.260.0140.00516.84
8.3.250.0130.00619.11
8.3.240.0170.00316.58
8.3.230.0110.00816.67
8.3.220.0130.00616.50
8.3.210.0080.00716.54
8.3.200.0380.00616.68
8.3.190.0440.00616.52
8.3.180.0370.00916.46
8.3.170.0360.01116.68
8.3.160.0430.00316.57
8.3.150.0390.01016.70
8.3.140.0410.00816.38
8.3.130.0300.01216.77
8.3.120.0300.01016.68
8.3.110.0350.00716.79
8.3.100.0400.00716.39
8.3.90.0360.01116.29
8.3.80.0400.01016.51
8.3.70.0400.00916.39
8.3.60.0310.00916.55
8.3.50.0360.01216.60
8.3.40.0410.00817.41
8.3.30.0310.00517.34
8.3.20.0300.00617.54
8.3.10.0250.00617.48
8.3.00.0200.00817.59
8.2.290.0100.00920.69
8.2.280.0290.00816.88
8.2.270.0310.00916.32
8.2.260.0280.00816.53
8.2.250.0270.00916.36
8.2.240.0310.00916.51
8.2.230.0310.01016.19
8.2.220.0330.00616.51
8.2.210.0290.00916.31
8.2.200.0260.01016.34
8.2.190.0270.01016.46
8.2.180.0280.00716.37
8.2.170.0280.01017.65
8.2.160.0330.00817.73
8.2.150.0380.00617.48
8.2.140.0330.00917.39
8.2.130.0320.01017.38
8.2.120.0330.00817.75
8.2.110.0340.01017.49
8.2.100.0300.01217.52
8.2.90.0300.01117.68
8.2.80.0300.00317.64
8.2.70.0310.00717.45
8.2.60.0370.00717.27
8.2.50.0310.00917.43
8.2.40.0310.00817.54
8.2.30.0400.00817.56
8.2.20.0330.01317.28
8.2.10.0310.01017.63
8.2.00.0310.00717.61

preferences:
37.19 ms | 403 KiB | 5 Q