3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClosureStatementFactory implements StatementFactory { private $closure; function __construct(callable $closure) { $this->closure = $closure; } function create(\mysqli_stmt $statement, $queryString) { $function = $this->closure; $statementWrapper = $function($statement, $queryString); return $statementWrapper; } } function createTimerProxyXMySQLiStatementFactory(Timer $timer, Logger $logger) { //This is generated by the proxy builder which also generates the TimerProxyXMySQLiStatement class $closure = function ($statement, $queryString) use ($timer, logger) { $object = new TimerProxyXMySQLiStatement( $statement, $queryString, $logger, $timer ); return $object; }; return new ClosureStatementFactory($closure); } $provider->delegate(StatementFactory::class, 'createTimerProxyXMySQLiStatementFactory'); class DBConnection { //The database connection class needs to be able to make statement classes function __construct(StatementFactory $statementFactory) { $this->statementFactory = statementFactory; } function prepareQuery($query) { $mysqliStatement = $this->mysqli->prepareStatement($query); return $this->statementFactory->create($mysqliStatement, $queryString); } }

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.280.0040.03812.40
5.4.270.0040.03912.41
5.4.260.0070.03812.41
5.4.250.0080.04812.40
5.4.240.0080.03512.40
5.4.230.0050.05112.40
5.4.220.0050.03812.39
5.4.210.0050.04212.39
5.4.200.0060.04812.39
5.4.190.0070.04312.39
5.4.180.0050.04212.39
5.4.170.0050.03612.40
5.4.160.0060.03512.39
5.4.150.0050.03612.39
5.4.140.0050.03812.08
5.4.130.0070.03612.06
5.4.120.0060.03712.02
5.4.110.0070.03512.02
5.4.100.0090.04212.02
5.4.90.0110.04712.02
5.4.80.0090.03312.03
5.4.70.0100.03612.02
5.4.60.0080.04612.02
5.4.50.0060.03612.02
5.4.40.0060.03512.01
5.4.30.0090.04212.00
5.4.20.0090.04112.00
5.4.10.0090.03712.00
5.4.00.0050.04011.50
5.3.280.0090.05012.71
5.3.270.0070.04312.73
5.3.260.0070.04312.72
5.3.250.0070.03612.72
5.3.240.0090.03512.72
5.3.230.0050.04012.70
5.3.220.0060.05412.68
5.3.210.0110.05612.68
5.3.200.0150.03812.68
5.3.190.0090.03812.68
5.3.180.0110.03212.67
5.3.170.0110.04312.67
5.3.160.0100.05212.67
5.3.150.0070.05512.68
5.3.140.0140.04312.66
5.3.130.0100.05412.65
5.3.120.0130.05312.65
5.3.110.0130.05412.65
5.3.100.0070.03912.13
5.3.90.0080.03912.11
5.3.80.0080.03912.09
5.3.70.0110.03612.09
5.3.60.0080.03612.07
5.3.50.0090.03512.02
5.3.40.0090.03612.02
5.3.30.0090.03511.98
5.3.20.0140.04211.76
5.3.10.0070.04511.73
5.3.00.0070.04711.71
5.2.170.0060.0379.18
5.2.160.0040.0399.19
5.2.150.0070.0359.19
5.2.140.0050.0379.18
5.2.130.0060.0369.14
5.2.120.0040.0399.14
5.2.110.0060.0359.15
5.2.100.0080.0359.16
5.2.90.0050.0369.15
5.2.80.0070.0379.15
5.2.70.0040.0379.15
5.2.60.0100.0339.10
5.2.50.0080.0389.07
5.2.40.0070.0359.05
5.2.30.0060.0379.03
5.2.20.0090.0349.01
5.2.10.0040.0368.93
5.2.00.0040.0388.79
5.1.60.0080.0328.07
5.1.50.0050.0328.07
5.1.40.0060.0318.05
5.1.30.0060.0338.40
5.1.20.0070.0338.42
5.1.10.0060.0308.15
5.1.00.0050.0348.15
5.0.50.0040.0256.63
5.0.40.0080.0226.49
5.0.30.0060.0376.29
5.0.20.0040.0246.27
5.0.10.0040.0256.25
5.0.00.0040.0376.24
4.4.90.0030.0194.78
4.4.80.0050.0184.76
4.4.70.0030.0194.76
4.4.60.0030.0194.75
4.4.50.0030.0204.77
4.4.40.0040.0314.71
4.4.30.0040.0204.76
4.4.20.0040.0194.84
4.4.10.0060.0164.85
4.4.00.0030.0294.76
4.3.110.0020.0204.67
4.3.100.0040.0184.67
4.3.90.0050.0174.63
4.3.80.0040.0284.58
4.3.70.0050.0164.63
4.3.60.0010.0204.63
4.3.50.0050.0184.63
4.3.40.0080.0344.54
4.3.30.0080.0493.29
4.3.20.0040.0223.27
4.3.10.0030.0203.23
4.3.00.0000.0276.82

preferences:
144.94 ms | 1397 KiB | 8 Q