3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractEvent { protected $id; private $hidden; } final class Event extends AbstractEvent implements JsonSerializable { private $value; public function __construct($id, self $value = null) { $this->id = 5; $this->value = 'abc'; } public function jsonSerialize() { return get_class_vars(); } /** * @param array $data * @return self */ public static function factory(array $data) { $params = []; $constructor = new ReflectionMethod(self::class, '__construct'); foreach ($constructor->getParameters() as $parameter) { $name = $parameter->getName(); $required = !$parameter->isOptional(); echo $parameter->getClass()->name; $params[] = self::getValue($data, $name, $required); } return new self(...$params); } } $e = Event::factory([]); echo json_encode($e);

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.0110.00416.25
8.3.50.0100.00821.09
8.3.40.0070.00718.98
8.3.30.0120.00318.57
8.3.20.0100.00320.34
8.3.10.0030.00521.90
8.3.00.0060.00319.79
8.2.180.0070.00718.29
8.2.170.0100.00319.13
8.2.160.0040.01122.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00317.63
8.2.110.0100.00022.20
8.2.100.0080.00417.63
8.2.90.0050.00319.18
8.2.80.0040.00417.97
8.2.70.0030.00517.50
8.2.60.0030.00617.80
8.2.50.0050.00318.07
8.2.40.0040.00419.46
8.2.30.0000.00917.96
8.2.20.0030.00517.76
8.2.10.0080.00018.25
8.2.00.0000.00718.13
8.1.280.0100.00725.92
8.1.270.0090.00920.38
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0070.00322.35
8.1.230.0060.00617.42
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0080.00217.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0040.00418.66
8.1.160.0040.00422.14
8.1.150.0050.00218.80
8.1.140.0000.00817.48
8.1.130.0040.00417.63
8.1.120.0040.00417.49
8.1.110.0040.00417.38
8.1.100.0040.00417.54
8.1.90.0050.00317.50
8.1.80.0040.00417.46
8.1.70.0000.00717.43
8.1.60.0030.00517.63
8.1.50.0030.00617.54
8.1.40.0050.00317.52
8.1.30.0000.00817.70
8.1.20.0040.00417.64
8.1.10.0030.00617.48
8.1.00.0000.00717.41
8.0.300.0080.00018.77
8.0.290.0000.00816.63
8.0.280.0000.00718.38
8.0.270.0070.00017.23
8.0.260.0030.00717.32
8.0.250.0070.00016.98
8.0.240.0030.00317.03
8.0.230.0000.00717.09
8.0.220.0070.00016.99
8.0.210.0000.00716.95
8.0.200.0030.00317.03
8.0.190.0030.00517.05
8.0.180.0000.00717.01
8.0.170.0040.00416.93
8.0.160.0000.00717.03
8.0.150.0000.00816.97
8.0.140.0000.00716.97
8.0.130.0030.00613.48
8.0.120.0000.00816.94
8.0.110.0080.00016.99
8.0.100.0000.00716.90
8.0.90.0040.00416.86
8.0.80.0120.00316.95
8.0.70.0040.00417.06
8.0.60.0040.00416.97
8.0.50.0040.00416.90
8.0.30.0100.00917.04
8.0.20.0100.01217.40
8.0.10.0070.00017.17
8.0.00.0100.00716.77
7.4.330.0050.00015.09
7.4.320.0030.00316.54
7.4.300.0030.00316.39
7.4.290.0030.00316.62
7.4.280.0080.00016.53
7.4.270.0030.00616.53
7.4.260.0070.00016.65
7.4.250.0000.00716.48
7.4.240.0000.00716.57
7.4.230.0000.00716.55
7.4.220.0170.00516.47
7.4.210.0040.01516.64
7.4.200.0000.00716.52
7.4.160.0000.01416.41
7.4.150.0090.00917.40
7.4.140.0090.01317.86
7.4.130.0110.00516.49
7.4.120.0050.01316.54
7.4.110.0130.00316.57
7.4.100.0190.00316.61
7.4.90.0070.01116.82
7.4.80.0130.00719.39
7.4.70.0070.01016.66
7.4.60.0080.01316.68
7.4.50.0000.00816.62
7.4.40.0090.00616.41
7.4.30.0100.00716.53
7.4.00.0120.00314.92
7.3.330.0030.00313.32
7.3.320.0050.00013.30
7.3.310.0030.00316.25
7.3.300.0000.00716.38
7.3.290.0030.01216.35
7.3.280.0120.00616.37
7.3.270.0100.01017.40
7.3.260.0130.00316.34
7.3.250.0060.01216.39
7.3.240.0040.01216.62
7.3.230.0120.00616.52
7.3.210.0110.01116.41
7.3.200.0080.00816.60
7.3.190.0140.00616.32
7.3.180.0130.00316.34
7.3.170.0100.00716.52
7.3.160.0090.01216.34
7.2.330.0120.00616.90
7.2.320.0130.01016.56
7.2.310.0030.01316.57
7.2.300.0150.00416.79
7.2.290.0040.01116.59
7.2.60.0100.00316.90
7.2.00.0050.01419.63
7.1.200.0080.00715.55
7.1.100.0000.01017.96
7.1.70.0000.01017.06
7.1.60.0070.01419.27
7.1.50.0140.00716.79
7.1.00.0030.07722.33
7.0.200.0700.01014.88
7.0.90.0400.07019.94
7.0.80.0330.08319.91
7.0.70.0330.06719.86
7.0.60.0630.06719.93
7.0.50.0700.08020.32
7.0.40.0070.08720.05
7.0.30.0030.07720.14
7.0.20.0100.04320.13
7.0.10.0070.08320.10
7.0.00.0100.07720.12
5.6.240.0000.05020.67
5.6.230.0070.08020.66
5.6.220.0030.08720.59
5.6.210.0070.07020.67
5.6.200.0070.08021.09
5.6.190.0030.08721.03
5.6.180.0030.08321.02
5.6.170.0100.08321.05
5.6.160.0070.05020.97
5.6.150.0000.06321.01
5.6.140.0100.05721.11
5.6.130.0070.08321.02
5.6.120.0030.08720.94
5.6.110.0130.04720.95
5.6.100.0070.06720.94
5.6.90.0070.07720.99
5.6.80.0100.08020.40
5.6.70.0070.04020.39
5.6.60.0100.05020.34
5.6.50.0130.07320.52
5.6.40.0230.05020.38
5.6.30.0100.08020.47
5.6.20.0070.04020.39
5.6.10.0030.08720.50
5.6.00.0070.06020.37
5.5.380.0100.04020.38
5.5.370.0130.06020.42
5.5.360.0200.07020.40
5.5.350.0100.08320.43
5.5.340.0130.04020.88
5.5.330.0170.07320.90
5.5.320.0030.08720.90
5.5.310.0100.07020.89
5.5.300.0130.06720.88
5.5.290.0130.06020.84
5.5.280.0130.08320.80
5.5.270.0030.09320.93
5.5.260.0000.08020.87
5.5.250.0030.09020.62
5.5.240.0030.08020.27
5.5.230.0030.08020.18
5.5.220.0070.08320.26
5.5.210.0070.05020.33
5.5.200.0170.07020.13
5.5.190.0070.08720.09
5.5.180.0070.05720.29
5.5.160.0070.04320.24
5.5.150.0030.09020.25
5.5.140.0030.08320.13
5.5.130.0070.08020.19
5.5.120.0030.09720.18
5.5.110.0130.07720.07
5.5.100.0030.06020.13
5.5.90.0170.07020.10
5.5.80.0100.07320.10
5.5.70.0030.04320.16
5.5.60.0100.07720.04
5.5.50.0130.05020.16
5.5.40.0000.05020.06
5.5.30.0070.07320.06
5.5.20.0070.07019.93
5.5.10.0070.08020.12
5.5.00.0070.04720.11
5.4.450.0100.07719.38
5.4.440.0100.06719.48
5.4.430.0200.06719.34
5.4.420.0070.06319.35
5.4.410.0130.07319.43
5.4.400.0170.06018.91
5.4.390.0070.06319.05
5.4.380.0000.04719.15
5.4.370.0170.05718.88
5.4.360.0030.07719.13
5.4.350.0000.07319.03
5.4.340.0070.03719.14
5.4.320.0170.07319.18
5.4.310.0070.04719.04
5.4.300.0030.06718.84
5.4.290.0130.07318.90
5.4.280.0100.07019.24
5.4.270.0030.08019.04
5.4.260.0100.04719.16
5.4.250.0000.08019.09
5.4.240.0070.06718.87
5.4.230.0030.04019.18
5.4.220.0070.04719.11
5.4.210.0130.05719.04
5.4.200.0070.06719.23
5.4.190.0070.06019.13
5.4.180.0100.04019.20
5.4.170.0130.05719.15
5.4.160.0230.04318.86
5.4.150.0030.05019.12
5.4.140.0170.05716.26
5.4.130.0130.06716.44
5.4.120.0130.06016.43
5.4.110.0170.07316.45
5.4.100.0000.05716.48
5.4.90.0030.03716.44
5.4.80.0070.07016.47
5.4.70.0000.07316.38
5.4.60.0030.06316.44
5.4.50.0030.04316.34
5.4.40.0030.03716.55
5.4.30.0170.05316.39
5.4.20.0070.06316.39
5.4.10.0070.07316.48
5.4.00.0100.05015.82

preferences:
46.53 ms | 401 KiB | 5 Q