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>';var_dump(get_defined_vars()); if( array_key_exists( "123",get_defined_vars() ) ){ echo "'123' in array"; } echo "\n\n"; $arr{"246a"} = 99; var_dump($arr); $o = (object) $arr; var_dump($o); echo $o->{"246a"},"\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.0080.00618.29
8.3.50.0100.00921.09
8.3.40.0110.00418.70
8.3.30.0070.00718.95
8.3.20.0070.00020.16
8.3.10.0080.00023.48
8.3.00.0080.00019.13
8.2.180.0070.00718.16
8.2.170.0140.00022.96
8.2.160.0100.00720.35
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0100.00721.98
8.2.110.0030.00620.55
8.2.100.0120.00019.45
8.2.90.0050.00318.07
8.2.80.0060.00317.97
8.2.70.0000.00917.50
8.2.60.0000.00817.88
8.2.50.0000.00818.07
8.2.40.0040.00418.09
8.2.30.0040.00417.95
8.2.20.0040.00417.44
8.2.10.0000.00817.93
8.2.00.0000.00717.55
8.1.280.0070.01425.92
8.1.270.0040.00422.06
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00822.14
8.1.230.0040.00820.97
8.1.220.0060.00317.74
8.1.210.0040.00418.80
8.1.200.0090.00017.10
8.1.190.0080.00017.00
8.1.180.0060.00318.10
8.1.170.0050.00318.59
8.1.160.0040.00421.96
8.1.150.0040.00418.83
8.1.140.0040.00417.26
8.1.130.0000.00717.64
8.1.120.0000.00717.35
8.1.110.0000.00717.33
8.1.100.0000.00717.21
8.1.90.0040.00417.20
8.1.80.0070.00017.39
8.1.70.0070.00017.28
8.1.60.0030.00517.51
8.1.50.0080.00017.46
8.1.40.0080.00017.31
8.1.30.0090.00017.49
8.1.20.0080.00017.58
8.1.10.0030.00517.25
8.1.00.0000.00817.21
8.0.300.0000.00720.04
8.0.290.0040.00416.63
8.0.280.0070.00018.32
8.0.270.0030.00317.12
8.0.260.0030.00317.13
8.0.250.0030.00316.77
8.0.240.0030.00516.88
8.0.230.0030.00316.89
8.0.220.0000.00916.74
8.0.210.0030.00616.71
8.0.200.0000.00616.86
8.0.190.0000.00716.93
8.0.180.0000.00716.84
8.0.170.0040.00416.82
8.0.160.0000.00816.82
8.0.150.0000.00816.66
8.0.140.0070.00016.79
8.0.130.0030.00313.26
8.0.120.0000.00716.70
8.0.110.0030.00516.87
8.0.100.0000.00716.76
8.0.90.0000.00716.83
8.0.80.0070.01016.76
8.0.70.0050.00316.89
8.0.60.0040.00416.65
8.0.50.0050.00316.71
8.0.30.0110.00816.83
8.0.20.0080.01117.40
8.0.10.0000.00816.94
8.0.00.0120.00516.64
7.4.330.0020.00215.00
7.4.320.0030.00316.56
7.4.300.0000.00616.51
7.4.290.0000.00716.36
7.4.280.0000.00816.44
7.4.270.0000.00816.44
7.4.260.0040.00416.58
7.4.250.0030.00316.42
7.4.240.0020.00516.50
7.4.230.0000.00816.50
7.4.220.0100.01316.66
7.4.210.0070.00916.52
7.4.200.0000.00716.57
7.4.160.0170.00716.59
7.4.150.0040.01417.40
7.4.140.0080.01317.86
7.4.130.0070.01116.47
7.4.120.0090.01216.67
7.4.110.0030.01316.55
7.4.100.0100.01016.68
7.4.90.0060.01216.56
7.4.80.0060.01219.39
7.4.70.0140.00316.44
7.4.60.0030.01316.58
7.4.50.0000.00516.38
7.4.40.0080.00816.65
7.4.30.0060.01216.47
7.4.00.0100.00714.95
7.3.330.0000.00513.30
7.3.320.0050.00013.25
7.3.310.0040.00416.36
7.3.300.0000.00716.30
7.3.290.0070.00716.30
7.3.280.0090.00716.30
7.3.270.0140.00917.40
7.3.260.0070.01016.47
7.3.250.0090.00816.30
7.3.240.0030.01616.59
7.3.230.0110.01016.39
7.3.210.0160.00816.51
7.3.200.0030.01319.39
7.3.190.0150.00616.52
7.3.180.0100.00616.48
7.3.170.0000.01616.35
7.3.160.0090.00916.40
7.3.120.0070.01214.79
7.3.110.0040.01314.61
7.3.100.0050.01114.74
7.3.90.0060.00814.84
7.3.80.0020.01014.98
7.3.70.0080.00714.65
7.3.60.0060.00414.75
7.3.50.0050.00614.76
7.3.40.0040.00914.74
7.3.30.0080.00914.75
7.3.20.0080.00716.70
7.3.10.0000.01416.75
7.3.00.0070.00716.46
7.2.330.0090.00916.80
7.2.320.0140.00316.80
7.2.310.0070.01016.69
7.2.300.0100.01016.63
7.2.290.0120.00616.71
7.2.250.0030.01315.22
7.2.240.0090.00815.00
7.2.230.0080.00815.07
7.2.220.0080.00714.96
7.2.210.0050.00815.13
7.2.200.0050.00815.06
7.2.190.0030.00715.05
7.2.180.0060.00614.96
7.2.170.0080.00815.09
7.2.160.0000.01415.01
7.2.150.0110.00016.73
7.2.140.0040.01116.79
7.2.130.0070.00716.85
7.2.120.0040.00716.98
7.2.110.0040.00416.97
7.2.100.0090.00616.75
7.2.90.0070.01016.88
7.2.80.0030.00817.00
7.2.70.0070.00316.75
7.2.60.0100.00616.93
7.2.50.0030.01116.94
7.2.40.0040.01417.11
7.2.30.0120.00617.06
7.2.20.0060.01317.05
7.2.10.0000.01117.07
7.2.00.0070.01017.05
7.1.330.0090.00715.85
7.1.320.0070.00815.71
7.1.310.0050.00715.54
7.1.300.0020.01015.79
7.1.290.0070.00715.73
7.1.280.0080.00615.68
7.1.270.0040.00715.94
7.1.260.0080.00515.72
7.1.250.0030.00815.87
7.1.240.0060.00915.47
7.1.230.0000.01015.70
7.1.220.0040.01115.78
7.1.210.0090.00615.84
7.1.200.0090.00315.68
7.1.190.0040.01115.85
7.1.180.0030.01215.87
7.1.170.0080.00815.75
7.1.160.0040.01115.79
7.1.150.0070.01115.55
7.1.140.0030.01015.90
7.1.130.0030.01215.95
7.1.120.0000.01415.48
7.1.110.0030.00915.70
7.1.100.0060.00615.95
7.1.90.0110.00415.55
7.1.80.0030.00615.80
7.1.70.0040.00716.40
7.1.60.0050.01217.46
7.1.50.0060.01216.46
7.1.40.0070.01015.77
7.1.30.0030.01315.69
7.1.20.0090.00915.53
7.1.10.0120.00315.81
7.1.00.0090.03819.06
7.0.330.0030.00915.58
7.0.320.0030.00615.41
7.0.310.0070.00715.36
7.0.300.0060.00915.41
7.0.290.0060.00615.24
7.0.280.0070.00715.27
7.0.270.0070.00315.32
7.0.260.0030.00615.32
7.0.250.0060.00615.37
7.0.240.0000.01615.44
7.0.230.0030.00615.55
7.0.220.0060.00615.63
7.0.210.0070.00715.48
7.0.200.0020.00616.18
7.0.190.0040.01115.49
7.0.180.0000.01315.19
7.0.170.0070.01115.47
7.0.160.0060.00915.21
7.0.150.0030.01315.36
7.0.140.0050.04018.85
7.0.130.0040.00815.38
7.0.120.0040.00715.21
7.0.110.0060.00915.53
7.0.100.0000.01315.59
7.0.90.0040.01215.42
7.0.80.0060.00615.50
7.0.70.0000.01515.44
7.0.60.0080.03217.72
7.0.50.0030.04716.74
7.0.40.0110.03216.86
7.0.30.0230.02816.73
7.0.20.0150.03316.84
7.0.10.0020.03316.86
7.0.00.0030.04616.74
5.6.400.0000.01614.74
5.6.390.0000.01014.68
5.6.380.0120.00314.53
5.6.370.0000.01214.63
5.6.360.0100.00714.79
5.6.350.0070.00314.32
5.6.340.0070.01114.46
5.6.330.0100.00314.45
5.6.320.0000.01114.46
5.6.310.0030.01114.46
5.6.300.0070.01014.48
5.6.290.0030.01214.70
5.6.280.0060.03617.72
5.6.270.0060.00614.65
5.6.260.0030.00914.57
5.6.250.0050.00814.44
5.6.240.0000.01614.48
5.6.230.0100.00314.40
5.6.220.0030.00914.52
5.6.210.0080.04317.72
5.6.200.0060.03016.34
5.6.190.0070.03017.63
5.6.180.0200.02317.38
5.6.170.0150.04317.37
5.6.160.0050.02417.58
5.6.150.0030.04816.33
5.6.140.0070.04716.32
5.6.130.0130.03816.22
5.6.120.0080.04517.75
5.6.110.0060.03317.83
5.6.100.0070.02217.59
5.6.90.0120.04117.78
5.6.80.0100.04017.36
5.6.70.0040.01114.39
5.6.60.0060.01214.18
5.6.50.0100.00314.64
5.6.40.0040.00714.19
5.6.30.0070.01014.52
5.6.20.0000.01314.40
5.6.10.0070.01014.28
5.6.00.0000.01114.39
5.5.380.0000.01414.25
5.5.370.0060.00614.41
5.5.360.0000.01314.71
5.5.350.0050.04717.40
5.5.340.0030.05016.12
5.5.330.0050.05117.38
5.5.320.0130.02817.30
5.5.310.0070.02417.26
5.5.300.0070.03116.19
5.5.290.0080.04416.14
5.5.280.0050.04517.59
5.5.270.0080.02917.62
5.5.260.0080.04717.50
5.5.250.0040.04117.40
5.5.240.0120.04317.30
5.5.230.0130.00314.29
5.5.220.0000.01014.52
5.5.210.0100.00614.54
5.5.200.0060.00614.34
5.5.190.0070.00314.52
5.5.180.0000.01014.43
5.5.170.0030.00914.21
5.5.160.0000.01314.60
5.5.150.0100.00014.40
5.5.140.0030.01114.46
5.5.130.0080.00414.50
5.5.120.0070.00714.32
5.5.110.0060.01014.38
5.5.100.0030.00614.55
5.5.90.0100.00314.14
5.5.80.0040.01114.59
5.5.70.0060.00614.28
5.5.60.0060.00614.38
5.5.50.0120.00414.06
5.5.40.0100.00713.97
5.5.30.0080.00414.55
5.5.20.0100.00314.34
5.5.10.0060.00613.93
5.5.00.0080.00313.94
5.4.450.0420.02715.60
5.4.440.0380.02815.68
5.4.430.0450.03015.54
5.4.420.0350.00415.49
5.4.410.0350.00315.55
5.4.400.0330.00215.57
5.4.390.0350.00415.51
5.4.380.0370.00215.51
5.4.370.0370.00415.48
5.4.360.0320.00515.44
5.4.350.0350.00215.37
5.4.340.0040.02311.89
5.4.330.0030.00511.76
5.4.320.0080.02012.13
5.4.310.0070.02212.13
5.4.300.0090.01912.13
5.4.290.0040.02212.13
5.4.280.0070.02012.08
5.4.270.0070.02012.08
5.4.260.0040.02412.08
5.4.250.0100.01712.08
5.4.240.0020.02412.08
5.4.230.0070.02312.07
5.4.220.0090.02012.07
5.4.210.0070.01912.08
5.4.200.0090.02212.07
5.4.190.0060.02312.07
5.4.180.0080.02112.07
5.4.170.0040.02212.08
5.4.160.0060.02412.08
5.4.150.0030.02312.07
5.4.140.0060.02311.92
5.4.130.0040.02411.91
5.4.120.0050.02011.89
5.4.110.0040.02011.88
5.4.100.0060.02711.89
5.4.90.0050.02511.89
5.4.80.0060.02211.89
5.4.70.0040.02711.89
5.4.60.0060.01811.89
5.4.50.0070.02111.88
5.4.40.0020.02511.88
5.4.30.0050.02311.88
5.4.20.0040.02311.88
5.4.10.0070.02211.88
5.4.00.0050.02211.62
5.3.290.0060.04012.80
5.3.280.0080.04712.71
5.3.270.0090.04112.72
5.3.260.0070.04112.72
5.3.250.0050.03912.71
5.3.240.0140.03612.72
5.3.230.0090.03612.71
5.3.220.0090.03612.68
5.3.210.0050.04112.68
5.3.200.0050.03712.68
5.3.190.0090.03512.68
5.3.180.0040.03812.68
5.3.170.0020.04212.66
5.3.160.0090.03912.67
5.3.150.0020.04112.68
5.3.140.0070.04612.66
5.3.130.0050.03912.66
5.3.120.0030.04212.66
5.3.110.0070.03912.66
5.3.100.0090.03612.12
5.3.90.0070.04012.10
5.3.80.0070.03412.10
5.3.70.0040.03712.09
5.3.60.0050.03712.07
5.3.50.0060.03612.02
5.3.40.0070.04712.02
5.3.30.0090.03611.98
5.3.20.0060.03411.76
5.3.10.0040.03611.73
5.3.00.0050.03611.71
5.2.170.0060.0299.22
5.2.160.0030.0319.21
5.2.150.0070.0329.21
5.2.140.0050.0309.21
5.2.130.0040.0299.18
5.2.120.0060.0269.18
5.2.110.0070.0319.18
5.2.100.0010.0349.18
5.2.90.0040.0309.18
5.2.80.0040.0319.18
5.2.70.0010.0339.18
5.2.60.0010.0349.13
5.2.50.0040.0309.09
5.2.40.0050.0279.07
5.2.30.0050.0289.05
5.2.20.0070.0269.04
5.2.10.0050.0288.95
5.2.00.0070.0268.81
5.1.60.0030.0258.09
5.1.50.0050.0248.09
5.1.40.0040.0248.06
5.1.30.0040.0268.42
5.1.20.0050.0258.43
5.1.10.0050.0248.16
5.1.00.0060.0238.16
5.0.50.0070.0166.66
5.0.40.0060.0166.52
5.0.30.0040.0306.33
5.0.20.0030.0196.30
5.0.10.0040.0236.27
5.0.00.0030.0306.26
4.4.90.0020.0194.78
4.4.80.0020.0254.76
4.4.70.0030.0144.76
4.4.60.0020.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0040.0174.76
4.4.20.0030.0144.85
4.4.10.0050.0134.85
4.4.00.0040.0234.76
4.3.110.0050.0134.67
4.3.100.0030.0144.66
4.3.90.0020.0144.64
4.3.80.0010.0254.58
4.3.70.0030.0134.63
4.3.60.0000.0164.63
4.3.50.0040.0144.63
4.3.40.0020.0244.53
4.3.30.0030.0233.30
4.3.20.0020.0153.29
4.3.10.0000.0183.24
4.3.00.0130.0207.43

preferences:
39.54 ms | 401 KiB | 5 Q