3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('one', 'two', 'three', new stdClass, array()); var_dump(is_array($array[4])); foreach($array as $key=>$value) { switch($value) { case 'one': echo 'one'; break; case 'two': echo 'two'; break; case 'three': echo 'three'; break; case is_object($value): echo 'object'; break; case is_array($value) === true: echo 'array'; break; } }

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.40.0140.00418.84
8.3.30.0040.01119.09
8.3.20.0030.00520.25
8.3.10.0040.00423.69
8.3.00.0080.00017.63
8.2.170.0100.00722.96
8.2.160.0130.00320.39
8.2.150.0040.01124.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0100.00018.02
8.2.110.0090.00021.12
8.2.100.0080.00317.84
8.2.90.0040.00419.21
8.2.80.0000.00817.97
8.2.70.0000.01017.50
8.2.60.0050.00517.93
8.2.50.0080.00018.22
8.2.40.0030.00620.61
8.2.30.0040.00419.20
8.2.20.0080.00017.70
8.2.10.0040.00418.24
8.2.00.0040.00417.88
8.1.270.0060.00323.96
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.82
8.1.230.0070.00417.82
8.1.220.0000.00717.77
8.1.210.0050.00318.77
8.1.200.0030.00617.25
8.1.190.0030.00617.25
8.1.180.0050.00318.10
8.1.170.0040.00418.43
8.1.160.0050.00218.96
8.1.150.0040.00420.21
8.1.140.0040.00417.48
8.1.130.0070.00017.89
8.1.120.0000.00817.32
8.1.110.0000.00817.40
8.1.100.0040.00417.53
8.1.90.0000.00717.54
8.1.80.0000.00717.39
8.1.70.0000.00717.34
8.1.60.0000.00817.60
8.1.50.0090.00017.57
8.1.40.0040.00417.43
8.1.30.0080.00017.66
8.1.20.0000.00717.66
8.1.10.0000.00717.65
8.1.00.0040.00417.60
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.40
8.0.270.0050.00317.18
8.0.260.0000.00617.29
8.0.250.0030.00317.02
8.0.240.0040.00416.85
8.0.230.0000.00717.03
8.0.220.0000.00716.90
8.0.210.0030.00516.80
8.0.200.0040.00416.89
8.0.190.0000.00816.96
8.0.180.0070.00017.01
8.0.170.0070.00016.94
8.0.160.0040.00416.85
8.0.150.0080.00016.84
8.0.140.0110.00016.93
8.0.130.0030.00613.24
8.0.120.0000.00816.87
8.0.110.0070.00016.82
8.0.100.0050.00216.92
8.0.90.0030.00316.86
8.0.80.0080.00816.80
8.0.70.0040.00417.02
8.0.60.0030.00516.95
8.0.50.0040.00416.77
8.0.30.0130.00617.13
8.0.20.0150.01117.40
8.0.10.0050.00216.99
8.0.00.0130.00816.71
7.4.330.0060.00015.00
7.4.320.0000.00716.52
7.4.300.0040.00416.54
7.4.290.0050.00316.47
7.4.280.0050.00516.59
7.4.270.0000.00816.62
7.4.260.0040.00416.63
7.4.250.0030.00516.43
7.4.240.0040.00416.54
7.4.230.0000.00716.73
7.4.220.0130.00716.72
7.4.210.0000.01416.60
7.4.200.0040.00416.38
7.4.160.0120.00416.60
7.4.150.0110.00817.40
7.4.140.0070.01217.86
7.4.130.0060.01016.55
7.4.120.0060.01216.50
7.4.110.0100.00716.68
7.4.100.0110.01116.60
7.4.90.0100.00616.53
7.4.80.0060.00919.39
7.4.70.0120.01216.50
7.4.60.0070.01016.52
7.4.50.0000.00816.57
7.4.40.0160.00616.28
7.4.30.0000.01516.59
7.4.00.0100.00315.12
7.3.330.0030.00313.25
7.3.320.0030.00313.29
7.3.310.0000.00716.22
7.3.300.0000.00716.37
7.3.290.0080.01116.39
7.3.280.0060.01116.27
7.3.270.0130.00717.40
7.3.260.0120.00616.56
7.3.250.0100.00716.47
7.3.240.0100.00616.57
7.3.230.0110.00716.39
7.3.210.0090.01216.35
7.3.200.0130.00319.39
7.3.190.0090.01216.61
7.3.180.0100.00616.65
7.3.170.0100.00716.37
7.3.160.0040.01116.57
7.2.330.0120.01216.45
7.2.320.0110.00616.70
7.2.310.0090.01416.86
7.2.300.0130.00416.74
7.2.290.0040.01216.70
7.2.00.0000.01119.20
7.1.100.0070.00718.28
7.1.70.0000.00717.19
7.1.60.0120.01219.40
7.1.50.0110.00416.87
7.1.00.0100.06722.44
7.0.200.0090.00316.19
7.0.140.0170.06321.97
7.0.60.0130.06319.87
7.0.50.0070.03717.89
7.0.40.0000.09320.27
7.0.30.0500.07020.11
7.0.20.0300.04320.16
7.0.10.0100.08320.31
7.0.00.0070.09320.20
5.6.280.0000.07720.77
5.6.210.0130.06720.52
5.6.200.0100.08018.08
5.6.190.0130.07720.77
5.6.180.3930.04020.36
5.6.170.0130.04720.62
5.6.160.0100.05320.33
5.6.150.0070.03718.21
5.6.140.0000.06718.11
5.6.130.0070.08318.14
5.6.120.0300.06021.02
5.6.110.0130.08020.98
5.6.100.0070.06321.00
5.6.90.0000.09020.96
5.6.80.0130.06320.48
5.5.350.0330.07320.38
5.5.340.0130.07018.02
5.5.330.0070.04320.20
5.5.320.0370.06020.31
5.5.310.0400.06320.24
5.5.300.0030.04017.98
5.5.290.0100.08018.01
5.5.280.0030.04320.96
5.5.270.0030.08720.95
5.5.260.0030.08020.67
5.5.250.0070.06020.66
5.5.240.0030.03720.28
5.4.450.0070.06019.32
5.4.440.0300.04719.49
5.4.430.0370.04319.63
5.4.420.0330.04019.44
5.4.410.0070.05718.97
5.4.400.0330.05718.62
5.4.390.0270.05318.55
5.4.380.0030.05718.61
5.4.370.0100.03718.61
5.4.360.0070.03718.52
5.4.350.0050.03711.97
5.4.340.0040.03611.97
5.4.320.0060.03612.45
5.4.310.0090.03412.45
5.4.300.0050.04312.46
5.4.290.0100.03312.45
5.4.280.0050.03612.35
5.4.270.0040.03812.35
5.4.260.0040.03912.35
5.4.250.0060.03612.35
5.4.240.0100.03612.35
5.4.230.0060.04112.34
5.4.220.0060.04412.34
5.4.210.0080.03312.34
5.4.200.0080.03712.34
5.4.190.0040.03812.34
5.4.180.0050.03912.34
5.4.170.0070.04012.35
5.4.160.0050.03912.35
5.4.150.0020.04112.34
5.4.140.0060.03712.03
5.4.130.0070.03612.01
5.4.120.0080.03211.97
5.4.110.0060.03611.96
5.4.100.0080.03211.97
5.4.90.0080.04011.97
5.4.80.0070.03711.97
5.4.70.0060.03411.96
5.4.60.0050.04811.96
5.4.50.0050.03611.96
5.4.40.0060.03711.95
5.4.30.0050.03511.95
5.4.20.0020.03811.95
5.4.10.0050.03811.95
5.4.00.0060.04011.44
5.3.290.0040.04112.80
5.3.280.0110.04512.71
5.3.270.0060.03812.73
5.3.260.0030.04112.72
5.3.250.0050.04212.72
5.3.240.0050.03912.72
5.3.230.0100.03812.71
5.3.220.0070.03712.68
5.3.210.0050.04012.68
5.3.200.0070.03612.68
5.3.190.0080.04012.68
5.3.180.0080.03712.67
5.3.170.0060.04012.67
5.3.160.0050.03712.67
5.3.150.0060.04212.68
5.3.140.0070.03412.66
5.3.130.0070.03712.66
5.3.120.0050.04012.66
5.3.110.0050.04512.65
5.3.100.0060.03612.12
5.3.90.0050.03912.09
5.3.80.0040.03812.07
5.3.70.0080.04112.07
5.3.60.0060.03512.06
5.3.50.0050.03612.00
5.3.40.0070.03512.00
5.3.30.0060.03411.94
5.3.20.0050.03511.73
5.3.10.0060.03411.69
5.3.00.0060.03511.68
5.2.170.0050.0299.18
5.2.160.0030.0369.18
5.2.150.0050.0329.18
5.2.140.0030.0319.18
5.2.130.0030.0309.14
5.2.120.0050.0289.14
5.2.110.0030.0309.14
5.2.100.0040.0349.14
5.2.90.0040.0299.14
5.2.80.0040.0329.14
5.2.70.0050.0319.14
5.2.60.0070.0279.09
5.2.50.0030.0329.06
5.2.40.0040.0299.04
5.2.30.0040.0299.01
5.2.20.0070.0269.00
5.2.10.0060.0278.92
5.2.00.0030.0318.78
5.1.60.0050.0238.07
5.1.50.0050.0248.06
5.1.40.0050.0248.04
5.1.30.0020.0288.39
5.1.20.0080.0228.41
5.1.10.0050.0258.14
5.1.00.0040.0268.14
5.0.50.0010.0236.63
5.0.40.0060.0176.48
5.0.30.0020.0346.30
5.0.20.0040.0206.27
5.0.10.0040.0196.25
5.0.00.0030.0316.24
4.4.90.0050.0194.78
4.4.80.0050.0174.76
4.4.70.0020.0204.75
4.4.60.0030.0264.75
4.4.50.0030.0194.77
4.4.40.0020.0264.71
4.4.30.0030.0164.76
4.4.20.0020.0154.84
4.4.10.0010.0164.85
4.4.00.0030.0254.76
4.3.110.0030.0184.67
4.3.100.0050.0124.67
4.3.90.0020.0154.63
4.3.80.0030.0244.58
4.3.70.0010.0164.63
4.3.60.0010.0174.63
4.3.50.0020.0164.63
4.3.40.0020.0244.53
4.3.30.0000.0183.30
4.3.20.0020.0163.28
4.3.10.0020.0153.23
4.3.00.0100.0207.29

preferences:
40.05 ms | 400 KiB | 5 Q