3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $callback; public function setCallback($callback) { $this->callback = $callback; } public function callCallback() { return call_user_func($this->callback); } } class Bar { protected $foo; public function __construct(Foo $foo) { $this->foo = $foo; $self =& $this; $callback = function() use ($self) { return $this->protectedCallback(); }; $this->foo->setCallback($callback); } protected function protectedCallback() { return "callback called"; } } $foo = new Foo; $bar = new Bar($foo); echo $foo->callCallback();

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.40.0090.00918.79
8.3.30.0140.00018.97
8.3.20.0050.00220.20
8.3.10.0000.00821.73
8.3.00.0040.00420.93
8.2.170.0110.00722.96
8.2.160.0000.01322.12
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00422.15
8.2.120.0040.00426.35
8.2.110.0000.00921.11
8.2.100.0060.00617.78
8.2.90.0040.00419.20
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0000.00818.05
8.2.50.0000.00818.10
8.2.40.0070.00022.15
8.2.30.0000.00820.91
8.2.20.0040.00417.96
8.2.10.0000.00717.95
8.2.00.0050.00218.13
8.1.270.0030.00623.96
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00317.79
8.1.230.0040.00722.08
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0070.00317.35
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.53
8.1.160.0080.00019.03
8.1.150.0040.00418.90
8.1.140.0050.00319.48
8.1.130.0040.00418.78
8.1.120.0040.00717.50
8.1.110.0040.00417.37
8.1.100.0040.00417.44
8.1.90.0060.00317.38
8.1.80.0050.00317.47
8.1.70.0030.00317.50
8.1.60.0040.00417.56
8.1.50.0080.00017.52
8.1.40.0070.00017.42
8.1.30.0050.00217.68
8.1.20.0040.00417.63
8.1.10.0040.00417.55
8.1.00.0030.00517.40
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.41
8.0.270.0000.00717.18
8.0.260.0030.00316.95
8.0.250.0030.00517.08
8.0.240.0000.00816.87
8.0.230.0000.00916.94
8.0.220.0050.00217.00
8.0.210.0030.00316.92
8.0.200.0000.00717.03
8.0.190.0040.00417.03
8.0.180.0050.00216.90
8.0.170.0000.00716.88
8.0.160.0040.00416.98
8.0.150.0000.00716.96
8.0.140.0000.00716.91
8.0.130.0050.00313.36
8.0.120.0030.00516.80
8.0.110.0040.00416.80
8.0.100.0000.00716.94
8.0.90.0030.00516.84
8.0.80.0130.00316.84
8.0.70.0000.00716.95
8.0.60.0000.00717.03
8.0.50.0030.00516.86
8.0.30.0100.00916.94
8.0.20.0100.01017.40
8.0.10.0000.00716.86
8.0.00.0140.00316.83
7.4.330.0000.00515.55
7.4.320.0000.00616.48
7.4.300.0030.00316.49
7.4.290.0050.00316.59
7.4.280.0080.00016.50
7.4.270.0070.00016.60
7.4.260.0060.00316.59
7.4.250.0000.00716.58
7.4.240.0050.00316.65
7.4.230.0030.00316.36
7.4.220.0190.00816.55
7.4.210.0070.00716.65
7.4.200.0070.00016.68
7.4.160.0080.00816.36
7.4.150.0100.01017.40
7.4.140.0140.00817.86
7.4.130.0070.01716.45
7.4.120.0090.00916.68
7.4.110.0180.00716.56
7.4.100.0120.01216.48
7.4.90.0130.00316.61
7.4.80.0040.01319.39
7.4.70.0060.01116.63
7.4.60.0090.00916.55
7.4.50.0090.00616.38
7.4.40.0060.01116.62
7.4.30.0100.00716.73
7.4.00.0070.00914.88
7.3.330.0030.00313.23
7.3.320.0030.00313.25
7.3.310.0030.00316.32
7.3.300.0030.00316.30
7.3.290.0060.00816.30
7.3.280.0080.00816.27
7.3.270.0080.00817.40
7.3.260.0110.00916.45
7.3.250.0120.00816.30
7.3.240.0070.01016.38
7.3.230.0130.01016.50
7.3.210.0090.00716.41
7.3.200.0000.01616.50
7.3.190.0000.01616.66
7.3.180.0120.00416.36
7.3.170.0060.00916.20
7.3.160.0160.00316.30
7.3.120.0100.00814.83
7.3.110.0050.01214.98
7.3.100.0070.00914.69
7.3.90.0030.01114.84
7.3.80.0050.00814.84
7.3.70.0070.00714.61
7.3.60.0050.01014.75
7.3.50.0050.00914.85
7.3.40.0070.01014.82
7.3.30.0040.00914.73
7.3.20.0040.00716.56
7.3.10.0070.00616.56
7.3.00.0030.00816.53
7.2.330.0100.00716.71
7.2.320.0030.01316.87
7.2.310.0060.01116.93
7.2.300.0110.01116.79
7.2.290.0120.00316.75
7.2.250.0070.01415.12
7.2.240.0050.01215.14
7.2.230.0090.00515.02
7.2.220.0070.00915.06
7.2.210.0070.01115.16
7.2.200.0080.00515.10
7.2.190.0050.00915.04
7.2.180.0040.01014.97
7.2.170.0060.01014.87
7.2.130.0040.00816.96
7.2.120.0060.00317.11
7.2.110.0050.01016.67
7.2.100.0070.00916.73
7.2.90.0080.00816.80
7.2.80.0130.00216.71
7.2.70.0090.00416.95
7.2.60.0100.00516.81
7.2.50.0100.00516.92
7.2.40.0330.00617.07
7.2.30.0090.00817.05
7.2.20.0060.01116.67
7.2.10.0070.00416.88
7.2.00.0070.00917.67
7.1.330.0080.00815.79
7.1.320.0050.01115.80
7.1.310.0050.00815.71
7.1.300.0050.00615.84
7.1.290.0110.00415.88
7.1.280.0070.01015.77
7.1.270.0030.01115.70
7.1.260.0050.00815.78
7.1.250.0100.00715.92
7.1.230.1050.00715.64
7.1.220.0120.00415.72
7.1.210.0070.01015.71
7.1.200.0050.00515.89
7.1.190.0130.00315.53
7.1.180.0030.00915.59
7.1.170.0360.00315.83
7.1.160.0030.01015.84
7.1.150.0100.00315.84
7.1.140.0090.00515.70
7.1.130.0110.01115.94
7.1.120.0150.00215.73
7.1.110.0100.00516.00
7.1.100.0080.00717.01
7.1.90.0120.00515.78
7.1.80.0110.00715.48
7.1.70.0070.00716.30
7.1.60.0140.00616.59
7.1.50.0070.01116.29
7.1.40.0040.00916.03
7.1.30.0110.00716.04
7.1.20.0100.00616.38
7.1.10.0110.00716.17
7.1.00.0110.00616.35
7.0.310.0080.00815.30
7.0.300.0120.00415.17
7.0.290.0130.00315.30
7.0.280.0060.00615.32
7.0.270.0260.00315.30
7.0.260.0340.00315.37
7.0.250.0320.00315.16
7.0.240.0120.00615.31
7.0.230.0170.00315.52
7.0.220.0130.00415.16
7.0.210.0090.00415.25
7.0.200.0100.00416.10
7.0.190.0300.00815.93
7.0.180.0080.00615.71
7.0.170.0230.01015.87
7.0.160.0200.00415.90
7.0.150.0080.00815.82
7.0.140.0120.01015.62
7.0.130.0100.00515.83
7.0.120.0090.01015.89
7.0.110.0130.00415.92
7.0.100.0070.00615.83
7.0.90.0150.00815.96
7.0.80.0060.00815.83
7.0.70.0230.01114.95
7.0.60.0410.00314.92
7.0.50.0400.00415.02
7.0.40.0080.00813.75
7.0.30.0100.00314.01
7.0.20.0090.00913.90
7.0.10.0140.00213.91
7.0.00.0090.00413.80
5.6.380.0140.00314.20
5.6.370.0110.01114.49
5.6.360.0150.00314.20
5.6.350.0070.00714.39
5.6.340.0180.00014.08
5.6.330.0060.00914.30
5.6.320.0120.00014.23
5.6.310.0120.00314.30
5.6.300.0090.02317.27
5.6.290.0100.02217.76
5.6.280.0150.02717.65
5.6.270.0090.03117.53
5.6.260.0050.02717.51
5.6.250.0030.02817.64
5.6.240.0080.03417.72
5.6.230.0080.02717.47
5.6.220.0110.02417.77
5.6.210.0080.02517.76
5.6.200.0090.02617.75
5.6.190.0090.03017.73
5.6.180.0130.02417.78
5.6.170.0120.02417.54
5.6.160.0140.01917.61
5.6.150.0140.01917.75
5.6.140.0070.02717.68
5.6.130.0110.02317.65
5.6.120.0090.02217.77
5.6.110.0170.03317.57
5.6.100.0150.02217.59
5.6.90.0090.02717.65
5.6.80.0130.02817.36
5.6.70.0090.02617.38
5.6.60.0140.03317.22
5.6.50.0170.02217.29
5.6.40.0070.03817.41
5.6.30.0120.02017.45
5.6.20.0120.02117.27
5.6.10.0110.01917.15
5.6.00.0090.02817.09
5.5.380.0140.02315.13
5.5.370.0130.02815.17
5.5.360.0080.02415.13
5.5.350.0070.02515.21
5.5.340.0040.02815.47
5.5.330.0070.02615.46
5.5.320.0080.02715.44
5.5.310.0100.01915.48
5.5.300.0060.02715.27
5.5.290.0110.02115.46
5.5.280.0070.02115.42
5.5.270.0100.02815.40
5.5.260.0070.02315.40
5.5.250.0070.02215.33
5.5.240.0030.02614.94
5.5.230.0060.02415.11
5.5.220.0100.01814.99
5.5.210.0120.02815.07
5.5.200.0040.02115.10
5.5.190.0150.01815.11
5.5.180.0020.03515.07
5.5.170.0200.01014.07
5.5.160.0050.02114.92
5.5.150.0070.02615.07
5.5.140.0040.02415.16
5.5.130.0100.02115.09
5.5.120.0080.02315.10
5.5.110.0040.02215.07
5.5.100.0080.02014.95
5.5.90.0050.02315.11
5.5.80.0070.02114.95
5.5.70.0150.01615.08
5.5.60.0090.02014.87
5.5.50.0020.04314.89
5.5.40.0080.02215.03
5.5.30.0100.02215.07
5.5.20.0040.02314.93
5.5.10.0040.02514.89
5.5.00.0060.02915.05
5.4.450.0080.02316.02
5.4.440.0090.02916.12
5.4.430.0120.02916.03
5.4.420.0110.02816.15
5.4.410.0120.01616.05
5.4.400.0070.02415.84
5.4.390.0090.02216.00
5.4.380.0110.02315.84
5.4.370.0140.02015.93
5.4.360.0060.02015.88
5.4.350.0060.02015.89
5.4.340.0020.02915.89
5.4.330.0100.00212.79
5.4.320.0020.02616.00
5.4.310.0100.02115.93
5.4.300.0060.02615.93
5.4.290.0080.01815.91
5.4.280.0050.02516.00
5.4.270.0080.01916.01
5.4.260.0060.02015.96
5.4.250.0110.01815.88
5.4.240.0080.01915.84
5.4.230.0100.01915.86
5.4.220.0060.02215.96
5.4.210.0080.02315.84
5.4.200.0100.01915.88
5.4.190.0090.02015.86
5.4.180.0100.01915.96
5.4.170.0070.02515.99
5.4.160.0060.02115.87
5.4.150.0090.02115.86
5.4.140.0050.02914.77
5.4.130.0100.02114.80
5.4.120.0090.02314.76
5.4.110.0070.02214.74
5.4.100.0070.02514.77
5.4.90.0070.02214.79
5.4.80.0030.02114.76
5.4.70.0100.01714.73
5.4.60.0090.02114.62
5.4.50.0070.02414.76
5.4.40.0080.02014.78
5.4.30.0150.02014.73
5.4.20.0070.03514.74
5.4.10.0080.02414.75
5.4.00.0100.01914.50
5.3.290.0090.01813.87
5.3.280.0070.02513.84
5.3.270.0060.02113.80
5.3.260.0080.01813.79
5.3.250.0080.03213.84
5.3.240.0030.02513.79
5.3.230.0060.02513.79
5.3.220.0050.02213.83
5.3.210.0150.01813.71
5.3.200.0060.02613.87
5.3.190.0060.02313.71
5.3.180.0090.02113.87
5.3.170.0020.02813.71
5.3.160.0060.02513.71
5.3.150.0090.02013.83
5.3.140.0070.02313.78
5.3.130.0090.01713.71
5.3.120.0080.02613.70
5.3.110.0080.02613.80
5.3.100.0080.02013.46
5.3.90.0050.02413.46
5.3.80.0080.02113.55
5.3.70.0050.02113.51
5.3.60.0080.02013.52
5.3.50.0050.02513.46
5.3.40.0120.01513.48
5.3.30.0080.02013.48
5.3.20.0030.02213.46
5.3.10.0040.02413.46
5.3.00.0030.02913.46
5.2.170.0040.01713.46
5.2.160.0060.01713.46
5.2.150.0060.01513.46
5.2.140.0040.01813.46
5.2.130.0040.01513.46
5.2.120.0060.01513.46
5.2.110.0070.01413.46
5.2.100.0080.01613.46
5.2.90.0070.01613.46
5.2.80.0070.01413.46
5.2.70.0030.01913.46
5.2.60.0040.01713.46
5.2.50.0120.01513.46
5.2.40.0060.01813.46
5.2.30.0060.01613.46
5.2.20.0050.01713.46
5.2.10.0070.01613.46
5.2.00.0070.01213.46
5.1.60.0080.00913.46
5.1.50.0050.01513.46
5.1.40.0020.01513.46
5.1.30.0020.01613.46
5.1.20.0030.01613.46
5.1.10.0040.01513.46
5.1.00.0050.01613.46
5.0.50.0010.01213.46
5.0.40.0030.01413.46
5.0.30.0080.01413.46
5.0.20.0030.01213.46
5.0.10.0050.01113.46
5.0.00.0030.01713.46
4.4.90.0040.00913.46
4.4.80.0000.01613.46
4.4.70.0000.01313.46
4.4.60.0050.00813.46
4.4.50.0040.01013.46
4.4.40.0030.01413.46
4.4.30.0020.01213.46
4.4.20.0050.00813.46
4.4.10.0000.01113.46
4.4.00.0010.01513.46
4.3.110.0020.01113.46
4.3.100.0030.00913.46
4.3.90.0040.00813.46
4.3.80.0050.01313.46
4.3.70.0040.00713.46
4.3.60.0010.01013.46
4.3.50.0030.01013.46
4.3.40.0000.01613.46
4.3.30.0000.01213.46
4.3.20.0030.01013.46
4.3.10.0030.00913.46
4.3.00.0040.00913.46

preferences:
61.58 ms | 400 KiB | 5 Q