3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop; function setStr(string $x) { $this->prop = $x; } function setStrRef(string &$x) { $this->prop = &$x; } function setArray(array $arr) { $this->prop = $arr; } } $foo = new Foo(); $foo->setStr('abc'); var_dump($foo->prop); // "abc" $str = 'def'; // $str is a string $foo->setStrRef($str); var_dump($foo->prop); // "def" $arr = []; $foo->setArray($arr); var_dump($foo->prop); // [] var_dump($str); // [] - surprise! $str is now an array

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.60.0120.00616.61
8.3.50.0120.00318.07
8.3.40.0040.01418.67
8.3.30.0070.00718.81
8.3.20.0080.00020.58
8.3.10.0000.00823.71
8.3.00.0070.00022.39
8.2.180.0110.00716.38
8.2.170.0040.01118.79
8.2.160.0100.00322.96
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00726.16
8.2.110.0100.00021.12
8.2.100.0030.00717.72
8.2.90.0050.00317.84
8.2.80.0000.00817.97
8.2.70.0040.00417.89
8.2.60.0000.00818.03
8.2.50.0040.00418.10
8.2.40.0000.00819.17
8.2.30.0050.00319.16
8.2.20.0000.00717.99
8.2.10.0000.00719.11
8.2.00.0000.00819.29
8.1.280.0110.00625.92
8.1.270.0000.00822.09
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0120.00619.15
8.1.230.0090.00322.71
8.1.220.0000.00819.44
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.67
8.1.160.0030.00518.73
8.1.150.0040.00418.73
8.1.140.0070.00020.89
8.1.130.0000.00717.29
8.1.120.0030.00317.31
8.1.110.0000.00817.44
8.1.100.0000.00817.39
8.1.90.0030.00717.27
8.1.80.0000.00717.29
8.1.70.0020.00517.37
8.1.60.0050.00517.51
8.1.50.0030.00617.53
8.1.40.0040.00417.57
8.1.30.0040.00817.56
8.1.20.0030.00517.65
8.1.10.0040.00417.47
8.1.00.0040.00417.41
8.0.300.0050.00319.77
8.0.290.0080.00016.75
8.0.280.0040.00418.25
8.0.270.0030.00317.25
8.0.260.0030.00316.70
8.0.250.0000.00716.94
8.0.240.0000.00816.91
8.0.230.0000.00816.82
8.0.220.0030.00316.83
8.0.210.0040.00416.95
8.0.200.0000.00716.99
8.0.190.0030.00616.98
8.0.180.0040.00716.89
8.0.170.0000.00916.86
8.0.160.0040.00416.97
8.0.150.0000.00816.88
8.0.140.0040.00416.75
8.0.130.0060.00013.32
8.0.120.0040.00416.81
8.0.110.0050.00216.86
8.0.100.0030.00516.76
8.0.90.0000.00816.73
8.0.80.0060.00816.89
8.0.70.0000.00816.95
8.0.60.0070.00016.87
8.0.50.0050.00216.91
8.0.30.0040.01117.25
8.0.20.0130.01017.39
8.0.10.0050.00216.96
8.0.00.0170.00016.63
7.4.330.0000.00516.70
7.4.320.0000.00616.55
7.4.300.0000.00616.51
7.4.290.0030.00516.52
7.4.280.0000.01116.56
7.4.270.0000.00716.51
7.4.260.0000.00513.23
7.4.250.0030.00316.45
7.4.240.0060.00216.61
7.4.230.0030.00316.62
7.4.220.0030.00416.65
7.4.210.0010.01316.53
7.4.200.0070.00016.71
7.4.130.0030.01416.51
7.4.120.0120.01416.48
7.4.110.0120.00616.43
7.4.100.0100.00716.48
7.4.90.0210.00316.59
7.4.80.0080.00819.39
7.4.70.0070.01016.30
7.4.60.0070.01016.49
7.4.50.0140.00416.41
7.4.40.0080.01516.34
7.4.00.0060.00914.75
7.3.330.0030.00316.09
7.3.320.0060.00013.20
7.3.310.0000.00916.10
7.3.300.0030.00316.14
7.3.290.0030.00316.29
7.3.280.0060.01116.21
7.3.260.0140.00616.35
7.3.240.0110.00916.32
7.3.230.0080.00816.18
7.3.210.0060.01416.30
7.3.200.0060.01416.41
7.3.190.0070.01016.47
7.3.180.0060.01316.23
7.3.170.0130.00416.35
7.3.160.0190.00016.64
7.3.90.0120.00814.81
7.3.80.0090.00614.70
7.3.70.0000.01314.78
7.3.60.0040.01114.43
7.3.50.0100.00614.69
7.3.40.0080.00514.86
7.3.30.0070.00714.52
7.3.20.0090.00614.90
7.3.10.0110.01114.80
7.3.00.0140.00615.00
7.2.330.0080.00916.32
7.2.320.0090.00916.63
7.2.310.0100.01316.70
7.2.300.0100.00716.64
7.2.290.0130.00316.28
7.2.220.0100.00615.00
7.2.210.0070.00715.22
7.2.200.0030.01014.63
7.2.190.0110.00615.20
7.2.180.0000.01414.67
7.2.170.0090.01014.75
7.2.160.0130.00414.82
7.2.150.0140.00915.07
7.2.140.0060.00914.85
7.2.130.0170.00315.20
7.2.120.0100.00714.96
7.2.110.0070.01315.18
7.2.100.0120.00914.98
7.2.90.0090.01115.14
7.2.80.0120.00415.06
7.2.70.0090.01315.06
7.2.60.0130.00315.28
7.2.50.0000.01615.07
7.2.40.0100.00715.11
7.2.30.0110.00714.89
7.2.20.0100.00614.80
7.2.10.0160.00714.81
7.2.00.0090.01214.93
7.1.320.0090.01213.98
7.1.310.0120.00314.24
7.1.300.0060.01013.91
7.1.290.0080.00613.95
7.1.280.0190.00013.88
7.1.270.0100.01013.70
7.1.260.0160.00013.87
7.1.250.0080.00813.95

preferences:
59.88 ms | 400 KiB | 5 Q