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 StdObj(); $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.0190.00018.43
8.3.50.0140.00522.93
8.3.40.0100.00518.89
8.3.30.0140.00018.83
8.3.20.0040.00420.35
8.3.10.0030.00620.65
8.3.00.0030.00620.67
8.2.180.0140.00418.41
8.2.170.0030.01022.96
8.2.160.0110.00420.51
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0000.00719.70
8.2.110.0080.00022.29
8.2.100.0120.00018.00
8.2.90.0040.00418.16
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0030.00617.91
8.2.50.0040.00418.09
8.2.40.0040.00420.46
8.2.30.0000.00719.47
8.2.20.0040.00417.80
8.2.10.0040.00417.96
8.2.00.0000.00718.03
8.1.280.0070.00725.92
8.1.270.0060.00323.79
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0040.00423.89
8.1.230.0070.00420.98
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0030.00717.35
8.1.190.0040.00417.22
8.1.180.0080.00018.10
8.1.170.0080.00018.62
8.1.160.0050.00220.81
8.1.150.0100.00018.79
8.1.140.0030.00519.55
8.1.130.0000.00717.66
8.1.120.0030.00317.36
8.1.110.0090.00017.38
8.1.100.0000.00717.37
8.1.90.0070.00017.41
8.1.80.0040.00417.39
8.1.70.0030.00617.42
8.1.60.0050.00317.62
8.1.50.0040.00417.59
8.1.40.0040.00417.55
8.1.30.0000.00817.60
8.1.20.0050.00317.72
8.1.10.0040.00417.52
8.1.00.0030.00517.58
8.0.300.0030.00519.88
8.0.290.0060.00316.88
8.0.280.0030.00318.54
8.0.270.0000.00717.28
8.0.260.0030.00517.19
8.0.250.0030.00316.98
8.0.240.0000.00617.10
8.0.230.0040.00417.04
8.0.220.0030.00316.95
8.0.210.0030.00316.89
8.0.200.0000.00617.05
8.0.190.0060.00617.02
8.0.180.0050.00216.89
8.0.170.0000.00816.88
8.0.160.0030.00816.90
8.0.150.0020.00516.91
8.0.140.0070.00016.96
8.0.130.0050.00013.43
8.0.120.0050.00316.97
8.0.110.0000.00716.91
8.0.100.0000.00716.86
8.0.90.0000.00717.05
8.0.80.0030.01316.93
8.0.70.0070.00017.02
8.0.60.0000.00716.86
8.0.50.0040.00416.77
8.0.30.0110.00717.18
8.0.20.0120.00917.40
8.0.10.0030.00316.99
8.0.00.0100.00916.64
7.4.330.0050.00015.08
7.4.320.0030.00316.62
7.4.300.0040.00416.52
7.4.290.0040.00416.57
7.4.280.0050.00316.65
7.4.270.0070.00016.45
7.4.260.0030.00316.62
7.4.250.0070.00016.48
7.4.240.0000.00816.67
7.4.230.0070.00016.71
7.4.220.0130.01316.71
7.4.210.0040.01116.45
7.4.200.0070.00016.43
7.4.160.0130.01016.45
7.4.150.0110.00717.40
7.4.140.0130.00517.86
7.4.130.0140.00616.64
7.4.120.0140.00616.52
7.4.110.0070.01016.60
7.4.100.0090.01316.56
7.4.90.0090.00916.57
7.4.80.0090.00919.39
7.4.70.0060.01116.44
7.4.60.0110.00616.68
7.4.50.0060.00916.50
7.4.40.0090.01316.42
7.4.30.0110.01116.31
7.4.10.0030.01014.71
7.4.00.0080.00815.04
7.3.330.0050.00313.16
7.3.320.0000.00613.21
7.3.310.0000.00716.43
7.3.300.0070.00016.25
7.3.290.0080.00816.35
7.3.280.0080.00916.36
7.3.270.0180.00717.40
7.3.260.0070.01716.35
7.3.250.0100.00816.49
7.3.240.0070.01116.46
7.3.230.0170.00016.44
7.3.210.0110.00616.39
7.3.200.0100.01016.39
7.3.190.0070.01116.53
7.3.180.0080.00716.61
7.3.170.0180.00316.57
7.3.160.0120.00416.48
7.3.130.0040.01414.66
7.3.120.0030.01414.86
7.3.110.0030.01614.99
7.3.100.0040.00814.99
7.3.90.0030.01014.84
7.3.80.0000.01214.92
7.3.70.0000.01514.85
7.3.60.0060.00914.69
7.3.50.0040.00714.82
7.3.40.0100.01014.89
7.3.30.0090.00614.91
7.3.20.0090.00616.61
7.3.10.0110.00416.75
7.3.00.0060.00916.82
7.2.330.0090.00916.55
7.2.320.0070.01116.56
7.2.310.0070.01116.92
7.2.300.0100.00716.64
7.2.290.0160.00316.50
7.2.260.0160.00314.97
7.2.250.0120.00615.15
7.2.240.0090.00615.04
7.2.230.0060.01014.98
7.2.220.0040.01215.20
7.2.210.0070.00415.33
7.2.200.0070.00714.91
7.2.190.0040.01115.12
7.2.180.0060.00915.03
7.2.170.0100.00014.72
7.2.160.0100.01015.25
7.2.150.0100.00616.70
7.2.140.0060.00816.69
7.2.130.0060.00916.99
7.2.120.0060.01016.98
7.2.110.0070.00717.12
7.2.100.0000.01616.91
7.2.90.0090.00616.75
7.2.80.0120.00316.70
7.2.70.0100.00316.86
7.2.60.0100.01117.03
7.2.50.0110.00416.80
7.2.40.0060.01016.79
7.2.30.0060.00916.89
7.2.20.0070.00716.97
7.2.10.0100.00716.61
7.2.00.0070.00717.93
7.1.330.0080.00415.82
7.1.320.0040.01415.95
7.1.310.0060.00915.90
7.1.300.0100.00315.65
7.1.290.0060.01215.74
7.1.280.0000.01415.77
7.1.270.0090.00615.73
7.1.260.0030.01315.91
7.1.250.0000.01615.50
7.1.240.0000.01415.57
7.1.230.0120.00415.62
7.1.220.0030.01215.81
7.1.210.0060.00615.61
7.1.200.0080.00615.57
7.1.190.0040.01115.82
7.1.180.0090.00615.67
7.1.170.0090.00615.46
7.1.160.0070.00715.48
7.1.150.0040.01115.80
7.1.140.0030.01315.57
7.1.130.0060.00615.77
7.1.120.0030.01515.66
7.1.110.0090.00615.63
7.1.100.0090.00615.86
7.1.90.0060.00915.70
7.1.80.0100.00015.88
7.1.70.0050.00616.49
7.1.60.0080.00916.51
7.1.50.0020.01616.30
7.1.40.0070.00715.87
7.1.30.0060.00615.67
7.1.20.0000.00915.67
7.1.10.0030.01015.49
7.1.00.0060.03719.04
7.0.330.0090.00215.18
7.0.320.0090.00615.33
7.0.310.0030.00615.18
7.0.300.0000.00915.21
7.0.290.0000.01315.21
7.0.280.0070.01115.57
7.0.270.0100.00615.54
7.0.260.0090.00915.20
7.0.250.0060.00615.49
7.0.240.0080.00415.46
7.0.230.0070.00715.63
7.0.220.0090.00315.41
7.0.210.0060.00915.43
7.0.200.0070.00916.13
7.0.190.0070.00715.51
7.0.180.0030.00915.21
7.0.170.0030.00915.49
7.0.160.0070.00715.46
7.0.150.0130.00315.45
7.0.140.0000.01115.43
7.0.130.0070.00715.23
7.0.120.0030.01015.41
7.0.110.0000.01415.28
7.0.100.0030.00715.27
7.0.90.0040.00815.28
7.0.80.0060.00315.52
7.0.70.0060.00615.32
7.0.60.0030.02718.46
7.0.50.0100.04016.58
7.0.40.0450.03216.83
7.0.30.0420.03716.85
7.0.20.0200.03216.76
7.0.10.0400.03216.78
7.0.00.0560.03016.75
5.6.400.0070.01014.73
5.6.390.0100.00314.58
5.6.380.0070.01014.45
5.6.370.0040.01114.27
5.6.360.0030.01314.38
5.6.350.0070.01014.32
5.6.340.0090.00914.60
5.6.330.0040.00714.47
5.6.320.0110.00414.79
5.6.310.0090.00314.18
5.6.300.0070.01014.06
5.6.290.0040.00714.64
5.6.280.0060.03817.78
5.6.270.0070.00314.39
5.6.260.0000.01214.61
5.6.250.0130.00014.58
5.6.240.0080.00614.45
5.6.230.0000.01114.17
5.6.220.0040.00414.13
5.6.210.0090.02017.43
5.6.200.0040.02916.26
5.6.190.0480.03017.35
5.6.180.0330.04017.49
5.6.170.0380.03117.47
5.6.160.0410.03517.34
5.6.150.0430.03617.25
5.6.140.0380.03417.24
5.6.130.0530.03217.55
5.6.120.0430.04517.25
5.6.110.0150.03917.53
5.6.100.0450.03217.25
5.6.90.0510.03417.55
5.6.80.0250.03517.03
5.6.70.0400.02316.92
5.6.60.0390.03317.11
5.6.50.0410.03516.95
5.6.40.0420.02917.07
5.6.30.0300.04216.93
5.6.20.0320.03917.00
5.6.10.0430.03316.96
5.6.00.0410.02816.96
5.5.380.0030.01014.15
5.5.370.0050.00414.42
5.5.360.0100.00714.42
5.5.350.0130.02617.31
5.5.340.0080.04116.34
5.5.330.0450.03017.24
5.5.320.0330.03717.24
5.5.310.0080.03117.38
5.5.300.0430.03217.13
5.5.290.0460.03017.20
5.5.280.0230.03617.41
5.5.270.0490.03717.30
5.5.260.0560.02817.21
5.5.250.0370.03717.21
5.5.240.0380.03016.77
5.5.230.0420.03216.98
5.5.220.0370.04016.99
5.5.210.0280.03317.01
5.5.200.0350.03516.72
5.5.190.0350.03316.89
5.5.180.0390.03217.00
5.5.170.0060.01014.29
5.5.160.0430.02716.92
5.5.150.0400.03217.00
5.5.140.0420.02716.99
5.5.130.0380.03316.91
5.5.120.0330.03516.89
5.5.110.0390.02916.80
5.5.100.0380.03916.90
5.5.90.0370.03517.04
5.5.80.0400.03716.87
5.5.70.0250.03416.86
5.5.60.0090.03016.67
5.5.50.0080.03016.80
5.5.40.0350.03716.95
5.5.30.0480.03216.87
5.5.20.0470.03016.79
5.5.10.0370.02716.91
5.5.00.0530.04016.48

preferences:
57.76 ms | 401 KiB | 5 Q