3v4l.org

run code in 300+ PHP versions simultaneously
<?php class xml { var $parser; function __construct() { $this->parser = xml_parser_create(); xml_set_object($this->parser, $this); } function parse($data) { xml_parse($this->parser, $data); } function free(){ xml_parser_free($this->parser); //unset($this->parser); } } $xml_test = '<?xml version="1.0" encoding="utf-8"?><test></test>'; for ($i = 0; $i < 100; $i++) { $xml_parser = new xml(); $xml_parser->parse($xml_test); $xml_parser->free(); unset($xml_parser); gc_collect_cycles(); echo memory_get_usage(), PHP_EOL; }

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)
7.2.00.0040.01420.45
7.1.70.0030.00518.43
7.1.60.0060.00619.75
7.1.50.0110.00718.05
7.1.00.0030.08023.61
7.0.200.0230.00816.21
7.0.90.0170.06721.24
7.0.80.0300.06721.41
7.0.70.0170.05720.11
7.0.60.0100.06720.04
7.0.50.0130.06020.51
7.0.40.0200.09320.41
7.0.30.0300.07020.51
7.0.20.0100.06720.43
7.0.10.0630.05320.42
7.0.00.0430.09720.38
5.6.240.0170.09720.86
5.6.230.0130.07320.85
5.6.220.0130.06020.82
5.6.210.0170.09320.75
5.6.200.0070.07321.19
5.6.190.0330.07021.20
5.6.180.0100.07021.13
5.6.170.0200.05321.13
5.6.160.0130.06321.28
5.6.150.0230.06021.17
5.6.140.0230.08021.16
5.6.130.0130.09021.21
5.6.120.0070.07321.30
5.6.110.0100.09321.27
5.6.100.0200.05321.21
5.6.90.0100.09321.23
5.6.80.0070.07020.61
5.6.70.0100.07320.53
5.6.60.0070.06720.57
5.6.50.0070.06720.51
5.6.40.0130.08720.46
5.6.30.0170.07720.52
5.6.20.0170.05320.46
5.6.10.0030.06720.53
5.6.00.0270.07720.46

preferences:
15.14 ms | 403 KiB | 5 Q