3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { readonly public string $property; public function __construct() { $this->property = 1; } } $object = new x(); $reference =& $object->property; //Cannot modify readonly property X::$property class Y { readonly public string $property; public function __construct(&$a) { // first time assignation $this->property = &$a; //Cannot modify readonly property X::$property } } $a = 'A'; $object = new Y($a);

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.60.0120.00517.04
8.5.50.0120.00516.75
8.5.30.0090.00919.82
8.5.20.0100.00720.19
8.5.10.0140.00516.67
8.5.00.0120.00920.05
8.4.210.0120.00921.59
8.4.180.0150.00719.69
8.4.170.0130.00922.00
8.4.160.0130.01022.20
8.4.150.0060.00616.89
8.4.140.0130.00917.64
8.4.130.0100.01017.82
8.4.120.0120.00722.13
8.4.110.0140.00623.88
8.4.100.0040.00417.98
8.4.90.0110.00917.82
8.4.80.0110.00917.96
8.4.70.0060.00319.90
8.4.60.0370.01017.95
8.4.50.0350.00618.00
8.4.40.0350.00517.70
8.4.30.0370.00917.50
8.4.20.0320.00617.55
8.4.10.0190.00417.43
8.3.300.0100.00920.76
8.3.290.0120.01022.56
8.3.280.0130.00818.43
8.3.270.0110.00916.76
8.3.260.0130.00716.74
8.3.250.0100.00918.96
8.3.240.0110.00916.61
8.3.230.0110.00716.62
8.3.220.0120.00616.93
8.3.210.0110.00916.93
8.3.200.0160.00316.25
8.3.190.0330.00516.09
8.3.180.0290.00816.28
8.3.170.0390.01215.86
8.3.160.0380.00816.43
8.3.150.0240.00616.40
8.3.140.0390.01016.31
8.3.130.0320.01116.56
8.3.120.0320.00916.31
8.3.110.0380.00316.33
8.3.100.0410.00616.40
8.3.90.0350.01116.28
8.3.80.0340.01316.42
8.3.70.0350.01116.39
8.3.60.0370.01016.54
8.3.50.0330.01116.29
8.3.40.0360.00617.19
8.3.30.0350.00517.33
8.3.20.0300.01017.40
8.3.10.0360.00517.43
8.3.00.0190.00417.30
8.2.300.0130.00820.37
8.2.290.0090.00620.54
8.2.280.0310.00716.65
8.2.270.0320.00716.44
8.2.260.0300.00916.45
8.2.250.0330.00716.55
8.2.240.0330.00716.38
8.2.230.0360.00516.52
8.2.220.0490.00516.24
8.2.210.0350.01016.30
8.2.200.0270.01116.21
8.2.190.0300.00916.39
8.2.180.0280.01116.69
8.2.170.0370.01017.79
8.2.160.0360.00517.61
8.2.150.0350.00617.59
8.2.140.0330.00817.49
8.2.130.0300.00817.39
8.2.120.0330.00617.51
8.2.110.0310.00617.49
8.2.100.0320.00917.59
8.2.90.0320.01017.75
8.2.80.0310.00817.52
8.2.70.0310.01017.63
8.2.60.0250.00717.49
8.2.50.0330.00817.55
8.2.40.0250.01217.64
8.2.30.0290.01017.45
8.2.20.0280.01017.73
8.2.10.0320.00717.36
8.2.00.0310.00717.53
8.1.340.0120.00820.41

preferences:
39.74 ms | 861 KiB | 5 Q