3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ObjectNameGenerator { public function __invoke($object) { return $object->id; } } class b extends a { public function __construct() { parent::setCallableGenerator(new ObjectNameGenerator()); } } class a { private $callableGenerator = null; public function setCallableGenerator(callable $func) { $this->callableGenerator = $func; } public function build() { $object = new StdClass(); $object->id = 99; if($this->callableGenerator !== null) { return call_user_func($this->callableGenerator, $object); } else { return 'no callable function'; } } } $b = new b(); $b->build();

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.0060.00916.63
8.3.50.0120.00320.07
8.3.40.0100.01018.79
8.3.30.0110.00418.68
8.3.20.0040.00420.38
8.3.10.0050.00320.45
8.3.00.0050.00320.73
8.2.180.0160.00618.16
8.2.170.0140.00022.96
8.2.160.0090.00620.35
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00419.36
8.2.120.0070.00026.35
8.2.110.0070.00322.25
8.2.100.0040.00817.91
8.2.90.0080.00019.21
8.2.80.0030.00617.97
8.2.70.0090.00017.50
8.2.60.0090.00017.93
8.2.50.0050.00318.10
8.2.40.0070.00020.59
8.2.30.0040.00419.51
8.2.20.0080.00017.69
8.2.10.0040.00417.93
8.2.00.0000.00718.00
8.1.270.0040.00423.79
8.1.260.0050.00328.09
8.1.250.0000.00828.09
8.1.240.0030.00622.14
8.1.230.0070.00417.42
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0050.00517.35
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0030.00518.63
8.1.160.0070.00020.95
8.1.150.0060.00318.91
8.1.140.0030.00619.66
8.1.130.0030.00317.69
8.1.120.0000.00717.47
8.1.110.0000.01117.52
8.1.100.0070.00017.45
8.1.90.0000.00717.48
8.1.80.0000.00817.38
8.1.70.0060.00317.38
8.1.60.0000.00817.53
8.1.50.0060.00317.55
8.1.40.0030.00617.45
8.1.30.0000.00817.65
8.1.20.0040.00417.64
8.1.10.0040.00417.46
8.1.00.0000.00817.52
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0030.00318.53
8.0.270.0040.00417.16
8.0.260.0090.00017.21
8.0.250.0070.00016.96
8.0.240.0040.00416.97
8.0.230.0000.00816.98
8.0.220.0000.00716.98
8.0.210.0030.00516.91
8.0.200.0030.00316.93
8.0.190.0030.00917.05
8.0.180.0040.00417.01
8.0.170.0030.00516.94
8.0.160.0040.00716.98
8.0.150.0000.00816.91
8.0.140.0070.00016.83
8.0.130.0060.00013.41
8.0.120.0040.00416.87
8.0.110.0050.00217.02
8.0.100.0040.00416.80
8.0.90.0040.00416.80
8.0.80.0090.00616.90
8.0.70.0000.00716.78
8.0.60.0050.00216.93
8.0.50.0040.00416.96
8.0.30.0020.01417.28
8.0.20.0130.00617.40
8.0.10.0000.00717.19
8.0.00.0070.01116.89
7.4.330.0050.00015.08
7.4.320.0030.00316.51
7.4.300.0000.00916.54
7.4.290.0030.00316.52
7.4.280.0040.00416.48
7.4.270.0000.00716.62
7.4.260.0030.00316.50
7.4.250.0070.00016.58
7.4.240.0000.00716.46
7.4.230.0040.00416.63
7.4.220.0150.01316.62
7.4.210.0140.00316.58
7.4.200.0030.00316.38
7.4.160.0110.00616.44
7.4.150.0040.01517.40
7.4.140.0050.01217.86
7.4.130.0050.01116.47
7.4.120.0060.01116.60
7.4.110.0100.00716.58
7.4.100.0090.00916.59
7.4.90.0070.01116.60
7.4.80.0030.01419.39
7.4.70.0140.00316.54
7.4.60.0070.00816.50
7.4.50.0020.00916.57
7.4.40.0030.01316.45
7.4.30.0030.01316.53
7.4.00.0160.00014.76
7.3.330.0050.00313.26
7.3.320.0050.00013.14
7.3.310.0030.00316.36
7.3.300.0030.00316.29
7.3.290.0060.01016.34
7.3.280.0100.01016.32
7.3.270.0030.01417.40
7.3.260.0070.02016.34
7.3.250.0070.01016.53
7.3.240.0110.00816.47
7.3.230.0060.01116.51
7.3.210.0100.00716.30
7.3.200.0100.01016.53
7.3.190.0190.02516.28
7.3.180.0120.00616.48
7.3.170.0060.01316.32
7.3.160.0090.00616.29
7.3.10.0060.00616.58
7.3.00.0060.00616.42
7.2.330.0070.01116.59
7.2.320.0080.00916.68
7.2.310.0170.00616.67
7.2.300.0080.00816.59
7.2.290.0140.00416.74
7.2.130.0060.00317.00
7.2.120.0040.00817.02
7.2.110.0090.00317.06
7.2.100.0000.00916.98
7.2.90.0030.01016.96
7.2.80.0030.01016.88
7.2.70.0040.00716.95
7.2.60.0080.00617.02
7.2.50.0050.00517.10
7.2.40.0030.01016.53
7.2.30.0100.00717.11
7.2.20.0000.01316.81
7.2.10.0060.00316.94
7.2.00.0050.01118.11
7.1.250.0000.00815.61
7.1.200.0110.00315.92
7.1.100.0210.00718.26
7.1.70.0040.00417.34
7.1.60.0030.01719.18
7.1.00.0030.07722.35
7.0.200.0030.00616.82
7.0.60.0000.04321.77
7.0.50.0130.07317.80
7.0.40.0330.06720.29
7.0.30.0570.07020.25
7.0.20.0500.06320.16
7.0.10.0370.06020.31
7.0.00.0370.06320.28
5.6.280.0130.06321.13
5.6.210.0070.03720.63
5.6.200.0030.04718.27
5.6.190.0330.05720.83
5.6.180.0370.05020.55
5.6.170.0570.06020.53
5.6.160.0200.07720.66
5.6.150.0370.06320.18
5.6.140.0670.05720.30
5.6.130.0200.05720.23
5.6.120.0700.06020.47
5.6.110.0600.05720.16
5.6.100.0670.06020.42
5.6.90.0700.05720.45
5.6.80.0930.05719.79
5.6.70.0870.05719.55
5.6.60.0600.06019.84
5.6.50.0030.06319.69
5.6.40.0600.06019.74
5.6.30.0800.06019.79
5.6.20.0130.06019.74
5.6.10.0470.05319.59
5.6.00.0700.07319.65
5.5.350.0270.06720.36
5.5.340.0070.08318.04
5.5.330.0270.06020.33
5.5.320.0500.06020.25
5.5.310.0300.07320.41
5.5.300.0530.06720.22
5.5.290.0200.05320.25
5.5.280.0800.07720.23
5.5.270.0830.05020.26
5.5.260.0700.07720.18
5.5.250.0400.06720.07
5.5.240.0770.06319.70
5.5.230.0630.05719.34
5.5.220.0100.05719.34
5.5.210.0730.05319.58
5.5.200.0770.05319.74
5.5.190.0770.05319.71
5.5.180.0830.05719.62
5.5.160.0870.04719.65
5.5.150.0700.05319.53
5.5.140.0700.05319.71
5.5.130.0700.06019.45
5.5.120.0230.05319.55
5.5.110.0270.05319.64
5.5.100.0170.07019.52
5.5.90.0330.04319.52
5.5.80.0230.05319.23
5.5.70.0100.06319.47
5.5.60.0200.05319.44
5.5.50.0300.05019.63
5.5.40.0100.06019.34
5.5.30.0170.05719.28
5.5.20.0130.06319.34
5.5.10.0130.06719.20
5.5.00.0230.05719.36

preferences:
56.74 ms | 400 KiB | 5 Q