3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_val_as_array($val) { $type = gettype($val); echo "val before access = ".var_export($val, true)."\n"; echo "accessing $type as array {$val['test']}\n"; $val['test'] = 'wtf'; echo "set $type offset test to string wtf\n"; echo "accessing $type offset test {$val['test']}\n"; echo "val after access = ".var_export($val, true)."\n"; }; test_val_as_array(null); test_val_as_array('test'); test_val_as_array(123); test_val_as_array(true); test_val_as_array(1.2); test_val_as_array(new 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.0070.01118.48
8.3.50.0100.00717.92
8.3.40.0070.00718.79
8.3.30.0150.00018.97
8.3.20.0040.00420.34
8.3.10.0040.00421.74
8.3.00.0040.00417.93
8.2.180.0170.01016.75
8.2.170.0110.00422.96
8.2.160.0120.00620.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00417.75
8.2.110.0040.00419.27
8.2.100.0040.00817.88
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0060.00617.75
8.2.60.0050.00318.05
8.2.50.0080.00018.07
8.2.40.0080.00021.07
8.2.30.0000.00720.71
8.2.20.0040.00417.75
8.2.10.0040.00418.02
8.2.00.0070.00018.25
8.1.280.0100.01025.92
8.1.270.0090.00021.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.81
8.1.230.0120.00017.78
8.1.220.0040.00417.75
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0000.00818.73
8.1.160.0040.00422.04
8.1.150.0040.00418.95
8.1.140.0050.00317.45
8.1.130.0000.00717.61
8.1.120.0050.00217.52
8.1.110.0040.00417.49
8.1.100.0000.00817.45
8.1.90.0000.00717.46
8.1.80.0030.00617.48
8.1.70.0030.00317.38
8.1.60.0000.00817.57
8.1.50.0080.00017.56
8.1.40.0080.00317.53
8.1.30.0040.00417.59
8.1.20.0000.00817.61
8.1.10.0080.00017.46
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00818.50
8.0.270.0050.00317.25
8.0.260.0030.00317.20
8.0.250.0080.00017.11
8.0.240.0050.00317.01
8.0.230.0080.00017.07
8.0.220.0000.00716.98
8.0.210.0030.00316.92
8.0.200.0000.00616.95
8.0.190.0000.00817.08
8.0.180.0040.00716.94
8.0.170.0000.00816.90
8.0.160.0070.00016.89
8.0.150.0030.00316.99
8.0.140.0000.00916.94
8.0.130.0060.00013.41
8.0.120.0040.00416.83
8.0.110.0000.00816.96
8.0.100.0050.00316.84
8.0.90.0000.00716.96
8.0.80.0030.01417.00
8.0.70.0000.00916.79
8.0.60.0040.00417.02
8.0.50.0070.00016.84
8.0.30.0180.00317.10
8.0.20.0080.01117.40
8.0.10.0030.00617.15
8.0.00.0100.01116.89
7.4.330.0030.00315.14
7.4.320.0030.00316.45
7.4.300.0000.00716.61
7.4.290.0000.00716.49
7.4.280.0100.00016.62
7.4.270.0030.00616.45
7.4.260.0050.00516.47
7.4.250.0100.00016.48
7.4.240.0040.00416.55
7.4.230.0070.00016.28
7.4.220.0090.01216.56
7.4.210.0060.01416.59
7.4.200.0030.00316.68
7.4.160.0060.00916.49
7.4.150.0090.00917.40
7.4.140.0080.01517.86
7.4.130.0060.01216.49
7.4.120.0100.00716.46
7.4.110.0100.01016.63
7.4.100.0150.00316.59
7.4.90.0180.00016.60
7.4.80.0210.00019.39
7.4.70.0140.00316.54
7.4.60.0100.01016.53
7.4.50.0000.00816.59
7.4.40.0150.00716.68
7.4.30.0070.01516.52
7.4.00.0070.01114.88
7.3.330.0000.00513.40
7.3.320.0030.00313.47
7.3.310.0000.00716.49
7.3.300.0000.00716.46
7.3.290.0100.01116.41
7.3.280.0080.01116.45
7.3.270.0090.00917.40
7.3.260.0120.00916.42
7.3.250.0070.01016.51
7.3.240.0040.01416.45
7.3.230.0100.00716.55
7.3.210.0070.01016.46
7.3.200.0080.00816.48
7.3.190.0100.00716.40
7.3.180.0060.00916.38
7.3.170.0100.01316.51
7.3.160.0030.01316.41
7.3.10.0000.01216.69
7.3.00.0100.00316.84
7.2.330.0130.00616.64
7.2.320.0120.00616.83
7.2.310.0080.01116.27
7.2.300.0110.00716.41
7.2.290.0110.00616.81
7.2.130.0080.00616.77
7.2.120.0100.00317.03
7.2.110.0060.01216.98
7.2.100.0030.01516.92
7.2.90.0030.00617.07
7.2.80.0040.00817.04
7.2.70.0060.00617.15
7.2.60.0080.00416.93
7.2.50.0090.00617.05
7.2.40.0040.00717.04
7.2.30.0040.01116.85
7.2.20.0100.00316.72
7.2.10.0070.00316.90
7.2.00.0050.00718.15
7.1.250.0080.00416.03
7.1.200.0090.00615.58
7.1.100.0100.00017.88
7.1.70.0090.00017.31
7.1.60.0140.01119.19
7.1.50.0130.00017.12
7.1.00.0000.07722.31
7.0.200.0000.00816.82
7.0.60.0100.07319.88
7.0.50.0130.03317.97
7.0.40.0200.03720.40
7.0.30.0270.08020.21
7.0.20.0230.08320.07
7.0.10.0100.07720.33
7.0.00.0070.08720.33
5.6.280.0000.03321.12
5.6.210.0170.04320.77
5.6.200.0100.08318.12
5.6.190.0130.07720.46
5.6.180.0170.08320.34
5.6.170.0200.06320.43
5.6.160.0030.08320.61
5.6.150.0070.07718.14
5.6.140.0070.06018.20
5.6.130.0030.08018.23
5.6.120.0100.06721.10
5.6.110.0070.08320.99
5.6.100.0130.05721.12
5.6.90.0100.05321.11
5.6.80.0130.06320.47
5.5.350.0030.07320.53
5.5.340.0170.06318.04
5.5.330.0100.06020.57
5.5.320.0200.04720.31
5.5.310.0270.08020.30
5.5.300.0100.05318.03
5.5.290.0030.07717.98
5.5.280.0100.05020.88
5.5.270.0170.06720.67
5.5.260.0130.07720.79
5.5.250.0100.03720.69
5.5.240.0030.07320.17
5.4.450.0670.06319.48
5.4.440.0600.06019.58
5.4.430.0600.05319.45
5.4.420.0630.05019.38
5.4.410.0700.04719.23
5.4.400.0630.06719.26
5.4.390.0630.05719.14
5.4.380.0700.06719.29
5.4.370.0900.06719.31
5.4.360.0770.05019.14
5.4.350.0870.05019.36
5.4.340.0600.05719.36
5.4.320.0570.06719.25
5.4.310.0670.05319.30
5.4.300.0700.06319.12
5.4.290.0630.06019.02
5.4.280.0830.05719.16
5.4.270.0700.05318.87
5.4.260.0630.05319.27
5.4.250.0630.06319.05
5.4.240.0830.06019.12
5.4.230.0730.07318.83
5.4.220.0730.06319.05
5.4.210.0670.05319.14
5.4.200.0600.05719.24
5.4.190.0600.06719.27
5.4.180.0530.06018.97
5.4.170.0730.05019.13
5.4.160.0770.05319.11
5.4.150.0600.06318.82
5.4.140.0630.05716.57
5.4.130.0730.05016.57
5.4.120.0730.04716.44
5.4.110.0600.06316.64
5.4.100.0730.06316.69
5.4.90.0770.05316.68
5.4.80.0630.05316.65
5.4.70.0270.06716.31
5.4.60.0170.03316.34
5.4.50.0300.06016.55
5.4.40.0330.06016.51
5.4.30.0030.07316.48
5.4.20.0030.07016.25
5.4.10.0400.05716.42

preferences:
50.06 ms | 400 KiB | 5 Q