3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $const = array_keys( $rc->getConstants())[0]; // $substr = substr( $const, -1,1 ); $substr = mb_substr( $const, -1,1 ); // PHP 5.6 if ( $substr === "♥" ) { trigger_error("\"♥\" in \"$const\"", E_USER_ERROR ); } // Notice: "♥" in "AB ♥" …

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.00718.97
8.3.30.0080.00619.09
8.3.20.0070.00020.16
8.3.10.0030.00623.65
8.3.00.0040.00419.07
8.2.170.0200.00022.96
8.2.160.0120.00320.23
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00721.16
8.2.110.0040.00421.96
8.2.100.0090.00618.03
8.2.90.0140.00018.95
8.2.80.0060.00317.97
8.2.70.0000.00917.63
8.2.60.0080.00017.90
8.2.50.0000.00818.07
8.2.40.0040.00419.87
8.2.30.0070.00018.11
8.2.20.0030.00617.67
8.2.10.0040.00418.00
8.2.00.0040.00417.73
8.1.270.0090.00023.86
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0060.00322.18
8.1.230.0040.00819.14
8.1.220.0030.00517.79
8.1.210.0000.00818.77
8.1.200.0120.00017.23
8.1.190.0000.00816.98
8.1.180.0040.00418.10
8.1.170.0000.00818.43
8.1.160.0040.00421.89
8.1.150.0040.00418.79
8.1.140.0030.00517.34
8.1.130.0000.00817.74
8.1.120.0000.00717.31
8.1.110.0070.00017.39
8.1.100.0050.00517.41
8.1.90.0000.00717.39
8.1.80.0030.00317.25
8.1.70.0040.00417.38
8.1.60.0030.00617.59
8.1.50.0000.00817.49
8.1.40.0050.00217.47
8.1.30.0080.00017.55
8.1.20.0040.00417.51
8.1.10.0040.00417.50
8.1.00.0000.00717.43
8.0.300.0040.00418.77
8.0.290.0000.00716.72
8.0.280.0000.00718.57
8.0.270.0030.00317.33
8.0.260.0030.00317.23
8.0.250.0000.00717.11
8.0.240.0030.00317.05
8.0.230.0080.00016.95
8.0.220.0000.00716.99
8.0.210.0070.00016.90
8.0.200.0030.00317.11
8.0.190.0040.00417.06
8.0.180.0000.00717.05
8.0.170.0080.00017.03
8.0.160.0040.00416.89
8.0.150.0070.00316.81
8.0.140.0000.00717.02
8.0.130.0040.00413.46
8.0.120.0040.00417.02
8.0.110.0070.00016.88
8.0.100.0060.00316.99
8.0.90.0070.00016.89
8.0.80.0030.01617.04
8.0.70.0000.00816.84
8.0.60.0070.00016.86
8.0.50.0040.00416.98
8.0.30.0100.01217.30
8.0.20.0110.00817.40
8.0.10.0030.00517.04
8.0.00.0070.01016.90
7.4.330.0050.00015.00
7.4.320.0000.00616.53
7.4.300.0030.00316.49
7.4.290.0070.00016.59
7.4.280.0060.00316.40
7.4.270.0040.00416.37
7.4.260.0000.00716.48
7.4.250.0080.00016.47
7.4.240.0040.00416.60
7.4.230.0030.00316.30
7.4.220.0090.01216.45
7.4.210.0130.00316.70
7.4.200.0030.00316.53
7.4.160.0080.00816.55
7.4.150.0060.01217.40
7.4.140.0120.00517.86
7.4.130.0030.01316.77
7.4.120.0080.00816.45
7.4.110.0080.00816.53
7.4.100.0090.00916.61
7.4.90.0070.01116.64
7.4.80.0150.00319.39
7.4.70.0030.01416.67
7.4.60.0000.01616.59
7.4.50.0000.00816.61
7.4.40.0050.01116.63
7.4.30.0100.00616.57
7.4.00.0070.00714.96
7.3.330.0030.00313.27
7.3.320.0000.00513.31
7.3.310.0030.00316.16
7.3.300.0070.00016.27
7.3.290.0070.00716.28
7.3.280.0070.01116.28
7.3.270.0120.00617.40
7.3.260.0090.00916.64
7.3.240.0140.00316.42
7.3.230.0070.01416.41
7.3.210.0030.01316.30
7.3.200.0090.00919.39
7.3.190.0030.01316.43
7.3.180.0080.00816.30
7.3.170.0000.01516.56
7.3.160.0080.00816.60
7.2.330.0090.00916.84
7.2.320.0110.00616.45
7.2.310.0070.01016.80
7.2.300.0160.00016.76
7.2.290.0060.01016.73
7.2.00.0000.01019.15
7.1.100.0030.01017.89
7.1.70.0000.00916.95
7.1.60.0100.01619.40
7.1.50.0070.01717.01
7.1.00.0070.07322.27
7.0.200.0300.00314.41
7.0.140.0100.06722.10
7.0.60.0070.04719.93
7.0.50.0100.08017.87
7.0.40.0100.04020.40
7.0.30.0530.07720.45
7.0.20.0270.07320.07
7.0.10.0030.05720.19
7.0.00.0070.06020.16
5.6.280.0030.07020.89
5.6.210.0200.03320.46
5.6.200.0070.05318.29
5.6.190.0070.07320.76
5.6.180.3270.03320.50
5.6.170.0270.04720.48
5.6.160.0030.07720.58
5.6.150.0070.03718.14
5.6.140.0000.04318.18
5.6.130.0070.08018.15
5.6.120.0030.05721.12
5.6.110.0200.07320.96
5.6.100.0100.06321.02
5.6.90.0030.09321.00
5.6.80.0070.07720.51
5.6.70.4670.04320.39
5.5.350.0200.07720.46
5.5.340.0070.05317.96
5.5.330.0070.04020.41
5.5.320.0370.07720.35
5.5.310.0270.06020.26
5.5.300.0100.08018.02
5.5.290.0070.08018.07
5.5.280.0000.04720.87
5.5.270.0100.05720.62
5.5.260.0130.08020.88
5.5.250.0070.07020.71
5.5.240.0270.07320.07
5.4.450.0630.05319.49
5.4.440.0100.05719.18
5.4.430.0470.05719.59
5.4.420.0530.05319.63
5.4.410.0130.05018.91
5.4.400.0300.04718.68
5.4.390.0330.07018.86
5.4.380.0170.04318.55
5.4.370.0170.04318.62
5.4.360.0070.03718.50
5.4.350.0170.07012.02
5.4.340.0050.04212.01
5.4.320.0050.04012.50
5.4.310.0040.04012.49
5.4.300.0080.03412.50
5.4.290.0040.03912.49
5.4.280.0030.03912.39
5.4.270.0060.03512.39
5.4.260.0050.03712.39
5.4.250.0060.03712.39
5.4.240.0070.03512.39
5.4.230.0080.03512.39
5.4.220.0060.03512.38
5.4.210.0030.03712.38
5.4.200.0050.03712.38
5.4.190.0020.03912.38
5.4.180.0070.03512.38
5.4.170.0060.03512.39
5.4.160.0070.03412.39
5.4.150.0070.03412.38
5.4.140.0050.03712.07
5.4.130.0070.03412.05
5.4.120.0020.03812.01
5.4.110.0110.04912.00
5.4.100.0060.03712.01
5.4.90.0040.03812.01
5.4.80.0050.03612.01
5.4.70.0060.03312.01
5.4.60.0040.03512.01
5.4.50.0040.03612.00
5.4.40.0060.03311.99
5.4.30.0060.03511.99
5.4.20.0050.03611.99
5.4.10.0070.03111.99
5.4.00.0090.03611.48
5.3.290.0070.04212.80
5.3.280.0080.04412.70
5.3.270.0050.04912.72
5.3.260.0060.05612.72
5.3.250.0060.04212.72
5.3.240.0070.04212.71
5.3.230.0060.03712.71
5.3.220.0080.03312.68
5.3.210.0080.03912.68
5.3.200.0110.03512.68
5.3.190.0070.03812.68
5.3.180.0040.03712.67
5.3.170.0100.03212.67
5.3.160.0060.03612.67
5.3.150.0050.03712.68
5.3.140.0050.03712.66
5.3.130.0040.04012.66
5.3.120.0070.04912.65
5.3.110.0090.04912.66
5.3.100.0070.03412.12
5.3.90.0060.03512.10
5.3.80.0090.03812.09
5.3.70.0080.04012.09
5.3.60.0060.03812.08
5.3.50.0080.03412.02
5.3.40.0070.03512.03
5.3.30.0060.03411.98
5.3.20.0090.04711.76
5.3.10.0080.03011.73
5.3.00.0090.04511.72
5.2.170.0070.0289.22
5.2.160.0070.0399.22
5.2.150.0030.0319.22
5.2.140.0050.0299.22
5.2.130.0050.0469.18
5.2.120.0070.0259.17
5.2.110.0050.0349.18
5.2.100.0050.0339.17
5.2.90.0050.0349.18
5.2.80.0040.0319.17
5.2.70.0070.0419.17
5.2.60.0090.0379.13
5.2.50.0060.0339.09
5.2.40.0060.0279.07
5.2.30.0050.0299.04
5.2.20.0020.0309.03
5.2.10.0060.0278.94
5.2.00.0080.0258.80
5.1.60.0060.0348.09
5.1.50.0100.0348.09
5.1.40.0030.0368.07
5.1.30.0080.0358.41
5.1.20.0070.0258.44
5.1.10.0040.0268.16
5.1.00.0050.0268.16
5.0.50.0040.0316.63
5.0.40.0030.0216.50
5.0.30.0030.0346.31
5.0.20.0040.0216.27
5.0.10.0070.0166.26
5.0.00.0050.0296.25
4.4.90.0030.0154.78
4.4.80.0040.0134.75
4.4.70.0030.0154.76
4.4.60.0040.0144.75
4.4.50.0020.0164.77
4.4.40.0030.0244.71
4.4.30.0000.0184.76
4.4.20.0040.0144.85
4.4.10.0040.0174.85
4.4.00.0040.0254.75
4.3.110.0030.0164.67
4.3.100.0020.0154.66
4.3.90.0030.0144.63
4.3.80.0010.0264.59
4.3.70.0040.0134.63
4.3.60.0040.0134.63
4.3.50.0030.0154.62
4.3.40.0020.0244.54
4.3.30.0020.0153.30
4.3.20.0030.0253.28
4.3.10.0030.0143.24
4.3.00.0030.0207.12

preferences:
44.83 ms | 400 KiB | 5 Q