3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function &declare_int(int $value) { static $references = []; $valueWrapper = new class(5) { public function __construct(public int $value) { } }; $references[] = $valueWrapper; return $valueWrapper->value; } $intVariable = &declare_int(0); $intVariable = 42; // works $intVariable = 'test'; // fails

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.3.130.0040.00418.73
8.3.120.0100.01019.17
8.3.110.0090.00020.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0060.00318.55
8.3.70.0160.00316.88
8.3.60.0140.00718.56
8.3.50.0040.01216.56
8.3.40.0070.00720.47
8.3.30.0060.00918.84
8.3.20.0090.00524.92
8.3.10.0100.00425.16
8.3.00.0150.00025.91
8.2.250.0000.01616.84
8.2.240.0030.00617.16
8.2.230.0040.00422.58
8.2.220.0030.00537.54
8.2.210.0040.00426.77
8.2.200.0040.00416.74
8.2.190.0150.00618.26
8.2.180.0110.00425.92
8.2.170.0070.01122.96
8.2.160.0130.00322.96
8.2.150.0110.00325.66
8.2.140.0120.00325.16
8.2.130.0030.01225.91
8.2.120.0130.00123.06
8.2.110.0080.00722.50
8.2.100.0110.00621.85
8.2.90.0070.00721.77
8.2.80.0050.00921.82
8.2.70.0090.00521.64
8.2.60.0060.00821.80
8.2.50.0090.00421.69
8.2.40.0040.00922.47
8.2.30.0060.00518.77
8.2.20.0110.00320.20
8.2.10.0080.00620.21
8.2.00.0100.00420.21
8.1.300.0090.00618.34
8.1.290.0070.00318.88
8.1.280.0040.01125.92
8.1.270.0080.00823.93
8.1.260.0050.01026.01
8.1.250.0080.00626.88
8.1.240.0060.00924.25
8.1.230.0100.00521.74
8.1.220.0090.00421.70
8.1.210.0120.00222.22
8.1.200.0050.00721.57
8.1.190.0060.00621.39
8.1.180.0080.00421.88
8.1.170.0080.00520.79
8.1.160.0080.00523.90
8.1.150.0090.00519.54
8.1.140.0090.00420.03
8.1.130.0080.00519.55
8.1.120.0060.00619.59
8.1.110.0100.00219.57
8.1.100.0050.00819.60
8.1.90.0070.00519.65
8.1.80.0090.00319.60
8.1.70.0070.00519.60
8.1.60.0100.00319.72
8.1.50.0070.00619.62
8.1.40.0080.00519.64
8.1.30.0080.00519.67
8.1.20.0080.00519.70
8.1.10.0080.00519.64
8.1.00.0110.00419.60
8.0.300.0060.00522.81
8.0.290.0150.00221.21
8.0.280.0110.00522.08
8.0.270.0070.00519.09
8.0.260.0070.00419.10
8.0.250.0090.00219.12
8.0.240.0080.00519.13
8.0.230.0070.00519.16
8.0.220.0060.00519.11
8.0.210.0080.00419.09
8.0.200.0060.00419.15
8.0.190.0080.00419.14
8.0.180.0060.00419.11
8.0.170.0070.00619.14
8.0.160.0070.00419.14
8.0.150.0070.00519.46
8.0.140.0090.00319.08
8.0.130.0070.00519.11
8.0.120.0100.00319.09
8.0.110.0040.00619.12
8.0.100.0050.00619.07
8.0.90.0070.00619.09
8.0.80.0040.00619.09
8.0.70.0050.00519.45
8.0.60.0080.00419.43
8.0.50.0060.00619.43
8.0.30.0040.00719.47
8.0.20.0050.00519.47
8.0.10.0070.00519.53

preferences:
43.61 ms | 403 KiB | 5 Q