3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testParser { /** @var resource */ private $parser; /** * @param string $encoding */ public function __construct($encoding = 'UTF-8') { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; $parser = new ParserObject($encoding); $this->parser = $parser->getParser(); xml_set_character_data_handler($this->parser, [$this, 'data']); echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; } public function parseAction($data) { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; return xml_parse($this->parser, $data); } public function data($parser, $cdata) { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; } } class ParserObject { /** @var resource */ private $xml_parser_resource; public function __construct($encoding) { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; $this->xml_parser_resource = xml_parser_create($encoding); } public function getParser() { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; return $this->xml_parser_resource; } public function __destruct() { echo __CLASS__ . ' ' . __METHOD__ . ' ' . __LINE__ . "<br>"; xml_parser_free($this->xml_parser_resource); } } $content = '<?xml version="1.0" ?><note><body>Do</body></note>'; echo __LINE__ . "<br>"; $parser = new testParser(); echo __LINE__ . "<br>"; $parser->parseAction($content); echo __LINE__ . "<br>";

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.0060.01216.88
8.3.50.0170.00621.26
8.3.40.0090.00619.04
8.3.30.0110.00419.02
8.3.20.0040.00420.41
8.3.10.0040.00422.01
8.3.00.0000.00819.81
8.2.180.0030.01216.63
8.2.170.0090.00622.96
8.2.160.0120.00320.64
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00317.88
8.2.110.0090.00022.33
8.2.100.0110.00017.88
8.2.90.0030.00519.61
8.2.80.0000.00817.97
8.2.70.0060.00317.88
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0000.00719.52
8.2.30.0030.00520.03
8.2.20.0040.00418.02
8.2.10.0070.00018.26
8.2.00.0070.00418.29
8.1.280.0110.00425.92
8.1.270.0000.00920.49
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0040.00722.60
8.1.230.0090.00317.73
8.1.220.0050.00318.03
8.1.210.0030.00618.77
8.1.200.0000.01117.60
8.1.190.0030.00617.47
8.1.180.0040.00418.10
8.1.170.0060.00318.77
8.1.160.0000.00824.00
8.1.150.0040.00419.05
8.1.140.0030.00817.70
8.1.130.0000.00917.87
8.1.120.0030.00717.54
8.1.110.0000.00817.67
8.1.100.0050.00317.63
8.1.90.0040.00417.70
8.1.80.0040.00417.64
8.1.70.0000.00717.66
8.1.60.0000.00917.78
8.1.50.0040.00417.81
8.1.40.0040.00417.68
8.1.30.0030.00617.84
8.1.20.0060.00317.86
8.1.10.0040.00417.87
8.1.00.0040.00417.81
8.0.300.0090.00018.77
8.0.290.0040.00416.72
8.0.280.0030.00318.63
8.0.270.0000.00717.45
8.0.260.0060.00017.44
8.0.250.0040.00417.19
8.0.240.0000.00717.23
8.0.230.0000.00717.06
8.0.220.0030.00316.97
8.0.210.0040.00417.10
8.0.200.0070.00017.23
8.0.190.0040.00417.16
8.0.180.0060.00317.11
8.0.170.0040.00417.09
8.0.160.0000.00717.05
8.0.150.0030.00317.11
8.0.140.0050.00316.98
8.0.130.0030.00313.54
8.0.120.0040.00417.10
8.0.110.0040.00417.05
8.0.100.0040.00416.93
8.0.90.0050.00217.15
8.0.80.0090.01317.08
8.0.70.0040.00417.09
8.0.60.0080.00017.20
8.0.50.0000.00716.94
8.0.30.0090.00817.36
8.0.20.0080.01217.40
8.0.10.0030.00517.25
8.0.00.0090.00916.97
7.4.330.0000.00515.08
7.4.320.0060.00016.71
7.4.300.0000.00616.54
7.4.290.0000.00716.63
7.4.280.0040.00716.67
7.4.270.0000.00816.49
7.4.260.0000.00816.56
7.4.250.0030.00316.49
7.4.240.0020.00616.61
7.4.230.0030.00316.52
7.4.220.0040.01416.52
7.4.210.0090.00916.69
7.4.200.0040.00416.70
7.4.160.0160.00616.68
7.4.150.0110.00617.40
7.4.140.0120.01017.86
7.4.130.0110.00716.70
7.4.120.0140.00416.70
7.4.110.0110.00716.66
7.4.100.0030.01416.68
7.4.90.0080.00916.76
7.4.80.0070.01419.39
7.4.70.0140.00316.77
7.4.60.0090.00916.53
7.4.50.0000.00516.59
7.4.40.0080.01216.64
7.4.30.0070.01116.91
7.4.10.0100.00715.29
7.4.00.0110.00515.13
7.3.330.0060.00013.42
7.3.320.0030.00313.25
7.3.310.0000.00716.50
7.3.300.0040.00416.41
7.3.290.0030.00316.42
7.3.280.0100.00716.41
7.3.270.0100.00717.40
7.3.260.0140.00316.53
7.3.250.0070.01016.60
7.3.240.0090.00916.36
7.3.230.0080.01016.59
7.3.210.0140.00316.45
7.3.200.0070.01016.62
7.3.190.0100.00716.62
7.3.180.0100.00616.58
7.3.170.0080.00816.56
7.3.160.0070.01116.46
7.3.130.0090.00914.71
7.3.120.0110.00014.80
7.3.110.0120.00314.61
7.3.100.0090.00914.73
7.3.90.0060.00914.90
7.3.80.0070.00714.79
7.3.70.0000.01114.71
7.3.60.0080.00814.84
7.3.50.0060.01014.92
7.3.40.0090.00515.09
7.3.30.0070.00314.73
7.3.20.0110.00416.61
7.3.10.0030.00616.69
7.3.00.0100.00316.80
7.2.330.0110.00816.95
7.2.320.0060.01116.83
7.2.310.0000.01516.58
7.2.300.0120.00416.93
7.2.290.0120.01216.92
7.2.260.0090.00315.11
7.2.250.0030.00815.16
7.2.240.0070.01015.39
7.2.230.0070.01015.32
7.2.220.0090.00914.86
7.2.210.0060.00615.26
7.2.200.0030.00915.06
7.2.190.0070.00715.15
7.2.180.0090.00615.14
7.2.170.0000.01214.96
7.2.160.0030.01215.45
7.2.150.0060.00316.71
7.2.140.0090.00616.90
7.2.130.0060.00817.21
7.2.120.0100.00016.89
7.2.110.0030.00916.98
7.2.100.0100.00316.94
7.2.90.0100.01017.07
7.2.80.0040.01116.74
7.2.70.0040.01517.17
7.2.60.0070.00516.94
7.2.50.0030.01016.98
7.2.40.0030.01217.18
7.2.30.0040.00717.04
7.2.20.0070.00716.82
7.2.10.0110.00317.02
7.2.00.0180.00817.94
7.1.330.0030.01015.70
7.1.320.0030.01415.65
7.1.310.0040.00815.79
7.1.300.0040.01115.85
7.1.290.0070.00415.56
7.1.280.0060.01016.01
7.1.270.0030.01015.58
7.1.260.0060.00615.75
7.1.250.0060.00315.89
7.1.240.0030.01015.91
7.1.230.0040.00415.68
7.1.220.0000.01415.62
7.1.210.0100.00315.75
7.1.200.0050.00515.77
7.1.190.0090.00615.77
7.1.180.0070.00715.69
7.1.170.0060.00315.58
7.1.160.0080.00815.78
7.1.150.0000.01115.66
7.1.140.0110.00315.96
7.1.130.0060.00615.68
7.1.120.0000.00815.99
7.1.110.0140.00015.91
7.1.100.0110.00317.10
7.1.90.0070.01015.86
7.1.80.0100.00315.88
7.1.70.0040.00616.38
7.1.60.0060.01217.32
7.1.50.0120.01425.32
7.1.40.0070.00715.56
7.1.30.0030.00915.69
7.1.20.0100.00715.51
7.1.10.0100.00315.71
7.1.00.0030.04219.20
7.0.330.0050.00815.60
7.0.320.0100.00315.43
7.0.310.0060.00315.45
7.0.300.0030.00615.46
7.0.290.0040.01115.63
7.0.280.0060.00315.57
7.0.270.0070.00315.36
7.0.260.0030.00915.31
7.0.250.0000.00815.49
7.0.240.0000.01315.67
7.0.230.0090.00315.53
7.0.220.0080.00015.71
7.0.210.0040.00815.46
7.0.200.0040.00716.27
7.0.190.0030.00615.41
7.0.180.0110.00015.25
7.0.170.0030.00915.61
7.0.160.0070.00715.57
7.0.150.0070.00315.61
7.0.140.0060.00915.56
7.0.130.0000.01315.57
7.0.120.0040.00815.43
7.0.110.0040.00915.47
7.0.100.0000.00815.43
7.0.90.0040.01015.52
7.0.80.0070.00715.49
7.0.70.0060.00815.14
7.0.60.0020.02617.71
7.0.50.0090.03416.70
7.0.40.0080.04316.80
7.0.30.0230.04016.85
7.0.20.0200.04016.85
7.0.10.0070.03516.82
7.0.00.0100.02516.92
5.6.400.0140.00014.50
5.6.390.0070.00714.06
5.6.380.0030.01614.56
5.6.370.0030.01414.54
5.6.360.0000.01514.35
5.6.350.0070.00714.74
5.6.340.0030.00614.70
5.6.330.0060.00614.13
5.6.320.0060.00614.30
5.6.310.0070.00714.33
5.6.300.0060.00914.33
5.6.290.0060.00914.32
5.6.280.0050.04017.63
5.6.270.0120.00314.52
5.6.260.0070.01014.29
5.6.250.0060.00914.14
5.6.240.0090.00014.64
5.6.230.0060.00914.54
5.6.220.0100.00614.34
5.6.210.0070.03017.46
5.6.200.0070.04716.21
5.6.190.0040.04717.47
5.6.180.0020.02717.46
5.6.170.0070.03017.53
5.6.160.0090.03117.53
5.6.150.0050.04716.44
5.6.140.0070.04216.35
5.6.130.0060.02016.28
5.6.120.0070.04417.76
5.6.110.0050.04017.75
5.6.100.0070.04317.85
5.6.90.0060.02317.77
5.6.80.0100.04317.30
5.6.70.0060.00614.40
5.6.60.0110.00314.26
5.6.50.0040.01414.26
5.6.40.0090.00914.30
5.6.30.0040.00914.04
5.6.20.0000.01314.36
5.6.10.0130.00314.19
5.6.00.0060.00614.30
5.5.380.0040.00814.53
5.5.370.0100.00314.07
5.5.360.0090.00614.28
5.5.350.0130.04217.48
5.5.340.0080.02116.23
5.5.330.0030.05017.36
5.5.320.0080.03117.31
5.5.310.0100.02517.40
5.5.300.0070.04316.27
5.5.290.0090.04016.20
5.5.280.0020.04617.69
5.5.270.0050.03217.72
5.5.260.0050.03617.79
5.5.250.0070.04317.46
5.5.240.0080.02817.36
5.5.230.0040.00714.21
5.5.220.0090.00414.14
5.5.210.0060.00914.54
5.5.200.0080.01114.14
5.5.190.0040.00714.15
5.5.180.0060.00913.89
5.5.170.0000.01214.39
5.5.160.0070.00714.23
5.5.150.0090.00914.33
5.5.140.0100.00314.31
5.5.130.0090.00314.17
5.5.120.0060.00614.01
5.5.110.0110.00014.14
5.5.100.0000.01214.38
5.5.90.0050.00514.22
5.5.80.0040.01114.37
5.5.70.0000.01714.43
5.5.60.0060.00314.20
5.5.50.0090.00614.42
5.5.40.0040.01114.40
5.5.30.0060.01214.41
5.5.20.0100.00714.35
5.5.10.0030.00614.36
5.5.00.0030.00614.14
5.4.450.0480.03415.49
5.4.440.0490.02915.46
5.4.430.0530.02315.29
5.4.420.0490.03115.48
5.4.410.0550.02515.31
5.4.400.0380.03015.15
5.4.390.0400.02815.02
5.4.380.0420.02715.10
5.4.370.0540.02915.20
5.4.360.0460.03515.17
5.4.350.0570.02514.97
5.4.340.0470.03415.12
5.4.330.0090.00311.15
5.4.320.0530.02815.15
5.4.310.0380.02815.07
5.4.300.0430.02515.13
5.4.290.0420.02515.18
5.4.280.0530.03014.87
5.4.270.0430.02615.19
5.4.260.0380.02515.15
5.4.250.0370.02815.20
5.4.240.0390.02815.39
5.4.230.0380.02715.18
5.4.220.0380.02815.18
5.4.210.0470.02215.10
5.4.200.0410.02615.29
5.4.190.0380.03014.96
5.4.180.0440.02615.11
5.4.170.0430.02915.29
5.4.160.0380.02915.10
5.4.150.0380.03015.12
5.4.140.0500.03013.85
5.4.130.0330.03413.86
5.4.120.0380.03213.85
5.4.110.0410.02813.85
5.4.100.0400.02813.94
5.4.90.0380.03113.86
5.4.80.0500.02813.63
5.4.70.0150.03613.61
5.4.60.0320.03213.88
5.4.50.0030.03513.87
5.4.40.0050.04013.76
5.4.30.0040.03813.66
5.4.20.0080.02513.76
5.4.10.0080.00311.09
5.4.00.0000.00611.25

preferences:
50.51 ms | 401 KiB | 5 Q