3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } // start class MyClass implements arrayaccess{ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->array[] = $value; } else { $this->array[$offset] = $value; } } public function offsetExists($offset) { return isset($this->array[$offset]); } public function offsetUnset($offset) { unset($this->array[$offset]); } public function offsetGet($offset) { $offset = (string) $offset; return isset($this->array[$offset]) ? $this->array[$offset] : null; } } $test->callback = new MyClass(); // end editing here echo $test->run();

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.0140.00718.55
8.3.50.0080.00721.98
8.3.40.0090.00618.92
8.3.30.0060.00919.04
8.3.20.0040.00420.35
8.3.10.0090.00022.00
8.3.00.0080.00022.58
8.2.180.0110.01116.88
8.2.170.0140.00022.96
8.2.160.0100.00320.45
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0030.00517.63
8.2.110.0030.00620.34
8.2.100.0030.00917.91
8.2.90.0080.00018.92
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0080.00017.80
8.2.50.0050.00318.07
8.2.40.0080.00018.16
8.2.30.0080.00317.95
8.2.20.0040.00417.72
8.2.10.0000.00717.67
8.2.00.0040.00417.81
8.1.280.0040.01125.92
8.1.270.0050.00322.00
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00622.19
8.1.230.0040.00717.77
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0030.00617.53
8.1.180.0050.00318.10
8.1.170.0080.00018.72
8.1.160.0070.00022.04
8.1.150.0040.00418.55
8.1.140.0040.00417.28
8.1.130.0000.00717.68
8.1.120.0000.00817.36
8.1.110.0060.00317.38
8.1.100.0020.00517.32
8.1.90.0040.00417.27
8.1.80.0050.00317.46
8.1.70.0000.00717.48
8.1.60.0030.00617.59
8.1.50.0040.00417.54
8.1.40.0050.00317.43
8.1.30.0040.00417.58
8.1.20.0040.00417.59
8.1.10.0040.00417.55
8.1.00.0080.00417.59
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0000.00718.56
8.0.270.0070.00017.18
8.0.260.0030.00316.90
8.0.250.0000.00717.13
8.0.240.0030.00716.93
8.0.230.0030.00317.07
8.0.220.0000.00716.93
8.0.210.0030.00316.88
8.0.200.0040.00417.03
8.0.190.0040.00317.00
8.0.180.0000.00716.89
8.0.170.0040.00417.00
8.0.160.0040.00416.90
8.0.150.0040.00316.74
8.0.140.0040.00416.88
8.0.130.0030.00313.35
8.0.120.0040.00416.93
8.0.110.0040.00416.92
8.0.100.0070.00016.96
8.0.90.0080.00017.07
8.0.80.0060.00916.98
8.0.70.0050.00316.93
8.0.60.0000.00716.80
8.0.50.0070.00016.98
8.0.30.0130.00717.06
8.0.20.0120.00617.40
8.0.10.0000.00717.16
8.0.00.0070.01016.82
7.4.330.0070.00015.00
7.4.320.0000.00616.45
7.4.300.0000.00616.39
7.4.290.0030.00316.44
7.4.280.0000.00716.53
7.4.270.0070.00016.50
7.4.260.0000.00816.57
7.4.250.0050.00216.60
7.4.240.0010.00716.49
7.4.230.0030.00316.53
7.4.220.0120.00616.64
7.4.210.0070.00916.44
7.4.200.0030.00316.65
7.4.190.0040.00416.73
7.4.160.0060.00916.52
7.4.150.0070.01117.40
7.4.140.0090.01117.86
7.4.130.0050.01316.39
7.4.120.0070.01016.51
7.4.110.0060.01216.55
7.4.100.0060.01216.43
7.4.90.0060.01216.53
7.4.80.0120.00619.39
7.4.70.0080.00816.59
7.4.60.0100.00716.24
7.4.50.0030.00516.37
7.4.40.0070.00722.77
7.4.30.0140.00716.43
7.4.00.0040.01314.84
7.3.330.0060.00013.13
7.3.320.0030.00313.29
7.3.310.0030.00516.39
7.3.300.0000.00616.18
7.3.290.0140.00016.29
7.3.280.0070.01016.33
7.3.270.0000.01717.40
7.3.260.0060.01116.34
7.3.250.0140.00516.40
7.3.240.0170.00316.45
7.3.230.0180.00416.39
7.3.210.0080.00816.43
7.3.200.0100.00719.39
7.3.190.0070.01316.55
7.3.180.0060.01616.38
7.3.170.0080.00716.27
7.3.160.0040.01216.51
7.3.120.0050.01414.80
7.3.110.0060.00914.93
7.3.100.0120.00414.69
7.3.90.0040.01014.85
7.3.80.0070.00714.81
7.3.70.0010.01114.88
7.3.60.0040.00714.82
7.3.50.0040.01014.67
7.3.40.0040.01014.84
7.3.30.0030.00714.79
7.3.20.0040.00616.59
7.3.10.0090.00216.66
7.3.00.0040.00916.58
7.2.330.0120.00816.45
7.2.320.0150.00316.62
7.2.310.0070.01016.67
7.2.300.0110.01116.56
7.2.290.0100.01016.73
7.2.250.0080.00914.95
7.2.240.0040.01214.96
7.2.230.0040.01014.83
7.2.220.0030.01015.03
7.2.210.0060.00914.72
7.2.200.0060.00614.87
7.2.190.0070.00714.96
7.2.180.0010.01514.85
7.2.170.0070.01014.94
7.2.160.0080.00314.99
7.2.150.0080.00816.68
7.2.140.0060.00816.77
7.2.130.0080.00616.85
7.2.120.0100.00716.70
7.2.110.0090.00716.68
7.2.100.0020.01016.87
7.2.90.0070.00716.93
7.2.80.0020.01416.85
7.2.70.0080.00816.80
7.2.60.0080.00716.86
7.2.50.0040.01216.79
7.2.40.0040.00916.67
7.2.30.0070.00516.66
7.2.20.0000.01416.84
7.2.10.0070.00616.79
7.2.00.0040.00817.55
7.1.330.0070.00915.71
7.1.320.0060.00915.74
7.1.310.0080.00715.79
7.1.300.0040.00815.53
7.1.290.0050.00715.64
7.1.280.0080.00615.82
7.1.270.0050.00715.63
7.1.260.0040.00915.74
7.1.250.0040.00915.67
7.1.240.0090.00615.47
7.1.230.0040.01415.70
7.1.220.0060.00315.74
7.1.210.0000.01115.66
7.1.200.0090.00315.62
7.1.190.0060.00915.59
7.1.180.0040.01115.44
7.1.170.0000.01315.48
7.1.160.0040.00815.87
7.1.150.0100.00315.40
7.1.140.0060.00315.43
7.1.130.0090.00315.71
7.1.120.0110.00415.86
7.1.110.0000.00815.59
7.1.100.0090.00116.73
7.1.90.0070.00715.72
7.1.80.0120.00315.58
7.1.70.0030.00616.24
7.1.60.0040.01417.70
7.1.50.0080.01116.31
7.1.40.0070.00715.68
7.1.30.0080.00615.63
7.1.20.0070.00715.50
7.1.10.0030.01015.69
7.1.00.0030.04219.09
7.0.330.0000.01015.54
7.0.320.0060.00615.51
7.0.310.0040.00815.15
7.0.300.0000.01315.22
7.0.290.0030.01015.57
7.0.280.0030.01015.34
7.0.270.0080.00515.41
7.0.260.0060.00915.20
7.0.250.0040.00715.33
7.0.240.0000.01515.27
7.0.230.0040.00415.33
7.0.220.0040.01115.66
7.0.210.0120.00315.49
7.0.200.0050.00616.04
7.0.190.0100.00315.27
7.0.180.0030.00915.56
7.0.170.0030.00715.38
7.0.160.0000.00815.49
7.0.150.0060.00615.27
7.0.140.0070.03718.65
7.0.130.0030.00715.53
7.0.120.0070.00715.07
7.0.110.0030.01415.29
7.0.100.0070.00715.43
7.0.90.0060.01015.32
7.0.80.0000.01315.31
7.0.70.0060.00615.45
7.0.60.0080.04817.71
7.0.50.0070.02516.72
7.0.40.0120.04216.76
7.0.30.0130.03116.77
7.0.20.0140.04116.68
7.0.10.0190.04516.81
7.0.00.0070.03716.78
5.6.400.0030.01314.25
5.6.390.0030.01214.00
5.6.380.0040.00914.00
5.6.370.0060.00314.13
5.6.360.0070.00714.43
5.6.350.0070.00714.70
5.6.340.0090.00413.91
5.6.330.0040.01114.44
5.6.320.0040.00814.17
5.6.310.0030.01214.58
5.6.300.0000.01414.14
5.6.290.0000.01214.60
5.6.280.0020.04317.59
5.6.270.0070.00414.08
5.6.260.0140.00314.59
5.6.250.0100.00714.27
5.6.240.0080.00814.49
5.6.230.0040.00714.52
5.6.220.0000.01914.18
5.6.210.0100.03417.48
5.6.200.0020.02716.41
5.6.190.0060.02317.45
5.6.180.1650.02717.36
5.6.170.0160.02717.41
5.6.160.0030.04917.36
5.6.150.0070.04516.21
5.6.140.0050.04416.27
5.6.130.0050.04116.21
5.6.120.0090.02617.73
5.6.110.0020.02717.62
5.6.100.0070.02217.66
5.6.90.0070.02417.48
5.6.80.0050.04517.32
5.6.70.0250.03717.30
5.6.60.0040.00414.44
5.6.50.0080.00414.26
5.6.40.0040.01214.08
5.6.30.0080.00414.28
5.6.20.0080.00813.93
5.6.10.0060.01214.04
5.6.00.0060.00614.10
5.5.380.0040.01213.84
5.5.370.0060.00914.25
5.5.360.0030.00714.46
5.5.350.0040.02017.21
5.5.340.0050.03216.14
5.5.330.0050.04717.24
5.5.320.0100.02917.36
5.5.310.0170.02517.28
5.5.300.0070.03516.16
5.5.290.0100.02116.05
5.5.280.0070.04217.51
5.5.270.0060.02417.59
5.5.260.0050.03517.63
5.5.250.0030.02717.45
5.5.240.0030.02517.17
5.5.230.0070.00714.24
5.5.220.0030.01014.05
5.5.210.0060.00313.95
5.5.200.0130.00713.84
5.5.190.0100.00314.34
5.5.180.0070.01014.13
5.5.170.0060.00614.19
5.5.160.0000.01414.46
5.5.150.0090.00914.24
5.5.140.0030.01314.33
5.5.130.0070.01014.43
5.5.120.0060.01013.96
5.5.110.0100.00314.00
5.5.100.0040.01214.20
5.5.90.0070.01013.96
5.5.80.0060.00914.07
5.5.70.0000.01113.91
5.5.60.0140.00014.04
5.5.50.0060.00613.78
5.5.40.0090.00914.06
5.5.30.0040.01113.91
5.5.20.0040.00714.34
5.5.10.0060.00314.13
5.5.00.0060.00614.02
5.4.450.0300.02815.25
5.4.440.0030.03315.40
5.4.430.0050.03415.29
5.4.420.0100.03015.21
5.4.410.0050.03215.32
5.4.400.0580.00215.03
5.4.390.0480.00415.01
5.4.380.0150.02815.02
5.4.370.0060.03115.02
5.4.360.0090.03014.89
5.4.350.0080.03314.98
5.4.340.0110.02715.00
5.4.330.0080.00011.20
5.4.320.0080.02011.86
5.4.310.0050.02511.86
5.4.300.0040.02511.86
5.4.290.0040.03011.85
5.4.280.0050.02811.80
5.4.270.0050.04015.13
5.4.260.0090.03815.10
5.4.250.0130.03015.04
5.4.240.0020.04014.99
5.4.230.0020.03815.10
5.4.220.0060.02815.08
5.4.210.0020.03515.09
5.4.200.0070.03215.15
5.4.190.0070.03214.92
5.4.180.0050.03015.09
5.4.170.0110.03314.92
5.4.160.0050.03815.11
5.4.150.0070.04315.06
5.4.140.0030.03713.82
5.4.130.0070.02513.76
5.4.120.0130.03513.78
5.4.110.0020.03513.86
5.4.100.0080.03713.80
5.4.90.0060.03113.86
5.4.80.0130.03313.83
5.4.70.0110.03513.88
5.4.60.0080.02813.78
5.4.50.0080.03313.88
5.4.40.0080.02513.87
5.4.30.0070.03813.72
5.4.20.0080.02813.79
5.4.10.0100.03513.87
5.4.00.0100.03613.56
5.3.290.0100.02212.00
5.3.280.0120.03013.01
5.3.270.0120.03512.99
5.3.260.0140.03812.92
5.3.250.0110.02812.92
5.3.240.0190.03012.95
5.3.230.0100.02812.90
5.3.220.0100.03612.81
5.3.210.0070.03812.94
5.3.200.0090.03512.94
5.3.190.0120.02912.98
5.3.180.0060.03112.98
5.3.170.0090.04112.88
5.3.160.0080.03112.96
5.3.150.0060.03812.88
5.3.140.0060.03412.80
5.3.130.0120.03012.88
5.3.120.0130.03812.93
5.3.110.0050.03312.88
5.3.100.0030.03312.58
5.3.90.0100.02912.60
5.3.80.0080.04312.70
5.3.70.0150.03212.61
5.3.60.0080.03012.59
5.3.50.0040.03212.63
5.3.40.0030.03312.59
5.3.30.0090.04012.56
5.3.20.0110.02412.47
5.3.10.0030.03112.42
5.3.00.0070.03512.46
5.2.170.0070.04311.38
5.2.160.0070.04711.23
5.2.150.0100.05311.11
5.2.140.0130.04311.23
5.2.130.0100.05311.29
5.2.120.0070.06011.20
5.2.110.0100.05011.07
5.2.100.0100.03311.02
5.2.90.0030.05011.29
5.2.80.0070.05011.19
5.2.70.0200.03311.19
5.2.60.0100.04711.07
5.2.50.0070.05311.03
5.2.40.0070.04311.18
5.2.30.0070.06011.20
5.2.20.0070.04011.05
5.2.10.0000.05310.85
5.2.00.0070.03710.72
5.1.60.0070.0339.97
5.1.50.0130.04010.11
5.1.40.0030.03710.04
5.1.30.0100.04710.34
5.1.20.0000.05710.44
5.1.10.0000.04710.08
5.1.00.0130.04010.14
5.0.50.0070.0278.53
5.0.40.0130.0308.52
5.0.30.0070.0578.33
5.0.20.0030.0338.18
5.0.10.0070.0378.29
5.0.00.0000.0478.18
4.4.90.0000.0235.76
4.4.80.0030.0205.85
4.4.70.0070.0275.84
4.4.60.0030.0305.86
4.4.50.0030.0235.97
4.4.40.0000.0375.75
4.4.30.0070.0175.82
4.4.20.0030.0305.90
4.4.10.0100.0135.91
4.4.00.0030.0405.88
4.3.110.0030.0305.77
4.3.100.0000.0235.74
4.3.90.0030.0275.73
4.3.80.0000.0375.77
4.3.70.0000.0305.74
4.3.60.0000.0305.73
4.3.50.0070.0275.88
4.3.40.0000.0405.73
4.3.30.0000.0305.73
4.3.20.0000.0335.73
4.3.10.0030.0275.73
4.3.00.0000.0236.54

preferences:
51.03 ms | 401 KiB | 5 Q