3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Expressions { public $a = 1; function foo() { // Examples based on php-parser expression types static $array = [1, 2, 3]; static $arrayDimFetch = [1,2][0]; static $arrayItem = ['a' => 1]; static $binaryBitwiseAnd = 1 & 2; static $binaryConcat = "a" . "b"; static $binaryIdentical = 1 === 1; static $binaryPlus = 1 + 2; static $binarySpaceship = 1 <=> 2; static $bitwiseNot = ~1; static $booleanAnd = 1 && 2; static $booleanNot = !false; static $classConstFetch = self::class; static $coalesce = 1 ?? 2; static $constFetch = PHP_EOL; static $new = new stdClass(); static $scalarFloat = 3.14; static $scalarInteger = 123; static $scalarMagicConst = __LINE__; static $scalarString = 'string'; static $ternary = true ? 1 : 2; static $unaryPlus = +1; } } $expr = new Expressions(); $expr->foo();

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.10.0060.01116.81
8.5.00.0110.00922.93
8.4.160.0140.00722.80
8.4.150.0100.00416.91
8.4.140.0340.00917.42
8.4.130.0340.00817.49
8.4.120.0350.01017.67
8.4.110.0350.01017.57
8.4.100.0390.00717.46
8.4.90.0390.00717.55
8.4.80.0350.01117.62
8.4.70.0390.00817.62
8.4.60.0390.01017.49
8.4.50.0390.01017.45
8.4.40.0400.00917.57
8.4.30.0400.00917.18
8.4.20.0390.01017.38
8.4.10.0420.00817.70
8.3.290.0080.01220.82
8.3.280.0080.00616.24
8.3.270.0370.00716.38
8.3.260.0360.00816.30
8.3.250.0350.01016.36
8.3.240.0330.01116.52
8.3.230.0370.00816.37
8.3.220.0350.00816.35
8.3.210.0370.00816.56
8.3.200.0360.00816.42
8.3.190.0350.01016.60
8.3.180.0340.01016.71
8.3.170.0410.00716.38
8.3.160.0380.00816.36
8.3.150.0380.00916.42
8.3.140.0370.00816.54
8.3.130.0380.00716.21
8.3.120.0340.00716.53
8.3.110.0310.01016.41
8.3.100.0370.01116.21
8.3.90.0390.00716.52
8.3.80.0390.00716.49
8.3.70.0360.00916.54
8.3.60.0370.00916.55
8.3.50.0380.00816.51
8.3.40.0360.00817.29
8.3.30.0280.01017.26
8.3.20.0280.01017.17
8.3.10.0290.00817.31
8.3.00.0300.00717.30
8.2.300.0110.01020.27
8.2.290.0290.00716.38
8.2.280.0320.00716.57
8.2.270.0330.00716.57
8.2.260.0320.00716.45
8.2.250.0320.00716.36
8.2.240.0300.00816.45
8.2.230.0280.01116.58
8.2.220.0310.00816.70
8.2.210.0290.01016.48
8.2.200.0290.00916.62
8.2.190.0300.01016.54
8.2.180.0310.00816.40
8.2.170.0310.01017.64
8.2.160.0280.01017.45
8.2.150.0340.00517.42
8.2.140.0330.00817.43
8.2.130.0290.00917.40
8.2.120.0330.00817.21
8.2.110.0370.00817.20
8.2.100.0310.00817.21
8.2.90.0310.00817.43
8.2.80.0310.00617.33
8.2.70.0300.00817.21
8.2.60.0250.00817.22
8.2.50.0240.00817.24
8.2.40.0280.01017.13
8.2.30.0320.00617.18
8.2.20.0280.00717.31
8.2.10.0240.00617.27
8.2.00.0290.00716.96
8.1.340.0120.00717.61

preferences:
43.23 ms | 403 KiB | 5 Q