3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class ObjectCreator { public static function create(string $className, array $properties) { $instance = (new ReflectionClass($className)) ->newInstanceWithoutConstructor(); $reflection = new ReflectionObject($instance); foreach ($properties as $field => $value) { $property = $reflection->getProperty($field); $property->setAccessible(true); $property->setValue($instance, $value); } return $instance; } } final class Orang { /** * @var string */ private $id; public function getId(): string { return $this->id; } /** * @var string */ private $nama; public function getNama(): string { return $this->nama; } public function __construct(string $id, string $nama) { $this->id = $id; $this->nama = $nama; } } $orang = ObjectCreator::create(Orang::class, [ 'id' => 'some_id', 'nama' => 'Some Name' ]); echo $orang->getId(), PHP_EOL; echo $orang->getNama(), PHP_EOL;

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.5.10.0060.01020.36
8.5.00.0070.00320.05
8.4.160.0080.00120.63
8.4.150.0020.00014.05
8.4.140.0120.01317.77
8.4.130.0110.00818.79
8.4.120.0130.00818.60
8.4.110.0140.00718.88
8.4.100.0150.00617.82
8.4.90.0060.00620.43
8.4.80.0120.00918.94
8.4.70.0100.01219.06
8.4.60.0100.01020.78
8.4.50.0130.00718.77
8.4.40.0090.00619.27
8.4.30.0040.01517.82
8.4.20.0100.01019.38
8.4.10.0030.00619.29
8.3.280.0130.00718.27
8.3.270.0130.00716.73
8.3.260.0140.00616.37
8.3.250.0070.00616.61
8.3.240.0050.00316.39
8.3.230.0080.01216.79
8.3.220.0040.00318.76
8.3.210.0100.00616.52
8.3.200.0020.00716.74
8.3.190.0140.00617.30
8.3.180.0120.00620.66
8.3.170.0140.00417.09
8.3.160.0070.00816.71
8.3.150.0050.00316.70
8.3.140.0080.00016.50
8.3.130.0030.00617.19
8.3.120.0000.00818.66
8.3.110.0070.00720.94
8.3.100.0040.00724.06
8.3.90.0040.00426.77
8.3.80.0060.00316.25
8.3.70.0090.00916.61
8.3.60.0110.00416.63
8.3.50.0200.00921.93
8.3.40.0080.00819.02
8.3.30.0070.00718.82
8.3.20.0000.00821.95
8.3.10.0080.00020.54
8.3.00.0030.00620.39
8.2.290.0100.00816.97
8.2.280.0070.01318.27
8.2.270.0040.00416.64
8.2.260.0040.01117.30
8.2.250.0070.00416.50
8.2.240.0090.00617.20
8.2.230.0040.00422.58
8.2.220.0040.00437.54
8.2.210.0020.00526.77
8.2.200.0060.00316.75
8.2.190.0100.00716.58
8.2.180.0110.00718.14
8.2.170.0090.00622.96
8.2.160.0070.00719.37
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.63
8.2.110.0070.00319.39
8.2.100.0090.00317.78
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0090.00017.50
8.2.60.0040.00418.03
8.2.50.0040.00419.21
8.2.40.0050.00320.42
8.2.30.0040.00419.26
8.2.20.0000.00717.95
8.2.10.0000.00718.05
8.2.00.0030.00717.70
8.1.330.0090.01018.37
8.1.320.0070.00216.16
8.1.310.0030.00516.66
8.1.300.0060.00317.77
8.1.290.0040.00418.88
8.1.280.0090.00925.92
8.1.270.0030.00623.81
8.1.260.0000.00926.35
8.1.250.0000.00828.09
8.1.240.0100.00021.14
8.1.230.0060.00619.17
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0050.00218.10
8.1.170.0030.00518.53
8.1.160.0080.00022.10
8.1.150.0000.00718.81
8.1.140.0040.00419.61
8.1.130.0030.00317.70
8.1.120.0000.00717.36
8.1.110.0070.00017.48
8.1.100.0030.00617.46
8.1.90.0030.00317.35
8.1.80.0000.00717.43
8.1.70.0050.00217.52
8.1.60.0050.00317.59
8.1.50.0050.00317.54
8.1.40.0080.00017.57
8.1.30.0000.00817.67
8.1.20.0080.00017.70
8.1.10.0040.00417.57
8.1.00.0040.00417.40
8.0.300.0020.00518.77
8.0.290.0040.00416.58
8.0.280.0000.00718.36
8.0.270.0000.00717.30
8.0.260.0050.00217.30
8.0.250.0000.00716.88
8.0.240.0040.00416.86
8.0.230.0000.00816.96
8.0.220.0040.00416.95
8.0.210.0030.00316.90
8.0.200.0030.00517.00
8.0.190.0000.00716.85
8.0.180.0050.00316.91
8.0.170.0000.00716.93
8.0.160.0000.00716.94
8.0.150.0040.00416.88
8.0.140.0030.00316.77
8.0.130.0050.00013.30
8.0.120.0040.00416.74
8.0.110.0040.00416.85
8.0.100.0040.00416.78
8.0.90.0040.00416.93
8.0.80.0030.01216.95
8.0.70.0070.00216.88
8.0.60.0040.00416.85
8.0.50.0050.00316.79
8.0.30.0100.00817.08
8.0.20.0050.01417.40
8.0.10.0040.00416.91
8.0.00.0120.01217.02
7.4.330.0050.00015.08
7.4.320.0060.00016.43
7.4.300.0030.00316.44
7.4.290.0030.00616.63
7.4.280.0030.00516.60
7.4.270.0030.00316.63
7.4.260.0000.00716.48
7.4.250.0030.00316.46
7.4.240.0030.00316.61
7.4.230.0000.00616.52
7.4.220.0170.00016.63
7.4.210.0030.01316.64
7.4.200.0030.00316.25
7.4.160.0060.01116.57
7.4.150.0170.00717.40
7.4.140.0100.01217.86
7.4.130.0120.00516.59
7.4.120.0080.00916.64
7.4.110.0100.00716.49
7.4.100.0070.01616.41
7.4.90.0150.00716.54
7.4.80.0180.00019.39
7.4.70.0070.01716.59
7.4.60.0040.01116.61
7.4.50.0160.00316.59
7.4.40.0100.00616.56
7.4.30.0070.01016.51
7.4.00.0090.00815.00
7.3.330.0030.00313.14
7.3.320.0000.00513.18
7.3.310.0000.00716.40
7.3.300.0030.00316.22
7.3.290.0080.00916.27
7.3.280.0090.01116.33
7.3.270.0000.01717.40
7.3.260.0120.00516.48
7.3.250.0110.00816.35
7.3.240.0120.00816.27
7.3.230.0060.01016.39
7.3.210.0100.00616.51
7.3.200.0070.01116.26
7.3.190.0070.01016.30
7.3.180.0140.00616.46
7.3.170.0000.01816.27
7.3.160.0040.01816.29
7.3.120.0070.01014.96
7.3.110.0100.00714.64
7.3.100.0140.00015.07
7.3.90.0070.01014.61
7.3.80.0040.00814.53
7.3.70.0060.00614.68
7.3.60.0000.01114.61
7.3.50.0030.01014.95
7.3.40.0000.00914.54
7.3.30.0060.00314.60
7.3.20.0030.01016.68
7.3.10.0120.00516.66
7.3.00.0110.00516.56
7.2.330.0030.01416.85
7.2.320.0070.01016.55
7.2.310.0030.01416.79
7.2.300.0030.01316.51
7.2.290.0090.00916.79
7.2.250.0030.01215.10
7.2.240.0030.01314.89
7.2.230.0040.01115.00
7.2.220.0000.01115.31
7.2.210.0110.00415.19
7.2.200.0070.00715.11
7.2.190.0070.00715.14
7.2.180.0070.00315.30
7.2.170.0000.01015.08
7.2.130.0180.01116.35
7.2.120.0120.01316.41
7.2.110.0160.00816.60
7.2.100.0070.01716.48
7.2.90.0070.01716.48
7.2.80.0040.01517.06
7.2.70.0190.01216.71
7.2.60.0140.01317.00
7.2.50.0180.00816.42
7.2.40.0160.01316.67
7.2.30.0290.00416.74
7.2.20.0090.01816.32
7.2.10.0140.01016.73
7.2.00.0290.00316.68
7.1.330.0080.00615.77
7.1.320.0070.00315.84
7.1.310.0000.00915.83
7.1.300.0040.00815.81
7.1.290.0070.01015.79
7.1.280.0040.00715.71
7.1.270.0070.00715.49
7.1.260.0060.00615.77
7.1.250.0260.00615.46
7.1.200.0030.00715.85
7.1.70.0120.00416.93
7.1.60.0060.00617.22
7.1.50.0060.01316.65
7.1.00.0030.07722.35
7.0.200.0070.00414.85
7.0.110.0370.05720.36
7.0.100.0400.05320.29
7.0.90.0230.06720.28
7.0.80.0430.05720.17
7.0.70.0230.06020.22
7.0.60.0170.06020.21
7.0.50.0330.05720.42
7.0.40.0230.06320.23
7.0.30.0400.05720.32
7.0.20.0370.08020.40
7.0.10.0430.07320.03
7.0.00.0800.06720.26
5.6.260.0230.04720.98
5.6.250.0200.05020.97
5.6.240.0300.04321.04
5.6.230.0130.06021.11
5.6.220.0200.05021.02
5.6.210.0100.05720.98
5.6.200.0070.06321.03
5.6.190.0200.05320.84
5.6.180.0170.05320.84
5.6.170.0130.07720.87
5.6.160.0030.08721.05
5.6.150.0130.06720.81
5.6.140.0100.08321.01
5.6.130.0130.06721.04
5.6.120.0130.06720.86
5.6.110.0230.07320.84
5.6.100.0270.07021.00
5.6.90.0100.07720.83
5.6.80.0170.07020.25
5.6.70.0200.05720.18
5.6.60.0070.06720.40
5.6.50.0170.06320.23
5.6.40.0170.07720.43
5.6.30.0230.07720.36
5.6.20.0100.06020.31
5.6.10.0100.08720.37
5.6.00.0130.05320.41

preferences:
45.84 ms | 403 KiB | 5 Q