3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rose = "black"; ${"rose"} = "white"; $rose = "red"; print_r(${"rose"}); echo "\n\n"; /** Parse error: syntax error, unexpected '123' (T_LNUMBER), expecting variable (T_VARIABLE) or '{' or '$' $123 = 456; var_dump($123); **/ ${"123"} = "white"; var_dump(${"123"}); echo '<pre>',get_defined_vars(); echo "\n\n"; $arr{" "} = 99; var_dump($arr); $o = (object) $arr; var_dump($o); echo $o->{" "},"\n\n"; class x extends stdClass { public $val; function Show($n){ $this->val = $n; return $this->val; } } $s = new x(); echo $s->Show(100),"\n"; var_dump($s); var_dump($s instanceof stdClass);

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.0100.00318.30
8.3.50.0130.00821.87
8.3.40.0060.01218.90
8.3.30.0070.00718.96
8.3.20.0040.00420.21
8.3.10.0040.00423.54
8.3.00.0030.00519.25
8.2.180.0250.00016.36
8.2.170.0110.00322.96
8.2.160.0100.00720.41
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0050.00222.27
8.2.110.0040.00422.19
8.2.100.0060.00617.78
8.2.90.0040.00418.92
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0030.00517.80
8.2.50.0030.00618.07
8.2.40.0040.00419.61
8.2.30.0000.00818.00
8.2.20.0040.00417.65
8.2.10.0040.00417.93
8.2.00.0070.00017.61
8.1.280.0100.00725.92
8.1.270.0120.00322.01
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.80
8.1.230.0090.00319.03
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0040.00416.98
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0100.00018.49
8.1.160.0000.00721.94
8.1.150.0040.00418.67
8.1.140.0000.00717.33
8.1.130.0000.00717.22
8.1.120.0050.00317.32
8.1.110.0040.00417.32
8.1.100.0000.00717.37
8.1.90.0000.00717.38
8.1.80.0000.00717.21
8.1.70.0030.00317.22
8.1.60.0030.00717.49
8.1.50.0040.00417.28
8.1.40.0040.00417.42
8.1.30.0030.00517.50
8.1.20.0000.00817.53
8.1.10.0000.00817.36
8.1.00.0040.00417.29
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0040.00418.23
8.0.270.0000.00717.12
8.0.260.0030.00316.77
8.0.250.0000.01116.83
8.0.240.0070.00016.87
8.0.230.0000.00716.92
8.0.220.0040.00716.86
8.0.210.0050.00216.79
8.0.200.0000.00716.82
8.0.190.0000.00816.77
8.0.180.0050.00216.89
8.0.170.0040.00416.84
8.0.160.0030.00416.90
8.0.150.0050.00216.80
8.0.140.0030.00516.81
8.0.130.0000.00613.25
8.0.120.0000.00816.70
8.0.110.0050.00316.84
8.0.100.0040.00416.79
8.0.90.0040.00416.72
8.0.80.0060.00916.76
8.0.70.0070.00016.81
8.0.60.0070.00016.94
8.0.50.0000.00716.76
8.0.30.0100.00916.86
8.0.20.0090.01017.40
8.0.10.0070.00016.82
8.0.00.0090.00916.78
7.4.330.0050.00015.00
7.4.320.0030.00316.53
7.4.300.0050.00216.52
7.4.290.0070.00016.41
7.4.280.0030.00616.41
7.4.270.0070.00016.50
7.4.260.0050.00216.59
7.4.250.0070.00016.48
7.4.240.0040.00316.50
7.4.230.0000.00816.34
7.4.220.0100.01016.50
7.4.210.0130.00316.63
7.4.200.0020.00516.66
7.4.160.0080.00816.54
7.4.150.0070.01417.40
7.4.140.0140.00817.86
7.4.130.0080.00916.54
7.4.120.0100.00916.67
7.4.110.0150.00616.50
7.4.100.0070.01416.64
7.4.90.0090.00916.54
7.4.80.0140.00419.39
7.4.70.0080.00816.34
7.4.60.0040.01316.50
7.4.50.0040.00416.64
7.4.40.0110.00516.66
7.4.30.0150.00316.43
7.4.00.0130.00314.93
7.3.330.0000.00513.38
7.3.320.0020.00213.21
7.3.310.0030.00316.41
7.3.300.0030.00316.23
7.3.290.0080.00516.34
7.3.280.0070.00916.31
7.3.270.0070.01017.40
7.3.260.0070.01116.31
7.3.250.0110.00816.40
7.3.240.0120.01316.39
7.3.230.0060.01316.39
7.3.210.0080.00816.40
7.3.200.0060.01019.39
7.3.190.0090.01416.33
7.3.180.0130.00316.55
7.3.170.0050.01116.39
7.3.160.0030.01416.41
7.2.330.0110.00716.63
7.2.320.0030.01416.73
7.2.310.0100.01316.85
7.2.300.0070.01116.56
7.2.290.0140.00416.55
7.1.200.0070.00715.54
7.1.70.0040.00416.92
7.1.60.0180.00719.11
7.1.50.0100.01317.02
7.1.00.0070.07322.29
7.0.200.0070.00416.55
7.0.140.0030.07322.15
7.0.60.0130.08020.02
7.0.50.0070.08717.82
7.0.40.0100.07020.09
7.0.30.0400.04720.25
7.0.20.0200.08720.27
7.0.10.0000.05720.15
7.0.00.0170.08020.12
5.6.280.0070.07021.00
5.6.210.0130.06720.55
5.6.200.0170.07318.19
5.6.190.0000.07720.63
5.6.180.0270.04320.47
5.6.170.0230.04720.50
5.6.160.0000.04320.50
5.6.150.0100.08018.20
5.6.140.0030.08318.18
5.6.130.0070.05018.14
5.6.120.0100.07320.95
5.6.110.0170.07721.01
5.6.100.0030.04021.05
5.6.90.0100.06021.11
5.6.80.0130.04720.51
5.5.350.0300.06320.44
5.5.340.0000.09018.04
5.5.330.0100.03720.57
5.5.320.0370.03720.20
5.5.310.0270.03020.32
5.5.300.0070.07017.99
5.5.290.0100.07718.05
5.5.280.0030.09320.89
5.5.270.0130.06720.79
5.5.260.0130.07720.89
5.5.250.0170.06720.70
5.5.240.0230.07720.27
5.4.450.0730.06019.59
5.4.440.0500.06019.46
5.4.430.0830.05319.38
5.4.420.0700.00019.53
5.4.410.0900.00019.26
5.4.400.0830.00019.17
5.4.390.0630.00019.13
5.4.380.0700.00019.13
5.4.370.0730.00019.11
5.4.360.0600.00019.07
5.4.350.0630.00019.25
5.4.340.0070.04012.02
5.4.320.0080.04712.51
5.4.310.0060.04012.50
5.4.300.0060.05212.51
5.4.290.0060.03712.50
5.4.280.0040.03812.40
5.4.270.0070.03512.40
5.4.260.0060.03812.40
5.4.250.0070.03712.40
5.4.240.0070.03612.39
5.4.230.0040.03912.39
5.4.220.0050.03712.39
5.4.210.0050.03512.39
5.4.200.0030.03912.39
5.4.190.0100.03112.39
5.4.180.0090.03312.39
5.4.170.0030.03812.40
5.4.160.0050.03612.39
5.4.150.0050.03712.39
5.4.140.0060.03612.07
5.4.130.0030.03712.06
5.4.120.0050.03712.02
5.4.110.0080.04412.02
5.4.100.0070.03712.02
5.4.90.0040.03912.02
5.4.80.0080.03412.02
5.4.70.0060.03312.01
5.4.60.0070.03212.01
5.4.50.0080.03212.01
5.4.40.0040.04312.00
5.4.30.0060.03812.00
5.4.20.0070.03912.00
5.4.10.0050.03512.00
5.4.00.0040.03711.48
5.3.290.0080.04512.80
5.3.280.0080.04712.71
5.3.270.0040.04012.72
5.3.260.0070.03712.72
5.3.250.0060.03812.72
5.3.240.0070.04312.71
5.3.230.0060.03812.71
5.3.220.0080.04412.68
5.3.210.0090.03512.68
5.3.200.0100.03812.68
5.3.190.0030.04312.68
5.3.180.0070.03912.67
5.3.170.0050.04212.67
5.3.160.0090.04412.67
5.3.150.0050.03812.68
5.3.140.0060.03712.66
5.3.130.0060.04012.66
5.3.120.0120.04012.66
5.3.110.0050.04112.66
5.3.100.0050.03912.12
5.3.90.0040.03812.10
5.3.80.0060.03512.09
5.3.70.0050.03712.09
5.3.60.0070.04012.07
5.3.50.0040.03912.02
5.3.40.0090.03412.02
5.3.30.0090.03211.98
5.3.20.0050.03411.77
5.3.10.0060.03611.74
5.3.00.0050.03911.71
5.2.170.0030.0329.22
5.2.160.0030.0309.22
5.2.150.0040.0309.21
5.2.140.0090.0359.21
5.2.130.0030.0309.18
5.2.120.0060.0259.17
5.2.110.0040.0289.18
5.2.100.0020.0309.18
5.2.90.0040.0299.18
5.2.80.0040.0309.18
5.2.70.0040.0309.18
5.2.60.0030.0319.12
5.2.50.0050.0299.09
5.2.40.0060.0279.07
5.2.30.0040.0309.05
5.2.20.0040.0299.04
5.2.10.0010.0318.94
5.2.00.0030.0308.81
5.1.60.0030.0268.09
5.1.50.0010.0278.08
5.1.40.0060.0298.07
5.1.30.0010.0288.42
5.1.20.0050.0258.43
5.1.10.0040.0298.16
5.1.00.0030.0308.16
5.0.50.0040.0256.64
5.0.40.0030.0206.50
5.0.30.0040.0306.32
5.0.20.0030.0196.29
5.0.10.0020.0216.26
5.0.00.0050.0386.25
4.4.90.0010.0204.78
4.4.80.0020.0174.75
4.4.70.0000.0184.76
4.4.60.0020.0174.75
4.4.50.0030.0284.77
4.4.40.0030.0324.71
4.4.30.0030.0214.75
4.4.20.0010.0174.84
4.4.10.0040.0144.85
4.4.00.0030.0254.75
4.3.110.0050.0244.67
4.3.100.0040.0134.66
4.3.90.0010.0164.63
4.3.80.0010.0364.58
4.3.70.0020.0164.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0030.0234.54
4.3.30.0020.0223.30
4.3.20.0010.0173.29
4.3.10.0040.0143.23
4.3.00.0230.0107.43

preferences:
44.6 ms | 401 KiB | 5 Q