3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private $state = "valid"; public function getState(){ return $this->state; } public function changeState($inject){ $this->state = "invalid"; // State is temporarily invalid. It will be // valid again before the method returns. // This is ok, right? $inject->qux(); // State is valid again, the method returns. $this->state = "valid"; } } $bar = new Bar(); $bar->changeState(new class($bar){ function __construct(Bar $bar){ $this->bar = $bar; } function qux(){ echo "The state is: " . $this->bar->getState() . "!"; } });

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.0110.00716.88
8.3.50.0120.00316.59
8.3.40.0060.00919.14
8.3.30.0140.00018.79
8.3.20.0060.00320.57
8.3.10.0050.00323.50
8.3.00.0040.00423.54
8.2.180.0070.00718.28
8.2.170.0070.01122.96
8.2.160.0070.00720.52
8.2.150.0000.00924.18
8.2.140.0030.00624.66
8.2.130.0040.00419.24
8.2.120.0040.00426.35
8.2.110.0050.00520.35
8.2.100.0080.00417.91
8.2.90.0090.00019.27
8.2.80.0000.00917.97
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0050.00318.10
8.2.40.0060.00320.48
8.2.30.0000.01119.27
8.2.20.0050.00218.12
8.2.10.0040.00417.95
8.2.00.0020.00518.23
8.1.280.0040.01125.92
8.1.270.0070.00022.02
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00022.20
8.1.230.0080.00317.70
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00618.50
8.1.160.0040.00418.83
8.1.150.0050.00318.86
8.1.140.0000.00719.05
8.1.130.0040.00417.78
8.1.120.0030.00317.54
8.1.110.0050.00317.46
8.1.100.0070.00017.50
8.1.90.0080.00017.51
8.1.80.0000.00717.37
8.1.70.0040.00417.39
8.1.60.0000.00817.49
8.1.50.0040.00417.55
8.1.40.0040.00417.53
8.1.30.0040.00417.59
8.1.20.0000.00817.52
8.1.10.0000.00817.53
8.1.00.0000.00817.53
8.0.300.0080.00418.77
8.0.290.0030.00616.88
8.0.280.0030.00318.46
8.0.270.0030.00617.19
8.0.260.0000.00617.32
8.0.250.0060.00016.99
8.0.240.0030.00317.05
8.0.230.0050.00316.99
8.0.220.0030.00316.94
8.0.210.0040.00416.96
8.0.200.0030.00317.07
8.0.190.0000.00817.03
8.0.180.0040.00417.02
8.0.170.0080.00016.88
8.0.160.0040.00417.01
8.0.150.0000.00716.92
8.0.140.0040.00416.91
8.0.130.0050.00013.41
8.0.120.0040.00416.96
8.0.110.0080.00016.94
8.0.100.0040.00416.98
8.0.90.0000.00717.01
8.0.80.0080.00816.89
8.0.70.0040.00416.80
8.0.60.0000.00816.87
8.0.50.0000.00717.01
8.0.30.0150.00516.98
8.0.20.0150.00417.41
8.0.10.0030.00517.14
8.0.00.0060.01316.89
7.4.330.0000.00616.59
7.4.320.0030.00316.45
7.4.300.0060.00016.66
7.4.290.0000.00716.52
7.4.280.0040.00416.61
7.4.270.0050.00216.53
7.4.260.0070.00016.60
7.4.250.0070.00016.58
7.4.240.0000.00716.61
7.4.230.0000.00716.55
7.4.220.0080.00016.47
7.4.210.0100.01016.72
7.4.200.0040.00416.37
7.4.160.0110.00616.50
7.4.150.0090.00917.40
7.4.140.0070.01017.86
7.4.130.0100.00716.44
7.4.120.0120.00716.59
7.4.110.0080.00816.48
7.4.100.0120.00616.70
7.4.90.0040.01416.63
7.4.80.0170.00619.39
7.4.70.0030.01416.56
7.4.60.0120.00416.43
7.4.50.0100.00716.46
7.4.40.0060.01616.71
7.4.00.0150.00015.03
7.3.330.0050.00013.28
7.3.320.0000.00513.32
7.3.310.0090.00016.16
7.3.300.0000.00716.16
7.3.290.0070.01016.30
7.3.280.0130.00616.29
7.3.270.0160.00017.40
7.3.260.0120.00816.56
7.3.250.0130.00816.39
7.3.240.0080.01216.33
7.3.230.0090.00616.39
7.3.210.0090.00616.27
7.3.200.0140.00916.48
7.3.190.0090.00616.57
7.3.180.0130.00716.32
7.3.170.0100.00716.38
7.3.160.0120.00316.38
7.3.10.0160.00716.63
7.3.00.0060.00916.45
7.2.330.0030.01316.71
7.2.320.0030.01916.80
7.2.310.0160.00616.74
7.2.300.0090.01216.68
7.2.290.0080.00816.71
7.2.130.0130.00016.92
7.2.120.0040.01116.64
7.2.110.0070.00716.77
7.2.100.0190.00616.97
7.2.90.0190.00816.64
7.2.80.0140.01116.81
7.2.70.0120.01716.68
7.2.60.0110.01116.88
7.2.50.0140.00516.99
7.2.40.0200.00816.75
7.2.30.0130.01317.01
7.2.20.0130.01316.95
7.2.10.0270.01017.47
7.2.00.0260.00517.44
7.1.250.0090.00915.74
7.1.240.0110.00915.53
7.1.230.0100.00715.59
7.1.220.0090.00615.53
7.1.210.0150.01015.59
7.1.200.0200.00515.47
7.1.190.0160.00615.32
7.1.180.0150.00715.79
7.1.170.0100.01015.89
7.1.160.0160.00815.76
7.1.150.0110.00715.81
7.1.140.0170.00615.71
7.1.130.0160.00615.77
7.1.120.0190.01016.15
7.1.110.0220.00715.92
7.1.100.0240.00815.73
7.1.90.0280.00515.88
7.1.80.0220.00715.99
7.1.70.0220.00915.56
7.1.60.0280.00924.55
7.1.50.0600.01024.35
7.1.40.0270.01024.16
7.1.30.0310.01123.98
7.1.20.0290.00924.16
7.1.10.0260.00515.07
7.1.00.0290.00815.43
7.0.330.0030.01015.19
5.6.380.0110.00814.29

preferences:
65.14 ms | 401 KiB | 5 Q