3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @xmlNamespace http://www.webservices.nl/soap/ * @xmlType * @xmlName RiskAddress */ class Address { /** * @xmlType string * @xmlRender value * @xmlName postcode * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_postcode; /** * @xmlType string * @xmlRender value * @xmlName building * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_building; /** * @xmlType string * @xmlRender value * @xmlName street * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_street; /** * @xmlType integer * @xmlRender value * @xmlName house_number * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_house_number; /** * @xmlType string * @xmlRender value * @xmlName house_number_addition * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_house_number_addition; /** * @xmlType string * @xmlRender value * @xmlName city * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_city; /** * @xmlType string * @xmlRender value * @xmlName municipality * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_municipality; /** * @xmlType string * @xmlRender value * @xmlName state * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_state; /** * @xmlType string * @xmlRender value * @xmlName country * @xmlNamespace http://www.webservices.nl/soap/ */ protected $_country; /** * @return string */ public function getPostcode() { return $this->_postcode; } /** * @param string $postcode */ public function setPostcode($postcode) { $this->_postcode = (string) $postcode; } /** * @return string */ public function getBuilding() { return $this->_building; } /** * @param string $building */ public function setBuilding($building) { $this->_building = (string) $building; } /** * @return string */ public function getStreet() { return $this->_street; } /** * @param string $street */ public function setStreet($street) { $this->_street = (string) $street; } /** * @return integer */ public function getHouseNumber() { return $this->_house_number; } /** * @param (integer) $houseNumber */ public function setHouseNumber($houseNumber) { $this->_house_number = (integer) $houseNumber; } /** * @return string */ public function getHouseNumberAddition() { return $this->_house_number_addition; } /** * @param string $houseNumberAddition */ public function setHouseNumberAddition($houseNumberAddition) { $this->_house_number_addition = (string) $houseNumberAddition; } /** * @return string */ public function getCity() { return $this->_city; } /** * @param string $city */ public function setCity($city) { $this->_city = (string) $city; } /** * @return string */ public function getMunicipality() { return $this->_municipality; } /** * @param string $municipality */ public function setMunicipality($municipality) { $this->_municipality = $municipality; } /** * @return string */ public function getState() { return $this->_state; } /** * @param string $state */ public function setState($state) { $this->_state = (string) $state; } /** * @return string */ public function getCountry() { return $this->_country; } /** * @param string $country */ public function setCountry($country) { $this->_country = (string) $country; } } class AddressHelper { public static function parse(Address $address, $parts) { $parts = func_get_args(); $address = array_shift($parts); $format = '~^(.*?\n)??' . '(?<street>[^0-9].*|.*?[^0-9])[\b\s]*?' . '(?<number>[0-9]{1,5}?)[\b\s\-]*?' . '(?<addition>[^\s]*?)[\b\s,]*?' . '(?<postcode>[0-9]{4}\s?[A-Z]{2})[\b\s,]*?' . '(?<city>[\w][\w\s]*?)' . '(\n.*)??$~msiU'; if (preg_match($format, implode(PHP_EOL, $parts), $args)) { $street = $number = $postcode = $city = $addition = null; extract($args, EXTR_OVERWRITE); $address->setStreet($street); $address->setHouseNumber($number); $address->setHouseNumberAddition($addition); $address->setPostcode($postcode); $address->setCity(strtoupper(trim($city))); } return $address; } } echo AddressHelper::parse(new Address(), null, null, null, null, null);

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.0180.00318.55
8.3.50.0140.00522.18
8.3.40.0150.00618.98
8.3.30.0080.00819.07
8.3.20.0060.00320.32
8.3.10.0040.00423.64
8.3.00.0050.00320.93
8.2.180.0040.01117.00
8.2.170.0090.00922.96
8.2.160.0070.00720.35
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00420.75
8.2.110.0090.00022.26
8.2.100.0110.00018.04
8.2.90.0040.00418.22
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0000.00817.93
8.2.50.0000.00818.10
8.2.40.0050.00319.82
8.2.30.0040.00418.29
8.2.20.0000.00717.86
8.2.10.0040.00418.25
8.2.00.0000.00718.04
8.1.280.0070.01125.92
8.1.270.0060.00323.96
8.1.260.0060.00326.35
8.1.250.0050.00228.09
8.1.240.0090.00023.79
8.1.230.0080.00422.58
8.1.220.0000.00817.77
8.1.210.0060.00318.97
8.1.200.0060.00317.50
8.1.190.0060.00317.48
8.1.180.0040.00418.10
8.1.170.0080.00018.55
8.1.160.0080.00022.06
8.1.150.0060.00318.88
8.1.140.0000.00917.51
8.1.130.0000.00817.90
8.1.120.0040.00417.60
8.1.110.0000.00817.61
8.1.100.0030.00517.51
8.1.90.0000.00817.61
8.1.80.0060.00317.63
8.1.70.0040.00417.63
8.1.60.0000.00917.68
8.1.50.0060.00317.76
8.1.40.0040.00417.67
8.1.30.0090.00017.85
8.1.20.0000.00817.74
8.1.10.0000.00717.66
8.1.00.0060.00317.64
8.0.300.0050.00321.99
8.0.290.0000.00817.00
8.0.280.0040.00418.55
8.0.270.0030.00317.30
8.0.260.0000.00717.25
8.0.250.0000.00717.20
8.0.240.0040.00417.22
8.0.230.0030.00317.18
8.0.220.0030.00417.16
8.0.210.0000.00717.13
8.0.200.0040.00417.16
8.0.190.0040.00517.12
8.0.180.0040.00417.05
8.0.170.0040.00417.19
8.0.160.0040.00417.09
8.0.150.0040.00417.04
8.0.140.0070.00017.11
8.0.130.0040.00513.54
8.0.120.0000.00817.12
8.0.110.0090.00017.11
8.0.100.0000.00717.09
8.0.90.0050.00316.96
8.0.80.0160.00717.11
8.0.70.0000.00717.11
8.0.60.0060.00317.02
8.0.50.0000.00817.09
8.0.30.0140.00517.24
8.0.20.0100.01417.59
8.0.10.0070.00017.27
8.0.00.0110.00717.13
7.4.330.0000.00515.00
7.4.320.0070.00316.85
7.4.300.0030.00316.68
7.4.290.0030.00316.80
7.4.280.0050.00316.82
7.4.270.0050.00216.83
7.4.260.0000.00716.83
7.4.250.0040.00416.71
7.4.240.0050.00216.81
7.4.230.0040.00416.84
7.4.220.0110.00816.72
7.4.210.0060.00816.86
7.4.200.0070.00016.75
7.4.190.0080.00016.72
7.4.160.0100.00716.74
7.4.150.0030.01517.40
7.4.140.0100.00817.86
7.4.130.0080.01016.73
7.4.120.0080.01016.75
7.4.110.0070.01016.89
7.4.100.0060.01216.64
7.4.90.0140.00416.71
7.4.80.0060.01219.39
7.4.70.0070.01016.81
7.4.60.0120.00616.75
7.4.50.0070.00016.58
7.4.40.0090.01516.79
7.4.30.0090.00916.73
7.4.00.0050.01415.07
7.3.330.0000.00613.54
7.3.320.0030.00313.39
7.3.310.0040.00416.58
7.3.300.0030.00316.45
7.3.290.0060.00916.50
7.3.280.0100.00916.47
7.3.270.0160.00317.40
7.3.260.0090.00916.47
7.3.250.0100.00716.49
7.3.240.0070.01016.59
7.3.230.0080.00816.44
7.3.210.0060.01316.42
7.3.200.0110.01119.39
7.3.190.0060.01616.48
7.3.180.0000.01516.80
7.3.170.0080.00816.67
7.3.160.0100.00616.45
7.3.120.0020.01614.86
7.3.110.0070.01014.75
7.3.100.0040.01114.97
7.3.90.0070.00315.00
7.3.80.0060.00914.89
7.3.70.0060.01214.84
7.3.60.0100.00314.52
7.3.50.0040.00715.05
7.3.40.0000.01015.05
7.3.30.0060.00914.84
7.3.20.0030.01016.91
7.3.10.0100.01116.54
7.3.00.0080.01016.62
7.2.330.0140.00316.99
7.2.320.0070.01016.84
7.2.310.0160.00316.90
7.2.300.0100.00916.65
7.2.290.0140.01016.89
7.2.250.0030.01615.47
7.2.240.0060.01315.23
7.2.230.0030.01315.38
7.2.220.0040.01115.38
7.2.210.0070.01015.09
7.2.200.0100.00715.34
7.2.190.0040.01215.27
7.2.180.0070.00715.39
7.2.170.0060.01015.22
7.2.130.0180.01116.68
7.2.120.0140.01416.66
7.2.110.0290.00016.33
7.2.100.0110.01516.99
7.2.90.0190.00416.71
7.2.80.0090.02016.79
7.2.70.0100.01917.02
7.2.60.0090.01016.97
7.2.50.0200.00416.32
7.2.40.0170.00716.32
7.2.30.0230.00716.66
7.2.20.0100.01416.54
7.2.10.0160.00416.55
7.2.00.0110.00718.35
7.1.330.0030.01016.12
7.1.320.0000.00915.73
7.1.310.0070.01015.88
7.1.300.0110.00415.73
7.1.290.0070.00315.90
7.1.280.0060.00915.70
7.1.270.0060.00316.07
7.1.260.0060.00615.53
7.1.250.0120.00915.82
7.1.200.0040.01116.09
7.1.100.0000.01118.17
7.1.70.0030.00517.27
7.1.60.0130.01319.46
7.1.50.0090.01617.16
7.1.00.0000.08022.50
7.0.200.0040.00417.05
7.0.140.0030.06721.98
7.0.60.0170.05020.03
7.0.50.0000.05017.93
7.0.40.0000.05720.14
7.0.30.0330.04320.29
7.0.20.0300.07720.26
7.0.10.0000.06320.33
7.0.00.0030.04320.26
5.6.280.0030.07321.07
5.6.210.0070.08720.64
5.6.200.0070.08718.32
5.6.190.0070.08720.39
5.6.180.0200.04020.77
5.6.170.0370.07020.56
5.6.160.0130.06020.48
5.6.150.0070.08018.25
5.6.140.0030.04018.20
5.6.130.0070.08018.20
5.6.120.0070.05721.00
5.6.110.0200.07721.06
5.6.100.0030.07021.01
5.6.90.0030.04021.04
5.6.80.0070.05320.56
5.5.350.4300.03720.55
5.5.340.0100.07718.05
5.5.330.0100.08320.43
5.5.320.0270.04720.39
5.5.310.0300.07320.34
5.5.300.0100.04317.96
5.5.290.0070.05017.97
5.5.280.0100.03320.96
5.5.270.0170.07020.82
5.5.260.0270.03720.90
5.5.250.0030.06020.63
5.5.240.0070.03320.07
5.4.450.0400.03719.55
5.4.440.0930.03719.47
5.4.430.0400.04019.45
5.4.420.0270.04350.62
5.4.410.0470.03746.74
5.4.400.0170.04042.52
5.4.390.0170.04041.17
5.4.380.0330.06318.75
5.4.370.0430.04718.75
5.4.360.0330.05718.59
5.4.350.0370.05018.78
5.4.340.0330.05018.63
5.4.320.0060.04712.54
5.4.310.0030.04112.53
5.4.300.0070.05112.54
5.4.290.0060.03912.54
5.4.280.0030.04012.43
5.4.270.0050.03812.43
5.4.260.0050.04012.43
5.4.250.0060.04012.43
5.4.240.0050.03912.43
5.4.230.0070.04112.42
5.4.220.0020.04112.42
5.4.210.0110.03812.42
5.4.200.0060.04412.42
5.4.190.0110.04012.42
5.4.180.0070.04912.42
5.4.170.0020.04112.43
5.4.160.0110.03612.42
5.4.150.0050.04412.42
5.4.140.0070.04112.10
5.4.130.0090.04112.09
5.4.120.0050.04212.05
5.4.110.0090.04412.04
5.4.100.0100.04612.04
5.4.90.0070.04612.04
5.4.80.0070.05712.05
5.4.70.0090.04912.04
5.4.60.0060.04412.04
5.4.50.0090.03812.04
5.4.40.0070.03712.03
5.4.30.0110.04912.02
5.4.20.0100.05012.02
5.4.10.0070.04812.02
5.4.00.0060.04911.51
5.3.290.0100.03912.80
5.3.280.0060.04912.73
5.3.270.0080.05112.73
5.3.260.0130.05012.73
5.3.250.0090.04812.74
5.3.240.0090.04912.73
5.3.230.0070.05012.73
5.3.220.0090.04812.70
5.3.210.0070.04712.70
5.3.200.0060.04312.70
5.3.190.0060.04412.70
5.3.180.0090.04512.70
5.3.170.0080.05312.70
5.3.160.0070.04012.70
5.3.150.0110.04112.70
5.3.140.0090.03912.68
5.3.130.0130.03412.68
5.3.120.0100.04112.68
5.3.110.0140.04312.68
5.3.100.0100.04812.16
5.3.90.0080.04012.14
5.3.80.0060.04412.14
5.3.70.0060.03912.14
5.3.60.0090.04012.12
5.3.50.0090.04112.07
5.3.40.0110.03812.07
5.3.30.0060.03612.03
5.3.20.0090.04611.81
5.3.10.0110.03611.78
5.3.00.0160.05511.77
5.2.170.0140.0379.27
5.2.160.0090.0419.28
5.2.150.0090.0429.28
5.2.140.0070.0429.27
5.2.130.0070.0399.23
5.2.120.0140.0339.23
5.2.110.0130.0349.24
5.2.100.0150.0399.23
5.2.90.0090.0459.23
5.2.80.0060.0449.23
5.2.70.0070.0429.23
5.2.60.0040.0449.18
5.2.50.0060.0439.15
5.2.40.0060.0409.13
5.2.30.0040.0459.11
5.2.20.0080.0389.10
5.2.10.0080.0378.98
5.2.00.0070.0408.84
5.1.60.0080.0368.13
5.1.50.0050.0408.12
5.1.40.0070.0368.11
5.1.30.0090.0368.46
5.1.20.0150.0328.48
5.1.10.0120.0328.20
5.1.00.0110.0368.20
5.0.50.0060.0296.69
5.0.40.0040.0276.55
5.0.30.0070.0406.36
5.0.20.0070.0296.33
5.0.10.0040.0306.30
5.0.00.0080.0396.30
4.4.90.0050.0204.78
4.4.80.0040.0204.76
4.4.70.0020.0224.76
4.4.60.0060.0184.75
4.4.50.0060.0184.77
4.4.40.0060.0304.71
4.4.30.0050.0144.76
4.4.20.0030.0164.85
4.4.10.0050.0154.85
4.4.00.0030.0274.76
4.3.110.0030.0164.67
4.3.100.0040.0144.66
4.3.90.0020.0174.64
4.3.80.0000.0274.58
4.3.70.0030.0154.63
4.3.60.0020.0154.63
4.3.50.0050.0134.63
4.3.40.0020.0254.54
4.3.30.0020.0163.30
4.3.20.0030.0163.28
4.3.10.0030.0153.24
4.3.00.0000.02039.34

preferences:
42.69 ms | 401 KiB | 5 Q