3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LazyLoadedMethods { protected $_data = array(); protected static $_instance; protected static function set($key, $value){ static::$_instance->_data[$key] = $value; return static::$_instance; } protected static 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) { $fn = static::getFunction(__FUNCTION__, function($value) { return $value == 1 || $value == true; }); return $fn($v); } public static function parseNewLines($v) { $fn = static::getFunction($v, function($value) { return trim(preg_replace('/\s\s+/', ' ', $string)); }); return $fn($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.0090.00616.63
8.3.50.0100.01122.05
8.3.40.0070.01418.79
8.3.30.0000.01419.27
8.3.20.0040.00420.39
8.3.10.0000.00721.73
8.3.00.0040.00417.93
8.2.180.0100.01018.29
8.2.170.0190.00322.96
8.2.160.0170.00320.26
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.01826.16
8.2.120.0000.00821.04
8.2.110.0030.00622.29
8.2.100.0040.00817.84
8.2.90.0000.00819.30
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0030.00618.05
8.2.50.0030.00518.07
8.2.40.0000.00818.24
8.2.30.0080.00018.03
8.2.20.0040.00417.74
8.2.10.0040.00418.21
8.2.00.0040.00417.81
8.1.280.0070.01425.92
8.1.270.0080.00023.88
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00623.84
8.1.230.0040.00718.97
8.1.220.0000.00917.79
8.1.210.0050.00318.77
8.1.200.0090.00017.35
8.1.190.0050.00317.23
8.1.180.0080.00018.10
8.1.170.0040.00418.63
8.1.160.0000.00722.04
8.1.150.0040.00418.90
8.1.140.0000.00717.53
8.1.130.0000.00717.77
8.1.120.0000.00817.48
8.1.110.0040.00417.47
8.1.100.0040.00417.48
8.1.90.0080.00017.43
8.1.80.0070.00017.49
8.1.70.0030.00317.41
8.1.60.0080.00017.61
8.1.50.0050.00317.61
8.1.40.0040.00717.54
8.1.30.0030.00517.75
8.1.20.0040.00417.64
8.1.10.0000.00717.58
8.1.00.0040.00417.52
8.0.300.0070.00018.77
8.0.290.0080.00016.72
8.0.280.0050.00218.52
8.0.270.0030.00517.34
8.0.260.0030.00317.34
8.0.250.0030.00316.94
8.0.240.0030.00316.90
8.0.230.0000.00717.03
8.0.220.0070.00016.92
8.0.210.0000.00716.89
8.0.200.0030.00316.98
8.0.190.0000.00816.97
8.0.180.0070.00017.00
8.0.170.0040.00416.90
8.0.160.0000.00716.88
8.0.150.0040.00416.79
8.0.140.0000.00716.84
8.0.130.0030.00513.38
8.0.120.0040.00416.86
8.0.110.0000.00816.85
8.0.100.0050.00317.03
8.0.90.0040.00416.98
8.0.80.0130.00716.93
8.0.70.0000.00716.78
8.0.60.0000.00716.81
8.0.50.0070.00016.80
8.0.30.0120.00917.18
8.0.20.0060.01317.40
8.0.10.0040.00417.07
8.0.00.0080.01216.87
7.4.330.0050.00015.15
7.4.320.0000.00616.64
7.4.300.0030.00316.62
7.4.290.0040.00416.62
7.4.280.0000.00716.62
7.4.270.0000.00716.54
7.4.260.0000.01016.61
7.4.250.0000.00716.40
7.4.240.0030.00416.52
7.4.230.0070.00016.38
7.4.220.0040.01516.57
7.4.210.0070.01016.64
7.4.200.0070.00016.43
7.4.160.0040.01216.38
7.4.150.0210.02817.40
7.4.140.0160.00417.86
7.4.130.0080.00916.56
7.4.120.0050.01216.63
7.4.110.0100.00716.62
7.4.100.0150.00316.52
7.4.90.0070.01016.59
7.4.80.0100.00719.39
7.4.70.0070.01016.55
7.4.60.0060.01016.53
7.4.50.0080.00016.37
7.4.40.0030.01316.54
7.4.30.0100.00616.49
7.4.10.0090.01016.20
7.4.00.0080.01015.32
7.3.330.0050.00013.22
7.3.320.0050.00013.33
7.3.310.0030.00316.38
7.3.300.0070.00016.44
7.3.290.0090.00916.41
7.3.280.0100.01016.43
7.3.270.0090.01217.40
7.3.260.0090.01116.46
7.3.250.0130.00616.44
7.3.240.0100.00716.36
7.3.230.0130.00316.57
7.3.210.0140.00316.58
7.3.200.0090.00919.39
7.3.190.0090.00916.58
7.3.180.0090.00816.48
7.3.170.0090.00616.48
7.3.160.0110.00516.52
7.3.130.0040.01116.38
7.3.120.0080.00815.07
7.3.110.0060.01215.24
7.3.100.0060.00915.35
7.3.90.0060.00615.41
7.3.80.0050.00715.44
7.3.70.0050.00815.27
7.3.60.0060.01015.37
7.3.50.0060.00515.23
7.3.40.0030.01015.34
7.3.30.0040.00915.39
7.3.20.0100.00517.04
7.3.10.0070.00917.25
7.3.00.0070.00717.24
7.2.330.0140.00416.81
7.2.320.0080.00816.80
7.2.310.0060.01216.61
7.2.300.0080.00816.68
7.2.290.0030.01316.71
7.2.260.0090.01116.35
7.2.250.0070.01315.54
7.2.240.0080.01215.58
7.2.230.0050.00715.68
7.2.220.0100.00415.57
7.2.210.0020.01015.64
7.2.200.0060.01115.44
7.2.190.0040.01015.58
7.2.180.0050.00615.48
7.2.170.0070.00915.63
7.2.160.0040.01116.66
7.2.150.0070.01318.55
7.2.140.0090.00618.41
7.2.130.0060.00618.44
7.2.120.0040.01218.59
7.2.110.0030.01318.65
7.2.100.0030.01018.25
7.2.90.0040.00818.47
7.2.80.0110.00318.42
7.2.70.0060.00918.50
7.2.60.0100.00318.35
7.2.50.0120.00318.57
7.2.40.0040.01518.47
7.2.30.0130.00618.70
7.2.20.0100.00318.39
7.2.10.0060.01218.45
7.2.00.0080.00819.02
7.1.330.0060.00916.29
7.1.320.0080.00516.20
7.1.310.0050.00516.50
7.1.300.0040.01016.35
7.1.290.0050.00516.22
7.1.280.0080.00516.33
7.1.270.0060.00716.35
7.1.260.0060.00816.34
7.1.250.0100.00317.29
7.1.240.0100.00317.23
7.1.230.0030.01217.31
7.1.220.0060.00617.25
7.1.210.0070.01017.34
7.1.200.0140.00017.30
7.1.190.0030.01017.22
7.1.180.0090.00317.42
7.1.170.0030.00817.34
7.1.160.0070.00717.38
7.1.150.0030.00617.52
7.1.140.0090.00317.44
7.1.130.0060.00617.29
7.1.120.0090.00617.34
7.1.110.0060.00617.23
7.1.100.0070.00417.65
7.1.90.0070.00717.30
7.1.80.0030.00917.21
7.1.70.0030.00717.29
7.1.60.0020.01618.20
7.1.50.0070.00917.04
7.1.40.0060.00317.43
7.1.30.0060.00617.31
7.1.20.0000.01417.34
7.1.10.0030.00917.42
7.1.00.0080.04119.84
7.0.330.0100.00317.21
7.0.320.0040.01117.24
7.0.310.0030.01016.89
7.0.300.0060.00317.14
7.0.290.0040.01116.96
7.0.280.0090.00317.00
7.0.270.0120.00617.06
7.0.260.0030.00617.13
7.0.250.0070.00716.85
7.0.240.0090.00016.96
7.0.230.0060.00616.96
7.0.220.0120.00317.21
7.0.210.0030.01017.11
7.0.200.0020.00916.92
7.0.190.0100.00716.93
7.0.180.0070.00717.14
7.0.170.0000.01217.11
7.0.160.0060.00316.84
7.0.150.0060.00617.19
7.0.140.0050.04019.54
7.0.130.0050.00516.74
7.0.120.0070.00717.12
7.0.110.0060.00316.96
7.0.100.0070.00717.06
7.0.90.0070.00416.96
7.0.80.0030.01016.90
7.0.70.0030.00916.93
7.0.60.0160.03818.46
7.0.50.0050.04717.53
7.0.40.0100.04517.69
7.0.30.0120.03217.71
7.0.20.0190.02517.58
7.0.10.0030.03717.58
7.0.00.0070.03517.54
5.6.400.0070.01016.02
5.6.390.0070.00716.03
5.6.380.0070.01016.06
5.6.370.0090.00616.18
5.6.360.0030.01015.84
5.6.350.0040.01416.07
5.6.340.0070.00716.04
5.6.330.0080.00916.17
5.6.320.0070.00715.92
5.6.310.0040.00816.00
5.6.300.0000.01716.23
5.6.290.0080.00616.05
5.6.280.0050.04018.69
5.6.270.0030.01216.04
5.6.260.0060.00916.14
5.6.250.0030.00816.00
5.6.240.0100.00316.18
5.6.230.0100.00315.97
5.6.220.0130.00016.07
5.6.210.0090.03618.32
5.6.200.0070.02816.99
5.6.190.0060.04518.32
5.6.180.0150.02518.29
5.6.170.0200.03218.30
5.6.160.0030.04018.13
5.6.150.0130.04017.04
5.6.140.0100.04217.06
5.6.130.0090.04417.04
5.6.120.0070.04718.56
5.6.110.0040.04018.48
5.6.100.0100.03818.52
5.6.90.0100.03918.44
5.6.80.0050.04418.23
5.6.70.0140.00416.16
5.6.60.0080.00816.05
5.6.50.0030.00715.93
5.6.40.0060.01016.02
5.6.30.0030.01316.00
5.6.20.0040.00715.91
5.6.10.0050.00515.92
5.6.00.0070.00716.12
5.5.380.0060.00915.80
5.5.370.0070.00715.96
5.5.360.0070.00716.20
5.5.350.0140.04218.23
5.5.340.0060.02316.93
5.5.330.0060.03018.24
5.5.320.0020.03018.28
5.5.310.0160.03018.22
5.5.300.0070.04016.91
5.5.290.0130.04016.99
5.5.280.0060.02618.43
5.5.270.0070.02518.41
5.5.260.0110.04318.55
5.5.250.0090.04018.21
5.5.240.0120.04518.06
5.5.230.0040.01115.91
5.5.220.0100.00315.91
5.5.210.0000.01316.00
5.5.200.0100.00315.98
5.5.190.0000.00915.98
5.5.180.0070.00715.93
5.5.170.0050.00515.75
5.5.160.0080.00515.96
5.5.150.0050.00516.02
5.5.140.0000.01116.16
5.5.130.0000.01416.00
5.5.120.0060.00915.91
5.5.110.0040.00815.93
5.5.100.0030.00915.90
5.5.90.0110.00316.01
5.5.80.0030.01015.82
5.5.70.0000.01515.71
5.5.60.0000.01116.06
5.5.50.0070.00715.73
5.5.40.0030.01015.89
5.5.30.0070.01015.92
5.5.20.0090.00615.82
5.5.10.0070.01015.89
5.5.00.0070.00715.61
5.4.450.0270.02716.10
5.4.440.0230.02816.14
5.4.430.0250.02016.11
5.4.420.0320.02516.07
5.4.410.0130.02716.02
5.4.400.0170.01816.02
5.4.390.0190.02315.97
5.4.380.0170.03315.67
5.4.370.0150.03315.71
5.4.360.0220.03015.77
5.4.350.0180.03115.78
5.4.340.0200.03515.74
5.4.330.0050.00212.70
5.4.320.0070.02112.61
5.4.310.0060.02412.66
5.4.300.0040.02112.72
5.4.290.0040.02212.65
5.4.280.0080.01912.56
5.4.270.0080.02012.56
5.4.260.0090.02012.56
5.4.250.0080.02812.63
5.4.240.0040.02512.63
5.4.230.0080.02212.55
5.4.220.0050.02112.55
5.4.210.0080.02212.55
5.4.200.0070.03012.60
5.4.190.0020.02412.58
5.4.180.0030.02412.62
5.4.170.0040.02212.55
5.4.160.0070.02212.55
5.4.150.0040.02312.55
5.4.140.0040.02312.40
5.4.130.0080.01812.44
5.4.120.0040.02412.37
5.4.110.0040.02012.42
5.4.100.0040.02212.37
5.4.90.0050.02412.37
5.4.80.0060.02012.41
5.4.70.0040.02312.36
5.4.60.0080.02012.36
5.4.50.0080.02112.36
5.4.40.0040.02412.37
5.4.30.0030.02312.40
5.4.20.0070.02612.43
5.4.10.0080.01812.42
5.4.00.0080.02012.20
5.3.290.0050.02513.00
5.3.280.0040.02312.87
5.3.270.0050.02512.89
5.3.260.0040.02512.90
5.3.250.0070.02012.92
5.3.240.0080.02012.86
5.3.230.0030.02513.01
5.3.220.0040.02212.81
5.3.210.0070.02412.78
5.3.200.0080.02012.84
5.3.190.0070.02012.85
5.3.180.0060.02012.91
5.3.170.0060.02212.96
5.3.160.0030.02512.95
5.3.150.0050.02312.93
5.3.140.0040.02312.89
5.3.130.0030.02312.91
5.3.120.0070.02212.79
5.3.110.0040.02312.91
5.3.100.0060.02012.62
5.3.90.0040.02512.75
5.3.80.0050.02312.56
5.3.70.0060.02512.49
5.3.60.0050.02312.62
5.3.50.0070.02012.48
5.3.40.0030.02212.57
5.3.30.0030.02412.55
5.3.20.0030.02212.41
5.3.10.0040.02412.29
5.3.00.0050.02412.40
5.2.170.0070.0319.23
5.2.160.0030.0309.22
5.2.150.0040.0329.23
5.2.140.0050.0359.22
5.2.130.0090.0329.18
5.2.120.0060.0309.18
5.2.110.0030.0309.19
5.2.100.0060.0269.18
5.2.90.0030.0309.18
5.2.80.0040.0309.18
5.2.70.0050.0299.17
5.2.60.0050.0299.13
5.2.50.0070.0359.10
5.2.40.0050.0289.08
5.2.30.0060.0289.05
5.2.20.0050.0289.04
5.2.10.0050.0288.95
5.2.00.0040.0298.81
5.1.60.0020.0318.09
5.1.50.0070.0228.09
5.1.40.0050.0248.07
5.1.30.0030.0308.42
5.1.20.0070.0318.44
5.1.10.0040.0258.17
5.1.00.0010.0288.17
5.0.50.0020.0226.65
5.0.40.0040.0186.51
5.0.30.0030.0326.32
5.0.20.0030.0256.28
5.0.10.0030.0226.26
5.0.00.0030.0316.25
4.4.90.0040.0134.78
4.4.80.0020.0154.75
4.4.70.0030.0164.75
4.4.60.0040.0224.75
4.4.50.0030.0204.77
4.4.40.0040.0284.71
4.4.30.0040.0144.76
4.4.20.0050.0214.84
4.4.10.0040.0144.85
4.4.00.0010.0274.76
4.3.110.0040.0144.67
4.3.100.0030.0144.66
4.3.90.0030.0144.63
4.3.80.0040.0234.58
4.3.70.0040.0164.63
4.3.60.0030.0144.63
4.3.50.0050.0134.63
4.3.40.0020.0244.54
4.3.30.0050.0133.30
4.3.20.0020.0153.28
4.3.10.0010.0163.24
4.3.00.0070.01315.28

preferences:
47.78 ms | 401 KiB | 5 Q