3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Maniple_Model { /** * @param array $data OPTIONAL * @return void */ public function __construct(array $data = null) // {{{ { if ($data) { $this->setFromArray($data); } } // }}} /** * @param array $data * @return Maniple_Model */ public function setFromArray(array $data) // {{{ { foreach ($data as $key => $value) { $this->__set($key, $value, false); } return $this; } // }}} /** * @param string $key * @param mixed $value * @param bool $throw OPTIONAL * @return Maniple_Model * @throws InvalidArgumentException */ protected function _setProperty($key, $value, $throw = true) // {{{ { $key = self::toCamelCase($key); $setter = 'set' . $key; if (method_exists($this, $setter)) { $this->{$setter}($value); return $this; } $property = '_' . $key; if (property_exists($this, $property)) { $this->{$property} = $value; return $this; } throw new InvalidArgumentException(sprintf('Invalid property: %s', $key)); return false; } // }}} /** * @param string $key * @param bool $throw OPTIONAL * @return mixed * @throws InvalidArgumentException */ protected function _getProperty($key, $throw = true) // {{{ { $getter = 'get' . $key; if (method_exists($this, $getter)) { return $this->{$getter}(); } $property = '_' . $key; if (property_exists($this, $property)) { return $property; } if ($throw) { throw new InvalidArgumentException(sprintf('Invalid property: %s', $key)); } } // }}} /** * @param string $key * @return bool */ public function has($key) // {{{ { return property_exists($this, '_' . self::toCamelCase($key)); } // }}} /** * @param string $key * @return bool */ public function __isset($key) // {{{ { return isset($this->{'_' . self::toCamelCase($key)}); } // }}} /** * @param string $key * @return mixed * @throws InvalidArgumentException */ public function __get($key) // {{{ { return $this->_getProperty($key, true); } // }}} /** * @param string $key * @param mixed $value * @return void * @throws InvalidArgumentException */ public function __set($key, $value) // {{{ { return $this->_setProperty($key, $value, true); } // }}} /** * Transform given string to camel-case. * * @param string $str * @return string */ public static function toCamelCase($str) // {{{ { if (is_array($str) && isset($str[1])) { return strtoupper($str[1]); } return preg_replace_callback( '/_(\w)/', array(__CLASS__, __FUNCTION__), (string) $str ); } // }}} }

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.0110.00718.30
8.3.50.0090.01221.92
8.3.40.0080.00818.66
8.3.30.0100.00320.34
8.3.20.0040.00420.23
8.3.10.0040.00421.83
8.3.00.0040.00422.34
8.2.180.0160.00616.38
8.2.170.0090.00922.96
8.2.160.0030.01020.57
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0130.00726.16
8.2.120.0040.00419.41
8.2.110.0030.00622.22
8.2.100.0080.00417.72
8.2.90.0040.00418.22
8.2.80.0000.00817.97
8.2.70.0040.00417.91
8.2.60.0060.00317.99
8.2.50.0000.00818.10
8.2.40.0000.00817.97
8.2.30.0080.00017.90
8.2.20.0060.00317.59
8.2.10.0040.00417.53
8.2.00.0030.00617.73
8.1.280.0070.00725.92
8.1.270.0030.00524.66
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.05
8.1.230.0060.00619.04
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0060.00316.99
8.1.180.0080.00018.10
8.1.170.0070.00318.64
8.1.160.0000.00722.19
8.1.150.0030.00618.57
8.1.140.0040.00417.36
8.1.130.0070.00017.86
8.1.120.0040.00417.46
8.1.110.0050.00217.40
8.1.100.0070.00017.29
8.1.90.0000.00717.31
8.1.80.0000.00717.38
8.1.70.0000.00717.39
8.1.60.0030.00617.41
8.1.50.0030.00517.42
8.1.40.0030.00517.35
8.1.30.0040.00417.52
8.1.20.0040.00417.45
8.1.10.0000.01017.44
8.1.00.0000.00817.31
8.0.300.0080.00019.85
8.0.290.0040.00416.75
8.0.280.0070.00018.39
8.0.270.0040.00417.20
8.0.260.0050.00216.78
8.0.250.0030.00316.89
8.0.240.0090.00016.84
8.0.230.0040.00416.87
8.0.220.0000.00716.83
8.0.210.0040.00416.82
8.0.200.0040.00416.78
8.0.190.0040.00416.80
8.0.180.0040.00416.86
8.0.170.0080.00016.80
8.0.160.0000.00716.85
8.0.150.0000.00816.77
8.0.140.0000.00816.79
8.0.130.0030.00313.13
8.0.120.0050.00316.77
8.0.110.0000.00816.82
8.0.100.0000.00816.89
8.0.90.0030.00516.83
8.0.80.0110.00416.79
8.0.70.0050.00316.66
8.0.60.0040.00416.86
8.0.50.0040.00416.62
8.0.30.0080.01016.86
8.0.20.0020.01917.40
8.0.10.0040.00417.06
8.0.00.0130.00616.67
7.4.330.0060.00015.00
7.4.320.0030.00316.51
7.4.300.0080.00316.46
7.4.290.0070.00016.41
7.4.280.0060.00516.52
7.4.270.0000.00816.37
7.4.260.0070.00416.42
7.4.250.0000.00716.51
7.4.240.0020.00516.44
7.4.230.0000.00816.57
7.4.220.0090.00916.49
7.4.210.0080.00916.51
7.4.200.0000.00716.53
7.4.190.0080.00016.44
7.4.160.0130.01016.53
7.4.150.0070.01017.40
7.4.140.0110.00917.86
7.4.130.0030.01516.54
7.4.120.0080.01116.32
7.4.110.0070.01116.39
7.4.100.0110.00816.45
7.4.90.0090.00916.50
7.4.80.0030.01319.39
7.4.70.0110.00816.46
7.4.60.0090.00916.52
7.4.50.0030.00616.48
7.4.40.0030.01022.77
7.4.30.0120.00616.48
7.4.00.0060.00915.07
7.3.330.0050.00013.02
7.3.320.0030.00313.00
7.3.310.0000.00816.05
7.3.300.0040.00416.07
7.3.290.0070.00716.25
7.3.280.0040.01316.28
7.3.270.0070.01417.40
7.3.260.0060.01216.08
7.3.250.0080.00916.40
7.3.240.0090.00916.17
7.3.230.0110.01116.39
7.3.210.0030.01416.16
7.3.200.0120.00419.39
7.3.190.0070.01616.31
7.3.180.0120.00616.16
7.3.170.0100.00716.54
7.3.160.0060.00916.34
7.3.120.0070.01014.62
7.3.10.0080.00416.09
7.3.00.0040.01216.14
7.2.330.0030.01716.55
7.2.320.0160.00816.57
7.2.310.0070.01116.28
7.2.300.0170.00016.30
7.2.290.0110.00616.68
7.2.130.0100.00316.44
7.2.120.0040.01116.38
7.2.110.0060.01216.50
7.2.100.0030.00616.07
7.2.90.0070.00716.40
7.2.80.0130.00316.61
7.2.70.0040.00816.53
7.2.60.0030.01016.53
7.2.50.0040.00716.39
7.2.40.0130.00916.57
7.2.30.0000.01116.68
7.2.20.0110.00716.17
7.2.10.0100.01016.43
7.2.00.0170.00316.54
7.1.250.0040.00415.09
7.1.100.0110.00417.72
7.1.70.0000.00717.13
7.1.60.0000.01719.43
7.1.50.0040.00716.81
7.1.00.0000.03722.40
7.0.200.0000.00716.66
7.0.140.0000.07721.95
7.0.60.0500.06019.98
7.0.50.0170.05317.91
7.0.40.0100.08320.15
7.0.30.0400.04720.24
7.0.20.0200.07320.19
7.0.10.0030.09020.12
7.0.00.0130.08720.16
5.6.280.0130.06321.14
5.6.210.0030.04320.75
5.6.200.0070.07018.29
5.6.190.0030.04320.77
5.6.180.0370.03320.77
5.6.170.0300.07020.45
5.6.160.0100.07720.66
5.6.150.0100.07718.16
5.6.140.0070.06018.15
5.6.130.0130.08018.21
5.6.120.0100.07721.01
5.6.110.0130.07320.98
5.6.100.0100.08020.99
5.6.90.0030.04021.00
5.6.80.0130.06020.43
5.5.350.0100.08720.35
5.5.340.0100.07717.95
5.5.330.0100.09020.27
5.5.320.0270.04720.32
5.5.310.0470.06320.36
5.5.300.0070.07718.07
5.5.290.0070.06318.08
5.5.280.0030.05020.75
5.5.270.0130.07720.66
5.5.260.0130.07720.90
5.5.250.0100.07320.61
5.5.240.0100.04720.28
5.4.450.0900.05019.61
5.4.440.0730.05019.43
5.4.430.0100.05719.22
5.4.420.0130.05319.32
5.4.410.0130.05319.08
5.4.400.0130.04718.86
5.4.390.0070.05718.52
5.4.380.0170.06718.73
5.4.370.0030.06318.83
5.4.360.0130.05318.76
5.4.350.0060.03512.04
5.4.340.0090.03512.03
5.4.320.0020.04012.52
5.4.310.0100.03312.51
5.4.300.0070.03512.52
5.4.290.0080.03512.52
5.4.280.0090.03312.41
5.4.270.0040.04012.41
5.4.260.0060.04012.42
5.4.250.0050.03912.41
5.4.240.0100.05719.08
5.4.230.0100.05018.88
5.4.220.0100.05718.84
5.4.210.0130.05018.99
5.4.200.0130.06318.79
5.4.190.0100.05018.93
5.4.180.0130.06718.97
5.4.170.0200.04018.78
5.4.160.0070.05318.92
5.4.150.0100.05018.96
5.4.140.0030.06016.32
5.4.130.0070.06716.54
5.4.120.0230.04316.50
5.4.110.0030.05716.55
5.4.100.0130.05016.40
5.4.90.0070.07316.36
5.4.80.0070.05316.46
5.4.70.0100.04716.41
5.4.60.0070.05016.44
5.4.50.0130.05016.48
5.4.40.0000.06016.53
5.4.30.0200.04316.30
5.4.20.0030.05316.60
5.4.10.0130.04716.60
5.4.00.0070.05015.88
5.3.290.0090.03612.80
5.3.280.0030.06314.61
5.3.270.0030.05714.79
5.3.260.0070.07314.65
5.3.250.0070.05014.71
5.3.240.0200.04014.71
5.3.230.0130.04714.64
5.3.220.0100.06314.68
5.3.210.0130.05014.58
5.3.200.0130.07014.67
5.3.190.0200.05714.66
5.3.180.0170.05014.59
5.3.170.0100.04714.56
5.3.160.0070.05314.67
5.3.150.0130.04714.56
5.3.140.0100.04714.66
5.3.130.0000.07014.59
5.3.120.0100.05714.56
5.3.110.0070.05314.80
5.3.100.0100.04714.20
5.3.90.0100.04713.95
5.3.80.0070.05014.12
5.3.70.0100.05714.28
5.3.60.0100.05014.26
5.3.50.0030.05014.05
5.3.40.0070.05314.20
5.3.30.0130.05314.02
5.3.20.0130.06713.55
5.3.10.0130.04313.76
5.3.00.0170.05013.74
5.2.170.0070.04011.16
5.2.160.0070.04011.13
5.2.150.0100.03711.16
5.2.140.0100.05311.24
5.2.130.0100.04011.10
5.2.120.0070.04011.21
5.2.110.0070.04011.20
5.2.100.0000.05311.08
5.2.90.0130.04310.96
5.2.80.0170.03011.11
5.2.70.0070.04311.20
5.2.60.0070.05711.05
5.2.50.0070.04311.23
5.2.40.0070.04011.12
5.2.30.0130.05011.07
5.2.20.0000.06011.21
5.2.10.0030.04010.96
5.2.00.0070.03710.76
5.1.60.0030.03710.18
5.1.50.0070.03010.18
5.1.40.0100.0339.97
5.1.30.0030.03710.31
5.1.20.0030.04010.39
5.1.10.0030.03710.05
5.1.00.0070.03710.14
5.0.50.0030.0308.79
5.0.40.0030.0278.25
5.0.30.0100.0338.20
5.0.20.0030.0278.18
5.0.10.0000.0378.41
5.0.00.0000.0508.25
4.4.90.0030.0306.51
4.4.80.0030.0206.51
4.4.70.0100.0136.51
4.4.60.0030.0206.51
4.4.50.0100.0236.51
4.4.40.0070.0306.51
4.4.30.0030.0206.51
4.4.20.0100.0176.51
4.4.10.0070.0176.51
4.4.00.0000.0436.51
4.3.110.0000.0236.51
4.3.100.0070.0176.51
4.3.90.0000.0236.51
4.3.80.0100.0276.51
4.3.70.0030.0276.51
4.3.60.0000.0206.52
4.3.50.0030.0206.52
4.3.40.0030.0306.52
4.3.30.0030.0206.52
4.3.20.0000.0236.52
4.3.10.0000.0236.52
4.3.00.0100.0236.60

preferences:
56.26 ms | 401 KiB | 5 Q