3v4l.org

run code in 300+ PHP versions simultaneously
<?php class stdobject { public function __call($method, $arguments) { if (isset($this->{$method}) && is_callable($this->{$method})) { return call_user_func_array($this->{$method}, $arguments); } else { throw new Exception("Fatal error: Call to undefined method: $method"); } } } $mod = function() { $self = new stdobject(); $self->init = function ($params) use ($self) { $self->_opmode = &$params['opmode']; }; $self->setup = function () use ($self) { $self->_opmode = 'dog'; }; $self->print = function () use ($self) { echo $self->_opmode . "\n"; }; return $self; }; $obj = $mod(); $reference = 'fish'; $obj->init(['opmode' => &$reference]); $obj->print(); // fish $obj->setup(); $obj->print(); // dog $reference = 'cats'; $obj->print(); // cats

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.0100.00716.63
8.3.50.0090.00721.13
8.3.40.0110.00718.76
8.3.30.0090.00618.97
8.3.20.0040.00418.55
8.3.10.0080.00021.73
8.3.00.0080.00021.95
8.2.180.0150.00318.16
8.2.170.0040.01122.96
8.2.160.0100.00322.22
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.83
8.2.110.0030.00722.25
8.2.100.0040.00817.84
8.2.90.0050.00319.17
8.2.80.0050.00317.97
8.2.70.0050.00317.63
8.2.60.0060.00318.05
8.2.50.0050.00318.07
8.2.40.0030.00719.78
8.2.30.0060.00319.96
8.2.20.0020.00518.09
8.2.10.0040.00418.20
8.2.00.0000.00717.67
8.1.280.0070.00725.92
8.1.270.0000.00823.60
8.1.260.0000.01026.35
8.1.250.0090.00028.09
8.1.240.0070.00321.28
8.1.230.0000.01119.14
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0170.00716.75
8.1.190.0050.00317.35
8.1.180.0090.00018.10
8.1.170.0040.00418.65
8.1.160.0000.00718.90
8.1.150.0000.00718.90
8.1.140.0040.00419.59
8.1.130.0040.00417.75
8.1.120.0000.00717.52
8.1.110.0000.00817.52
8.1.100.0040.00417.49
8.1.90.0040.00817.39
8.1.80.0030.00417.36
8.1.70.0000.00717.38
8.1.60.0080.00017.52
8.1.50.0000.00817.52
8.1.40.0030.00517.43
8.1.30.0070.00317.71
8.1.20.0040.00417.65
8.1.10.0000.00817.58
8.1.00.0080.00017.54
8.0.300.0040.00418.77
8.0.290.0030.00516.63
8.0.280.0030.00318.47
8.0.270.0050.00317.24
8.0.260.0030.00318.59
8.0.250.0000.00717.04
8.0.240.0070.00017.06
8.0.230.0000.00817.03
8.0.220.0070.00016.85
8.0.210.0070.00016.95
8.0.200.0030.00516.81
8.0.190.0050.00316.96
8.0.180.0000.00716.86
8.0.170.0000.00716.94
8.0.160.0030.00516.98
8.0.150.0000.00716.91
8.0.140.0090.00016.86
8.0.130.0030.00313.35
8.0.120.0000.00816.85
8.0.110.0030.00516.86
8.0.100.0040.00416.96
8.0.90.0060.00316.98
8.0.80.0060.01216.91
8.0.70.0080.00016.95
8.0.60.0070.00016.87
8.0.50.0000.00716.73
8.0.30.0090.01017.14
8.0.20.0080.01117.40
8.0.10.0040.00417.14
8.0.00.0070.01016.80
7.4.330.0000.00515.55
7.4.320.0060.00016.45
7.4.300.0030.00316.43
7.4.290.0030.00316.44
7.4.280.0040.00416.59
7.4.270.0040.00416.50
7.4.260.0020.00516.43
7.4.250.0000.00716.50
7.4.240.0040.00416.64
7.4.230.0030.00316.42
7.4.220.0120.00416.61
7.4.210.0090.01016.54
7.4.200.0070.00016.52
7.4.160.0110.00516.52
7.4.150.0070.01117.40
7.4.140.0120.00717.86
7.4.130.0110.00816.41
7.4.120.0100.00716.45
7.4.110.0030.01516.41
7.4.100.0130.00416.52
7.4.90.0100.01016.48
7.4.80.0070.01019.39
7.4.70.0070.01016.68
7.4.60.0190.00016.42
7.4.50.0060.01016.51
7.4.40.0030.01316.48
7.4.30.0080.00816.55
7.4.10.0000.01814.87
7.4.00.0060.00915.06
7.3.330.0050.00013.25
7.3.320.0060.00013.46
7.3.310.0040.00416.23
7.3.300.0000.00716.27
7.3.290.0100.00616.37
7.3.280.0080.01016.39
7.3.270.0090.00917.40
7.3.260.0130.00916.46
7.3.250.0080.00916.53
7.3.240.0110.00616.55
7.3.230.0100.00616.39
7.3.210.0100.01316.41
7.3.200.0080.01216.55
7.3.190.0030.01516.27
7.3.180.0100.00716.42
7.3.170.0150.00716.41
7.3.160.0070.01016.36
7.3.130.0150.00315.13
7.3.120.0070.01014.86
7.3.110.0100.00614.76
7.3.100.0070.00714.65
7.3.90.0030.01214.94
7.3.80.0080.00614.85
7.3.70.0020.01414.90
7.3.60.0110.00414.92
7.3.50.0010.01014.68
7.3.40.0050.01214.85
7.3.30.0050.00914.81
7.3.20.0060.00516.73
7.3.10.0070.00716.73
7.3.00.0120.00316.73
7.2.330.0180.00016.84
7.2.320.0080.00816.74
7.2.310.0070.01016.71
7.2.300.0130.00716.86
7.2.290.0070.00916.36
7.2.260.0080.01214.65
7.2.250.0110.00715.09
7.2.240.0060.01015.10
7.2.230.0030.01115.33
7.2.220.0090.00715.06
7.2.210.0090.00515.03
7.2.200.0060.00815.21
7.2.190.0020.01315.00
7.2.180.0070.00715.03
7.2.170.0090.00815.06
7.2.160.0060.01214.98
7.2.150.0140.00317.03
7.2.140.0070.00716.76
7.2.130.0100.00616.91
7.2.120.0120.00317.08
7.2.110.0110.00816.86
7.2.100.0000.01816.92
7.2.90.0050.00516.99
7.2.80.0090.00317.05
7.2.70.0060.00917.16
7.2.60.0040.00816.90
7.2.50.0060.00616.89
7.2.40.0120.00616.98
7.2.30.0040.01117.11
7.2.20.0030.01017.02
7.2.10.0130.00316.64
7.2.00.0060.01118.01
7.1.330.0030.01215.73
7.1.320.0000.01515.83
7.1.310.0100.00315.85
7.1.300.0030.00815.70
7.1.290.0060.00815.78
7.1.280.0080.00815.92
7.1.270.0060.00915.88
7.1.260.0060.00815.70
7.1.250.0070.00316.01
7.1.240.0040.00715.53
7.1.230.0040.01115.68
7.1.220.0030.01015.85
7.1.210.0030.00615.85
7.1.200.0060.00815.86
7.1.190.0060.00615.87
7.1.180.0000.00915.89
7.1.170.0040.01115.66
7.1.160.0030.01315.78
7.1.150.0000.01715.86
7.1.140.0030.01015.86
7.1.130.0040.00415.73
7.1.120.0050.00515.87
7.1.110.0060.00615.91
7.1.100.0060.00915.70
7.1.90.0040.01215.94
7.1.80.0100.00315.95
7.1.70.0070.00516.58
7.1.60.0050.00616.48
7.1.50.0060.00315.66
7.1.40.0030.01215.82
7.1.30.0000.01415.83
7.1.20.0060.00315.84
7.1.10.0090.00615.88
7.1.00.0120.03719.11
7.0.330.0060.00615.59
7.0.320.0100.00315.40
7.0.310.0070.01015.21
7.0.300.0030.01215.24
7.0.290.0030.01315.21
7.0.280.0000.01415.38
7.0.270.0000.01215.39
7.0.260.0070.00715.27
7.0.250.0090.00615.45
7.0.240.0060.00915.54
7.0.230.0070.00315.30
7.0.220.0040.01115.51
7.0.210.0040.01115.46
7.0.200.0240.00915.01
7.0.190.0030.01315.50
7.0.180.0060.00615.19
7.0.170.0070.00715.57
7.0.160.0060.00615.46
7.0.150.0030.00915.47
7.0.140.0060.00615.25
7.0.130.0100.00615.30
7.0.120.0200.04317.85
7.0.110.0530.03317.73
7.0.100.0200.04217.86
7.0.90.0140.04717.87
7.0.80.0130.03017.74
7.0.70.0280.04318.00
7.0.60.0150.04317.85
7.0.50.0090.04917.79
7.0.40.0100.03816.94
7.0.30.0100.03916.96
7.0.20.0160.04516.90
7.0.10.0130.04216.99
7.0.00.0080.04516.92
5.6.400.0090.00614.48
5.6.390.0070.00714.68
5.6.380.0100.00314.55
5.6.370.0070.00314.31
5.6.360.0000.01214.76
5.6.350.0060.01214.43
5.6.340.0110.00414.48
5.6.330.0070.01114.71
5.6.320.0060.00614.81
5.6.310.0000.01314.46
5.6.300.0030.01014.29
5.6.290.0040.01214.33
5.6.280.0070.00714.78
5.6.270.0120.03017.68
5.6.260.0080.04817.88
5.6.250.0100.04717.81
5.6.240.0090.04517.77
5.6.230.0070.03917.71
5.6.220.0150.03317.70
5.6.210.0100.04717.75
5.6.200.0150.04017.65
5.6.190.0170.03817.86
5.6.180.0140.03417.73
5.6.170.0080.04717.63
5.6.160.0160.03817.69
5.6.150.0030.05617.52
5.6.140.0100.04517.88
5.6.130.0160.03017.81
5.6.120.0170.03817.80
5.6.110.0100.03717.72
5.6.100.0090.04217.68
5.6.90.0100.04317.65
5.6.80.0110.03917.33
5.6.70.0130.03117.26
5.6.60.0100.03717.29
5.6.50.0120.03517.44
5.6.40.0120.04017.24
5.6.30.0220.02917.42
5.6.20.0120.04017.37
5.6.10.0150.03417.29
5.6.00.0100.04017.52

preferences:
67.84 ms | 401 KiB | 5 Q