3v4l.org

run code in 300+ PHP versions simultaneously
<?php function redirextExceptions(Throwable $exception) { echo 'Perevodim na strnicu oshibki.' . PHP_EOL. 'Error: ' . $exception->getMessage() . PHP_EOL; } set_exception_handler('redirextExceptions'); class Schema { private static array $tables = [ 'user' => [ 'id' => 'int', 'name' => 'string', ] ]; public static function getTableColumnByName(string $tableName, string $columnName): TableColumn { if (false === array_key_exists($tableName, static::$tables)) { throw new Exception(static::class . ' table "' . $tableName . '" not found.'); } if (false === array_key_exists($columnName, static::$tables[$tableName])) { throw new Exception('Table "' . $tableName . '" column "' . $columnName . '" not found.'); } return new TableColumn($columnName, static::$tables[$tableName][$columnName]); } } class UserTableGateway { public function update(int $id, TableColumn $column, mixed $value): void { echo 'Zaebis! Sohranil: "' . $value . '"' . PHP_EOL; } } class TableColumn { public function __construct( public readonly string $name, public readonly string $type, ) {} } $gateway = new UsertableGateway; $gateway->update(33, Schema::getTableColumnByName('user', 'name'), 'Vasya'); $gateway->update(33, Schema::getTableColumnByName('user', 'familiya'), 'Vasya');

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.4.120.0160.00517.70
8.4.110.0130.00722.48
8.4.100.0130.00917.86
8.4.90.0100.00720.56
8.4.80.0120.00818.86
8.4.70.0070.00220.45
8.4.60.0090.00720.47
8.4.50.0100.00918.73
8.4.40.0090.01217.59
8.4.30.0160.00318.78
8.4.20.0000.00819.76
8.4.10.0100.01019.55
8.3.250.0090.00716.50
8.3.240.0140.00516.76
8.3.230.0080.01116.52
8.3.220.0110.00719.12
8.3.210.0110.01016.78
8.3.200.0050.00516.91
8.3.190.0140.00617.41
8.3.180.0100.00918.58
8.3.170.0090.00617.13
8.3.160.0090.00916.77
8.3.150.0040.01416.87
8.3.140.0130.00616.98
8.3.130.0050.00518.43
8.3.120.0040.00418.85
8.3.110.0100.00022.58
8.3.100.0090.00022.58
8.3.50.0090.00022.58
8.3.20.0100.01021.84
8.3.10.0120.00621.67
8.3.00.0100.00619.00
8.2.290.0120.00616.54
8.2.280.0060.00218.50
8.2.270.0140.00718.36
8.2.260.0040.00416.69
8.2.250.0080.00016.55
8.2.240.0030.00717.44
8.2.230.0070.00022.58
8.2.220.0040.00422.58
8.2.150.0140.00619.14
8.2.140.0130.00720.53
8.2.130.0070.01320.14
8.2.120.0130.00719.27
8.2.110.0170.00319.39
8.2.100.0070.01019.10
8.2.90.0130.00619.07
8.2.80.0030.01719.45
8.2.70.0040.01418.77
8.2.60.0070.01518.75
8.2.50.0120.00919.10
8.2.40.0130.00718.66
8.2.30.0110.00718.83
8.2.20.0090.01218.82
8.2.10.0100.01318.76
8.2.00.0210.00319.00
8.1.330.0100.00916.05
8.1.320.0140.00718.09
8.1.310.0080.00316.21
8.1.300.0150.00418.49
8.1.270.0120.00623.91
8.1.260.0070.00722.07
8.1.250.0120.00422.19
8.1.240.0140.00318.54
8.1.230.0090.00618.57
8.1.220.0040.01118.82
8.1.210.0110.00418.55
8.1.200.0070.00718.80
8.1.190.0130.00318.38
8.1.180.0060.01218.37
8.1.170.0100.00718.74
8.1.160.0120.00318.44
8.1.150.0070.01118.77
8.1.140.0070.00718.67
8.1.130.0040.01118.73
8.1.120.0070.00718.38
8.1.110.0070.00718.50
8.1.100.0070.00718.61
8.1.90.0060.00918.55
8.1.80.0150.00019.74
8.1.70.0110.00318.55
8.1.60.0060.00918.63
8.1.50.0110.00418.73
8.1.40.0150.00018.81
8.1.30.0110.00418.74
8.1.20.0110.00419.93
8.1.10.0100.00518.39
8.1.00.0140.00018.58

preferences:
26.58 ms | 403 KiB | 5 Q