3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LazyLoadedMethods { protected $_data = array(); protected static $_instance; protected function set($key, $value){ static::$_instance->_data[$key] = $value; return static::$_instance; } protected function get($key){ if(array_key_exists($key, static::$_instance->_data)){ return static::$_instance->_data[$key]; } return null; } public static function getInstance() { if (!isset(static::$_instance)) { static::$_instance = new static; } return static::$_instance; } protected static function getFunction($name, $callback){ $ins = static::getInstance(); if(is_null(static::get($name))){ static::set($name, $callback); } return static::get($name); } public static function toBool($v) { return static::getFunction(__FUNCTION__, function($value) { return $value == 1 || $value == true; })($v); } public static function parseNewLines($v) { return static::getFunction($v, function($value) { return trim(preg_replace('/\s\s+/', ' ', $string)); })($v); } } var_dump(LazyLoadedMethods::toBool(-1));

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.0070.00716.74
8.3.50.0030.01321.99
8.3.40.0110.00718.80
8.3.30.0140.00019.01
8.3.20.0040.00420.36
8.3.10.0080.00021.83
8.3.00.0000.00817.93
8.2.180.0140.00716.75
8.2.170.0180.00322.96
8.2.160.0070.00720.29
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0080.00020.96
8.2.110.0060.00322.05
8.2.100.0060.00617.72
8.2.90.0060.00319.23
8.2.80.0080.00017.97
8.2.70.0030.00517.38
8.2.60.0080.00018.05
8.2.50.0030.00618.07
8.2.40.0000.00819.95
8.2.30.0070.00018.14
8.2.20.0000.00817.83
8.2.10.0000.00718.00
8.2.00.0000.00717.69
8.1.280.0170.00325.92
8.1.270.0040.00423.81
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00023.82
8.1.230.0080.00319.02
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0030.00717.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0030.00618.54
8.1.160.0030.00522.08
8.1.150.0040.00418.81
8.1.140.0000.00717.41
8.1.130.0070.00017.90
8.1.120.0040.00417.53
8.1.110.0090.00017.50
8.1.100.0040.00417.36
8.1.90.0000.00817.52
8.1.80.0060.00317.56
8.1.70.0000.00717.44
8.1.60.0000.00817.48
8.1.50.0060.00317.45
8.1.40.0030.00617.54
8.1.30.0090.00017.70
8.1.20.0030.00617.61
8.1.10.0030.00617.64
8.1.00.0030.00517.51
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0030.00318.39
8.0.270.0030.00317.34
8.0.260.0000.00617.21
8.0.250.0040.00417.07
8.0.240.0000.00717.09
8.0.230.0000.00717.09
8.0.220.0000.00716.98
8.0.210.0080.00016.88
8.0.200.0030.00317.05
8.0.190.0000.00817.04
8.0.180.0050.00317.01
8.0.170.0040.00416.98
8.0.160.0040.00416.86
8.0.150.0000.00716.93
8.0.140.0070.00016.91
8.0.130.0030.00313.46
8.0.120.0000.00816.82
8.0.110.0040.00416.95
8.0.100.0080.00016.80
8.0.90.0030.00517.10
8.0.80.0100.00717.02
8.0.70.0000.00716.93
8.0.60.0050.00216.84
8.0.50.0000.00716.88
8.0.30.0080.01117.14
8.0.20.0120.01017.40
8.0.10.0050.00317.15
8.0.00.0080.01016.79
7.4.330.0030.00315.19
7.4.320.0030.00316.67
7.4.300.0030.00316.62
7.4.290.0000.00916.63
7.4.280.0030.00516.43
7.4.270.0000.00716.63
7.4.260.0040.00416.52
7.4.250.0050.00316.47
7.4.240.0040.00416.60
7.4.230.0000.00716.65
7.4.220.0140.00416.65
7.4.210.0060.01216.56
7.4.200.0040.00416.50
7.4.160.0060.01116.41
7.4.150.0120.00617.40
7.4.140.0090.01217.86
7.4.130.0110.00616.69
7.4.120.0120.00816.52
7.4.110.0030.01316.48
7.4.100.0030.01516.54
7.4.90.0060.01216.53
7.4.80.0100.00619.39
7.4.70.0040.01316.63
7.4.60.0060.01016.54
7.4.50.0040.00416.31
7.4.40.0130.01016.52
7.4.30.0060.01316.62
7.4.10.0070.01114.95
7.4.00.0110.00714.75
7.3.330.0000.00613.48
7.3.320.0050.00013.32
7.3.310.0000.00816.49
7.3.300.0030.00316.47
7.3.290.0080.00816.45
7.3.280.0100.01016.47
7.3.270.0140.01417.40
7.3.260.0120.00616.63
7.3.250.0110.00816.53
7.3.240.0110.00716.45
7.3.230.0040.01516.46
7.3.210.0130.00316.43
7.3.200.0060.01219.39
7.3.190.0090.00916.73
7.3.180.0130.01016.58
7.3.170.0070.00916.58
7.3.160.0100.01016.48
7.3.130.0090.00914.80
7.3.120.0070.00814.98
7.3.110.0030.01315.21
7.3.100.0030.01314.71
7.3.90.0040.00715.00
7.3.80.0140.00015.17
7.3.70.0080.00414.70
7.3.60.0100.00315.02
7.3.50.0060.00914.75
7.3.40.0060.00614.75
7.3.30.0060.00614.98
7.3.20.0060.00616.74
7.3.10.0000.01816.88
7.3.00.0030.00616.73
7.2.330.0110.00616.51
7.2.320.0060.01016.68
7.2.310.0090.00616.61
7.2.300.0100.00716.82
7.2.290.0130.01016.86
7.2.260.0070.01115.18
7.2.250.0110.00715.11
7.2.240.0070.01015.10
7.2.230.0030.01015.08
7.2.220.0070.00715.05
7.2.210.0090.00614.78
7.2.200.0050.00515.06
7.2.190.0060.00915.02
7.2.180.0040.00814.94
7.2.170.0110.00315.15
7.2.160.0130.00314.86
7.2.150.0040.00717.11
7.2.140.0100.00616.97
7.2.130.0080.00417.02
7.2.120.0030.01216.74
7.2.110.0060.00616.77
7.2.100.0060.00616.98
7.2.90.0030.00717.08
7.2.80.0030.01317.14
7.2.70.0030.01316.79
7.2.60.0090.00416.66
7.2.50.0060.01016.98
7.2.40.0070.00716.97
7.2.30.0070.00717.10
7.2.20.0030.01616.96
7.2.10.0140.00316.75
7.2.00.0050.00518.17
7.1.330.0030.01215.80
7.1.320.0000.01515.75
7.1.310.0000.01815.63
7.1.300.0030.01215.67
7.1.290.0070.00715.84
7.1.280.0040.00715.80
7.1.270.0000.01615.76
7.1.260.0070.00715.64
7.1.250.0030.00715.89
7.1.240.0090.00615.57
7.1.230.0050.00515.68
7.1.220.0030.00915.84
7.1.210.0070.00415.93
7.1.200.0120.00215.68
7.1.190.0030.01015.76
7.1.180.0030.01015.48
7.1.170.0070.00415.97
7.1.160.0030.01015.71
7.1.150.0040.00415.54
7.1.140.0040.01215.57
7.1.130.0140.00315.71
7.1.120.0030.00915.89
7.1.110.0030.01315.61
7.1.100.0070.01016.86
7.1.90.0080.00815.74
7.1.80.0060.00315.96
7.1.70.0020.01016.53
7.1.60.0050.01417.40
7.1.50.0040.01216.51
7.1.40.0070.00715.78
7.1.30.0090.00015.80
7.1.20.0130.00015.78
7.1.10.0000.00815.68
7.1.00.0030.04419.15
7.0.330.0000.01315.34
7.0.320.0000.01015.62
7.0.310.0000.00915.43
7.0.300.0030.00615.59
7.0.290.0050.00815.41
7.0.280.0030.00515.15
7.0.270.0060.01215.41
7.0.260.0000.00915.60
7.0.250.0080.00615.49
7.0.240.0030.01015.32
7.0.230.0070.01115.10
7.0.220.0080.00315.44
7.0.210.0000.00815.41
7.0.200.0030.01216.16
7.0.190.0000.01015.34
7.0.180.0100.01015.48
7.0.170.0040.01515.48
7.0.160.0040.00815.32
7.0.150.0000.01115.48
7.0.140.0060.03818.75
7.0.130.0070.00715.39
7.0.120.0030.01315.46
7.0.110.0000.01215.49
7.0.100.0000.00915.66
7.0.90.0060.00615.55
7.0.80.0050.00515.39
7.0.70.0110.00715.59
7.0.60.0030.02517.70
7.0.50.0030.03716.73
7.0.40.0070.04616.86
7.0.30.0180.04116.82
7.0.20.0170.04216.93
7.0.10.0100.02116.91
7.0.00.0050.02616.94
5.6.400.0030.00714.32
5.6.390.0000.01114.02
5.6.380.0110.00314.34
5.6.370.0000.01214.34
5.6.360.0060.00314.24
5.6.350.0080.00413.98
5.6.340.0000.01614.13
5.6.330.0030.00913.87
5.6.320.0000.00914.23
5.6.310.0080.00314.08
5.6.300.0070.00314.10
5.6.290.0110.00714.28
5.6.280.0030.04317.56
5.6.270.0070.00714.04
5.6.260.0060.00914.15
5.6.250.0060.00914.26
5.6.240.0130.00014.30
5.6.230.0060.01014.17
5.6.220.0100.00014.14
5.6.210.0150.04017.30
5.6.200.0030.02616.16
5.6.190.0030.02717.18
5.6.180.0120.03517.40
5.6.170.0130.04217.42
5.6.160.0080.04317.36
5.6.150.0050.03316.06
5.6.140.0060.02116.07
5.6.130.0070.04216.26
5.6.120.0070.04517.57
5.6.110.0070.04217.46
5.6.100.0070.04617.64
5.6.90.0130.01917.46
5.6.80.0100.04117.28
5.6.70.0060.00913.97
5.6.60.0090.00614.08
5.6.50.0040.01114.07
5.6.40.0040.00813.87
5.6.30.0040.00714.13
5.6.20.0030.00914.08
5.6.10.0030.01313.91
5.6.00.0120.00013.96
5.5.380.0040.01514.32
5.5.370.0030.01014.10
5.5.360.0040.00413.84
5.5.350.0100.01817.21
5.5.340.0020.04516.11
5.5.330.0040.03117.08
5.5.320.0180.04517.30
5.5.310.0130.04017.01
5.5.300.0020.02916.18
5.5.290.0080.03915.88
5.5.280.0020.02717.42
5.5.270.0050.02517.37
5.5.260.0050.04617.44
5.5.250.0050.02017.32
5.5.240.0020.04317.10
5.5.230.0030.00513.78
5.5.220.0000.01314.00
5.5.210.0070.00414.09
5.5.200.0030.00614.00
5.5.190.0080.00014.06
5.5.180.0040.01113.85
5.5.170.0070.00413.97
5.5.160.0000.01514.13
5.5.150.0100.00314.09
5.5.140.0060.00913.86
5.5.130.0070.01014.06
5.5.120.0070.00714.16
5.5.110.0030.01314.18
5.5.100.0040.00414.04
5.5.90.0070.00714.22
5.5.80.0090.00914.04
5.5.70.0120.00613.96
5.5.60.0100.01013.98
5.5.50.0110.00413.75
5.5.40.0040.01113.97
5.5.30.0030.01214.12
5.5.20.0100.00713.86
5.5.10.0030.01213.92
5.5.00.0070.00713.91
5.4.450.0210.02315.99
5.4.440.0190.02016.04
5.4.430.0200.02015.95
5.4.420.0230.02115.83
5.4.410.0200.02215.91
5.4.400.0130.02215.87
5.4.390.0280.02515.74
5.4.380.0130.03915.64
5.4.370.0200.02715.61
5.4.360.0110.03615.63
5.4.350.0170.03015.52
5.4.340.0180.03315.57
5.4.330.0000.01312.50
5.4.320.0100.01612.52
5.4.310.0050.03212.52
5.4.300.0080.02412.52
5.4.290.0070.02112.51
5.4.280.0090.02112.46
5.4.270.0050.03012.46
5.4.260.0070.02812.46
5.4.250.0060.02312.46
5.4.240.0060.02212.46
5.4.230.0070.02512.46
5.4.220.0060.01912.46
5.4.210.0020.02412.46
5.4.200.0050.02212.46
5.4.190.0070.02012.46
5.4.180.0030.02312.46
5.4.170.0070.02312.46
5.4.160.0070.01812.46
5.4.150.0050.02412.46
5.4.140.0040.02712.30
5.4.130.0050.02012.29
5.4.120.0070.01812.28
5.4.110.0020.02612.27
5.4.100.0040.02212.27
5.4.90.0060.02612.27
5.4.80.0030.02412.27
5.4.70.0080.02012.27
5.4.60.0030.02312.27
5.4.50.0060.01912.27
5.4.40.0050.01912.27
5.4.30.0070.01912.26
5.4.20.0040.02112.26
5.4.10.0020.02612.26
5.4.00.0050.02612.01
5.3.290.0040.02412.65
5.3.280.0040.02912.61
5.3.270.0080.02012.61
5.3.260.0070.01912.61
5.3.250.0070.02012.61
5.3.240.0080.02012.61
5.3.230.0090.01912.61
5.3.220.0010.02712.59
5.3.210.0070.02112.59
5.3.200.0060.01912.59
5.3.190.0080.01712.59
5.3.180.0040.02212.59
5.3.170.0040.02112.59
5.3.160.0050.02012.59
5.3.150.0080.02112.59
5.3.140.0050.02012.58
5.3.130.0040.02412.58
5.3.120.0040.02112.58
5.3.110.0020.02512.58
5.3.100.0080.02412.33
5.3.90.0050.02012.32
5.3.80.0040.02112.31
5.3.70.0050.02212.31
5.3.60.0100.02012.30
5.3.50.0080.02012.27
5.3.40.0040.02112.27
5.3.30.0050.02112.26
5.3.20.0040.02212.15
5.3.10.0040.02112.13
5.3.00.0080.02012.12
5.2.170.0050.0349.22
5.2.160.0040.0299.23
5.2.150.0080.0399.22
5.2.140.0080.0389.22
5.2.130.0070.0289.18
5.2.120.0080.0379.18
5.2.110.0060.0319.19
5.2.100.0080.0339.18
5.2.90.0050.0299.18
5.2.80.0020.0329.17
5.2.70.0070.0289.18
5.2.60.0050.0299.13
5.2.50.0050.0299.10
5.2.40.0050.0369.07
5.2.30.0090.0259.05
5.2.20.0040.0299.04
5.2.10.0040.0298.95
5.2.00.0040.0298.82
5.1.60.0040.0248.09
5.1.50.0030.0308.09
5.1.40.0060.0308.07
5.1.30.0040.0268.42
5.1.20.0060.0258.45
5.1.10.0010.0288.16
5.1.00.0070.0268.16
5.0.50.0050.0256.65
5.0.40.0060.0176.50
5.0.30.0020.0336.32
5.0.20.0020.0216.28
5.0.10.0020.0226.26
5.0.00.0060.0286.25
4.4.90.0020.0164.78
4.4.80.0020.0164.75
4.4.70.0010.0174.76
4.4.60.0030.0164.76
4.4.50.0030.0194.77
4.4.40.0020.0264.71
4.4.30.0030.0154.76
4.4.20.0010.0174.84
4.4.10.0000.0174.85
4.4.00.0060.0254.76
4.3.110.0030.0154.67
4.3.100.0030.0144.67
4.3.90.0020.0154.63
4.3.80.0010.0294.58
4.3.70.0050.0164.63
4.3.60.0020.0154.63
4.3.50.0020.0164.63
4.3.40.0060.0274.54
4.3.30.0010.0173.30
4.3.20.0020.0173.28
4.3.10.0030.0153.24
4.3.00.0030.01315.28

preferences:
44.86 ms | 401 KiB | 5 Q