3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LazyLoadedMethods { protected $_data = array(); 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 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($v, function($value) { return $value == 1 || $value == true; }); } public static function parseNewLines($v) { return static::getFunction($v, function($value) { return trim(preg_replace('/\s\s+/', ' ', $string)); }); } } 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)
5.4.310.0050.04212.53
5.4.300.0050.03812.54
5.4.290.0050.03912.54
5.4.280.0090.03612.43
5.4.270.0050.03712.43
5.4.260.0040.03912.43
5.4.250.0070.04012.43
5.4.240.0040.03912.43
5.4.230.0070.03612.42
5.4.220.0060.04512.42
5.4.210.0070.03812.42
5.4.200.0100.03712.42
5.4.190.0100.03712.41
5.4.180.0050.03712.42
5.4.170.0060.03512.43
5.4.160.0050.03812.42
5.4.150.0080.03512.41
5.4.140.0050.03912.10
5.4.130.0070.03812.09
5.4.120.0050.04012.05
5.4.110.0070.03512.05
5.4.100.0110.04012.04
5.4.90.0070.03912.05
5.4.80.0040.04412.05
5.4.70.0040.03712.04
5.4.60.0030.03812.04
5.4.50.0080.03312.04
5.4.40.0060.03712.03
5.4.30.0070.03412.02
5.4.20.0080.03812.02
5.4.10.0060.03512.02
5.4.00.0100.03311.51
5.3.280.0080.04112.71
5.3.270.0050.04412.72
5.3.260.0100.04112.72
5.3.250.0040.04012.71
5.3.240.0040.04012.72
5.3.230.0070.03612.71
5.3.220.0040.03812.68
5.3.210.0070.03712.68
5.3.200.0080.03412.68
5.3.190.0070.04212.68
5.3.180.0080.03512.67
5.3.170.0080.03312.67
5.3.160.0050.03712.67
5.3.150.0060.03712.67
5.3.140.0080.04112.67
5.3.130.0050.04112.66
5.3.120.0080.03912.66
5.3.110.0080.03812.66
5.3.100.0050.03712.15
5.3.90.0040.03812.13
5.3.80.0060.03612.13
5.3.70.0080.03712.12
5.3.60.0070.03612.11
5.3.50.0070.03912.05
5.3.40.0060.03612.05
5.3.30.0060.03512.01
5.3.20.0070.04111.79
5.3.10.0030.03711.76
5.3.00.0060.03511.75
5.2.170.0070.0289.23
5.2.160.0070.0289.22
5.2.150.0040.0319.23
5.2.140.0040.0319.22
5.2.130.0060.0279.18
5.2.120.0020.0309.18
5.2.110.0020.0319.19
5.2.100.0030.0309.18
5.2.90.0030.0329.18
5.2.80.0040.0309.18
5.2.70.0080.0269.17
5.2.60.0090.0269.13
5.2.50.0080.0339.10
5.2.40.0020.0349.07
5.2.30.0060.0319.05
5.2.20.0080.0269.04
5.2.10.0060.0278.95
5.2.00.0020.0318.81
5.1.60.0040.0248.09
5.1.50.0030.0268.09
5.1.40.0050.0248.07
5.1.30.0070.0238.42
5.1.20.0030.0288.44
5.1.10.0050.0258.17
5.1.00.0060.0238.17
5.0.50.0040.0206.65
5.0.40.0030.0196.50
5.0.30.0060.0296.32
5.0.20.0030.0206.28
5.0.10.0020.0216.26
5.0.00.0040.0346.25
4.4.90.0030.0144.78
4.4.80.0050.0194.75
4.4.70.0040.0164.76
4.4.60.0020.0164.75
4.4.50.0040.0144.77
4.4.40.0020.0284.71
4.4.30.0050.0134.76
4.4.20.0030.0194.84
4.4.10.0040.0184.84
4.4.00.0040.0254.75
4.3.110.0020.0164.67
4.3.100.0010.0164.66
4.3.90.0040.0134.64
4.3.80.0030.0254.58
4.3.70.0040.0134.63
4.3.60.0010.0174.63
4.3.50.0040.0144.62
4.3.40.0030.0294.54
4.3.30.0030.0193.30
4.3.20.0030.0153.28
4.3.10.0030.0163.24
4.3.00.0000.01715.28

preferences:
137.15 ms | 1394 KiB | 7 Q