3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'blah1' => 1, 'blah2' => 2, 'blah3' => 3 ); class Blah { public static $blah1 = 4; protected static $blah2 = 5; private static $blah3 = 6; } $rc = new ReflectionClass('Blah'); // brand new ReflectionClass var_dump($rc); $static = $rc->getProperties(ReflectionProperty::IS_STATIC); $obj = $rc->newInstanceWithoutConstructor(); foreach($static as $prop){ if(!empty($arr[$prop->getName()])){ $prop->setAccessible(true); $prop->setValue($obj, $arr[$prop->getName()]); //$rc->setStaticPropertyValue($prop->getName(), $arr[$prop->getName()]); } } $obj2 = $rc->newInstanceWithoutConstructor(); // instantiate class after ReflectionClass has set all property values var_dump($obj2); var_dump($obj2::$blah1); // class instantiated before ReflectionClass captured ReflectionClass values // but after we have called "setValue" var_dump($obj); var_dump($obj::$blah1);

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.0190.00616.38
8.3.50.0070.00717.99
8.3.40.0070.00718.77
8.3.30.0110.00419.08
8.3.20.0040.00420.07
8.3.10.0110.00421.71
8.3.00.0050.00320.90
8.2.180.0090.00916.50
8.2.170.0040.01122.96
8.2.160.0040.01121.96
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.66
8.2.110.0090.00020.52
8.2.100.0110.00017.91
8.2.90.0040.00419.13
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0030.00620.01
8.2.30.0040.00418.05
8.2.20.0000.00717.75
8.2.10.0040.00418.07
8.2.00.0000.00717.68
8.1.280.0120.00325.92
8.1.270.0080.00018.82
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00621.95
8.1.230.0120.00022.65
8.1.220.0080.00017.76
8.1.210.0000.00818.77
8.1.200.0000.01017.35
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0080.00018.56
8.1.160.0040.00421.92
8.1.150.0070.00018.82
8.1.140.0000.00717.44
8.1.130.0000.00817.73
8.1.120.0040.00417.44
8.1.110.0070.00017.45
8.1.100.0050.00317.48
8.1.90.0040.00417.46
8.1.80.0070.00017.53
8.1.70.0040.00417.37
8.1.60.0060.00317.49
8.1.50.0060.00317.51
8.1.40.0040.00417.40
8.1.30.0030.00517.58
8.1.20.0000.00717.47
8.1.10.0040.00417.52
8.1.00.0000.01017.48
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0080.00018.50
8.0.270.0030.00317.20
8.0.260.0030.00317.32
8.0.250.0030.00316.94
8.0.240.0000.00816.94
8.0.230.0030.00316.83
8.0.220.0000.00716.92
8.0.210.0030.00316.88
8.0.200.0080.00016.95
8.0.190.0070.00016.92
8.0.180.0050.00316.87
8.0.170.0050.00316.95
8.0.160.0000.00716.93
8.0.150.0030.00516.84
8.0.140.0050.00316.76
8.0.130.0000.00613.30
8.0.120.0000.00816.80
8.0.110.0000.00816.85
8.0.100.0030.00516.76
8.0.90.0000.00816.83
8.0.80.0000.02016.92
8.0.70.0040.00416.89
8.0.60.0070.00016.89
8.0.50.0080.00016.86
8.0.30.0120.01017.10
8.0.20.0190.00817.40
8.0.10.0000.00816.93
8.0.00.0090.00916.80
7.4.330.0050.00015.07
7.4.320.0030.00316.47
7.4.300.0030.00316.49
7.4.290.0030.00516.50
7.4.280.0000.00816.53
7.4.270.0000.00716.60
7.4.260.0000.00816.48
7.4.250.0060.00316.46
7.4.240.0020.00516.52
7.4.230.0000.00716.71
7.4.220.0110.01416.55
7.4.210.0100.00316.67
7.4.200.0000.00716.62
7.4.160.0150.00016.62
7.4.150.0130.01317.40
7.4.140.0060.01217.86
7.4.130.0110.00616.58
7.4.120.0100.00716.53
7.4.110.0110.01116.64
7.4.100.0120.00816.49
7.4.90.0090.00916.41
7.4.80.0100.01316.51
7.4.70.0080.00816.64
7.4.60.0000.01716.53
7.4.50.0030.00316.44
7.4.40.0100.01216.63
7.4.30.0130.01016.56
7.4.00.0030.01015.06
7.3.330.0000.00613.18
7.3.320.0130.00013.29
7.3.310.0070.00016.39
7.3.300.0020.00516.23
7.3.290.0100.00516.37
7.3.280.0080.01116.37
7.3.270.0000.01717.40
7.3.260.0120.00616.29
7.3.250.0190.01616.58
7.3.240.0100.00716.40
7.3.230.0130.00316.55
7.3.210.0130.00516.45
7.3.200.0110.00819.39
7.3.190.0070.01416.38
7.3.180.0090.00916.44
7.3.170.0120.00616.38
7.3.160.0110.00816.59
7.2.330.0100.01016.43
7.2.320.0190.00016.74
7.2.310.0090.00916.50
7.2.300.0060.01616.80
7.2.290.0110.01116.80
7.2.110.0390.00616.57
7.2.100.0270.01516.73
7.2.90.0320.00916.84
7.2.80.0430.01016.88
7.2.70.0310.00816.91
7.2.60.0240.00817.01
7.2.50.0280.00816.90
7.2.40.0430.00716.76
7.2.30.0390.00816.84
7.2.20.0340.01416.83
7.2.10.0260.01816.69
7.2.00.0150.01717.95
7.1.230.0340.01315.92
7.1.220.0330.01115.79
7.1.210.0350.00315.65
7.1.200.0230.00715.89
7.1.190.0440.00415.77
7.1.180.0240.01215.48
7.1.170.0280.00815.73
7.1.160.0300.00715.75
7.1.150.0240.00915.85
7.1.140.0330.00315.77
7.1.130.0310.01215.90
7.1.120.0540.00415.51
7.1.110.0360.00615.59
7.1.100.0130.01116.88
7.1.90.0410.00615.94
7.1.80.0320.00315.66
7.1.70.0210.00716.18
7.1.60.0340.01417.70
7.1.50.0210.01516.47
7.1.40.0550.01115.99
7.1.30.0390.01115.66
7.1.20.0290.01615.63
7.1.10.0480.00615.81
7.1.00.0270.03719.16
7.0.310.0230.01515.43
7.0.300.0380.00215.27
7.0.290.0270.01015.10
7.0.280.0470.00915.12
7.0.270.0460.00515.46
7.0.260.0320.00915.32
7.0.250.0370.00315.34
7.0.240.0160.01615.36
7.0.230.0440.00715.32
7.0.220.0340.00315.29
7.0.210.0370.00715.53
7.0.200.0120.01216.09
7.0.190.0160.00715.48
7.0.180.0480.00415.33
7.0.170.0240.01215.41
7.0.160.0300.00715.34
7.0.150.0570.00315.48
7.0.140.0200.03718.69
7.0.130.0300.00415.58
7.0.120.0330.00915.41
7.0.110.0310.00415.47
7.0.100.0320.01315.18
7.0.90.0360.00815.39
7.0.80.0180.00915.21
7.0.70.0260.01515.44
7.0.60.0250.04317.64
7.0.50.0200.02316.69
7.0.40.0130.03316.86
7.0.30.0230.04316.59
7.0.20.0220.03316.63
7.0.10.0140.04216.93
7.0.00.0150.02516.91
5.6.380.0170.00914.30
5.6.370.0120.01214.16
5.6.360.0330.01014.46
5.6.350.0330.00714.34
5.6.340.0370.00713.85
5.6.330.0420.01014.25
5.6.320.0180.01714.32
5.6.310.0200.00614.60
5.6.300.0140.01414.57
5.6.290.0180.00914.54
5.6.280.0090.04117.74
5.6.270.0220.00714.43
5.6.260.0190.00814.72
5.6.250.0160.01214.50
5.6.240.0140.01114.23
5.6.230.0180.00414.43
5.6.220.0180.00614.71
5.6.210.0120.04117.35
5.6.200.0140.04716.41
5.6.190.0110.03317.52
5.6.180.0270.04417.39
5.6.170.0190.02217.44
5.6.160.0090.04217.50
5.6.150.0100.04616.27
5.6.140.0140.02216.28
5.6.130.0070.02616.39
5.6.120.0120.04217.78
5.6.110.0020.05717.69
5.6.100.0160.04017.71
5.6.90.0190.04117.71
5.6.80.0080.02517.35
5.6.70.0210.00414.21
5.6.60.0160.00614.33
5.6.50.0120.01314.49
5.6.40.0100.01314.22
5.6.30.0110.01114.14
5.6.20.0170.00714.34
5.6.10.0200.00814.04
5.6.00.0110.01414.38
5.5.380.0100.00511.27
5.5.370.0110.00511.28
5.5.360.0170.00311.46
5.5.350.0140.04915.89
5.5.340.0090.02414.62
5.5.330.0110.04115.71
5.5.320.0100.02015.85
5.5.310.0210.02515.78
5.5.300.0020.02814.68
5.5.290.0160.03614.53
5.5.280.0070.02216.11
5.5.270.0130.02015.99
5.5.260.0070.04415.96
5.5.250.0110.01815.73
5.5.240.0130.04015.62
5.5.230.0120.00411.00
5.5.220.0100.00611.29
5.5.210.0110.00511.28
5.5.200.0120.00611.11
5.5.190.0160.00011.08
5.5.180.0080.00810.89
5.5.170.0080.01514.41
5.5.160.0110.00411.30
5.5.150.0090.00611.45
5.5.140.0150.00011.30
5.5.130.0130.00310.98
5.5.120.0100.00511.45
5.5.110.0110.00511.30
5.5.100.0100.00711.41
5.5.90.0090.00911.05
5.5.80.0110.00611.24
5.5.70.0100.00711.39
5.5.60.0110.00511.21
5.5.50.0100.00511.25
5.5.40.0130.00311.29
5.5.30.0040.00811.08
5.5.20.0080.00810.80
5.5.10.0130.00410.65
5.5.00.0160.00010.85
5.4.450.0340.02615.36
5.4.440.0490.02715.43
5.4.430.0470.03815.33
5.4.420.0120.02815.30
5.4.410.0680.03015.25
5.4.400.0630.02515.29
5.4.390.0080.03315.08
5.4.380.0180.02014.82
5.4.370.0140.02214.71
5.4.360.0070.03814.75
5.4.350.0080.02814.96
5.4.340.0060.03014.97
5.4.330.0080.00811.09
5.4.320.0070.03014.72
5.4.310.0080.03015.08
5.4.300.0080.02815.04
5.4.290.0070.03714.70
5.4.280.0080.02814.99
5.4.270.0030.03214.78
5.4.260.0050.02814.83
5.4.250.0060.03214.63
5.4.240.0100.02714.88
5.4.230.0060.02915.02
5.4.220.0070.03014.86
5.4.210.0090.03214.70
5.4.200.0100.02413.79
5.4.190.0100.02714.78
5.4.180.0090.02714.76
5.4.170.0080.03014.91
5.4.160.0110.02614.82
5.4.150.0110.02614.96
5.4.140.0070.03213.67
5.4.130.0140.02813.58
5.4.120.0070.02713.68
5.4.110.0130.02713.60
5.4.100.0120.03713.59
5.4.90.0110.02713.56
5.4.80.0130.03213.77
5.4.70.0150.03813.50
5.4.60.0170.03013.65
5.4.50.0140.02613.72
5.4.40.0110.02713.79
5.4.30.0130.02613.63
5.4.20.0130.02713.55
5.4.10.0070.03113.71
5.4.00.0140.02213.22
5.3.290.0070.02912.71
5.3.280.0150.02212.41
5.3.270.0070.03012.70
5.3.260.0080.02812.76
5.3.250.0070.03012.71
5.3.240.0110.02712.56
5.3.230.0120.02512.59
5.3.220.0130.02312.43
5.3.210.0100.02812.55
5.3.200.0140.03212.46
5.3.190.0110.02712.68
5.3.180.0040.03712.61
5.3.170.0090.03012.76
5.3.160.0160.02212.74
5.3.150.0100.02912.72
5.3.140.0130.02712.57
5.3.130.0130.02712.50
5.3.120.0120.03312.59
5.3.110.0080.03112.62
5.3.100.0130.02312.40
5.3.90.0090.02712.39
5.3.80.0090.02712.35
5.3.70.0100.02312.09
5.3.60.0100.02712.31
5.3.50.0090.02512.25
5.3.40.0090.02712.26
5.3.30.0120.02712.28
5.3.20.0110.02212.11
5.3.10.0120.02311.88
5.3.00.0090.02711.88
5.2.170.0080.02210.24
5.2.160.0080.02210.23
5.2.150.0040.02410.08
5.2.140.0070.02110.05
5.2.130.0070.02810.13
5.2.120.0060.02210.21
5.2.110.0090.02210.22
5.2.100.0080.01810.26
5.2.90.0090.02010.21
5.2.80.0040.02510.12
5.2.70.0050.02410.15
5.2.60.0050.02310.11
5.2.50.0050.02410.15
5.2.40.0110.02510.11
5.2.30.0070.02510.00
5.2.20.0100.0249.99
5.2.10.0050.0239.82
5.2.00.0020.0279.95
5.1.60.0060.0199.26
5.1.50.0040.0229.03
5.1.40.0070.0189.38
5.1.30.0130.0139.43
5.1.20.0090.0189.42
5.1.10.0080.0209.22
5.1.00.0040.0249.21
5.0.50.0080.0138.30
5.0.40.0040.0178.23
5.0.30.0000.0258.13
5.0.20.0040.0158.12
5.0.10.0020.0188.13
5.0.00.0050.0228.10
4.4.90.0080.0116.94
4.4.80.0050.0136.94
4.4.70.0060.0106.91
4.4.60.0060.0136.91
4.4.50.0030.0106.95
4.4.40.0100.0186.90
4.4.30.0060.0146.91
4.4.20.0040.0126.96
4.4.10.0070.0116.98
4.4.00.0020.0216.95
4.3.110.0020.0146.87
4.3.100.0020.0126.86
4.3.90.0020.0126.85
4.3.80.0040.0166.90
4.3.70.0030.0116.85
4.3.60.0040.0106.85
4.3.50.0020.0146.84
4.3.40.0060.0156.84
4.3.30.0020.0156.25
4.3.20.0040.0126.24
4.3.10.0020.0146.24
4.3.00.0030.01211.19

preferences:
48.88 ms | 400 KiB | 5 Q