3v4l.org

run code in 300+ PHP versions simultaneously
<?php function writeXML( $data ) { foreach( $data as $key => $value ) { if ( preg_match('/^(.*) (.*)=(.*)$/', $key, $matches) != false ) { $xml->startElement( $matches[1] ); $xml->writeAttribute( $matches[2], $matches[3]); if( is_array( $value )) { $writeXML( $value ); $xml->endElement( ); continue; } $xml->text( $value ); $xml->endElement( ); } else { if( is_array( $value )) { $xml->startElement( $key ); $writeXML( $value ); $xml->endElement( ); continue; } echo $key. "\n"; $xml->writeElement( $key, $value ); } } } $name = 'item'; $xml = new XmlWriter(); $xml->openMemory(); $xml->startDocument( '1.0', 'utf-8' ); $xml->startElement( $name ) $data = array( "title" => 'test', "description" => 'test description', "pubDate" => '1999', "imdbid" => "", "MediaType" => "Movie", "moviePoster" => array ( "url" => 'bad&filename.jpg', ), "studio" => 'WB', "officialRating type=mpaa" => 'PG', "duration" => 120 "movieKeywords" => "", "moviePopularity scale=" => 4, "VideoType" => "movie", "country" => "United States", "language" => "en-us", "geoRestrictions" => '', //"dateAvailable" => $start_date, //"expDate" =>$end_date, "showCategory" => 'All', "sourceID" => 2222, "streamType" => "SD", "iOSAllowed" => 0, "subscription" => "no", "price" => 0.00, "videoURL" => "http://www.flixfling.com/movies/2222", ); $writeXML($data);

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.350.0170.06019.27
5.4.340.0080.03312.03
5.4.320.0080.03412.52
5.4.310.0090.03512.52
5.4.300.0070.03512.52
5.4.290.0090.04512.52
5.4.280.0050.05312.41
5.4.270.0090.03812.41
5.4.260.0050.03812.41
5.4.250.0030.04212.41
5.4.240.0110.04412.41
5.4.230.0050.04512.41
5.4.220.0130.03512.41
5.4.210.0070.03712.41
5.4.200.0110.04212.40
5.4.190.0100.05512.40
5.4.180.0130.06112.40
5.4.170.0040.04112.41
5.4.160.0090.04112.40
5.4.150.0060.04612.39
5.4.140.0040.04012.09
5.4.130.0110.04212.07
5.4.120.0110.04512.04
5.4.110.0100.04512.03
5.4.100.0070.04412.03
5.4.90.0060.05012.03
5.4.80.0050.05412.03
5.4.70.0060.03912.03
5.4.60.0070.04412.02
5.4.50.0060.04612.03
5.4.40.0040.03712.01
5.4.30.0060.03712.01
5.4.20.0070.03412.00
5.4.10.0050.03612.01
5.4.00.0090.03311.50
5.3.290.0040.04112.80
5.3.280.0060.03912.71
5.3.270.0060.03912.72
5.3.260.0050.04012.72
5.3.250.0050.03812.72
5.3.240.0060.03712.72
5.3.230.0050.04612.70
5.3.220.0060.04312.68
5.3.210.0070.03912.68
5.3.200.0040.04312.68
5.3.190.0080.03812.68
5.3.180.0040.04012.67
5.3.170.0080.04312.67
5.3.160.0090.03312.68
5.3.150.0080.03512.67
5.3.140.0050.03712.66
5.3.130.0060.03812.66
5.3.120.0060.03812.66
5.3.110.0030.04112.66
5.3.100.0100.03512.13
5.3.90.0070.03912.11
5.3.80.0060.03812.10
5.3.70.0030.03812.10
5.3.60.0080.03412.09
5.3.50.0060.03712.04
5.3.40.0050.03712.04
5.3.30.0030.03811.99
5.3.20.0070.03511.78
5.3.10.0040.03611.73
5.3.00.0050.03711.72
5.2.170.0060.0299.23
5.2.160.0070.0279.23
5.2.150.0050.0319.23
5.2.140.0080.0319.23
5.2.130.0100.0279.19
5.2.120.0080.0289.19
5.2.110.0050.0319.19
5.2.100.0060.0369.18
5.2.90.0040.0309.18
5.2.80.0030.0329.18
5.2.70.0060.0329.18
5.2.60.0070.0279.14
5.2.50.0030.0319.11
5.2.40.0060.0289.09
5.2.30.0040.0309.05
5.2.20.0070.0279.05
5.2.10.0050.0318.95
5.2.00.0050.0338.81
5.1.60.0040.0248.11
5.1.50.0020.0278.10
5.1.40.0070.0238.07
5.1.30.0110.0268.42
5.1.20.0070.0278.45
5.1.10.0060.0318.17
5.1.00.0040.0318.18
5.0.50.0050.0246.66
5.0.40.0050.0206.52
5.0.30.0030.0326.33
5.0.20.0050.0206.30
5.0.10.0060.0246.28
5.0.00.0040.0386.27
4.4.90.0020.0234.78
4.4.80.0050.0154.76
4.4.70.0010.0194.76
4.4.60.0030.0184.75
4.4.50.0040.0184.77
4.4.40.0050.0404.71
4.4.30.0060.0204.76
4.4.20.0060.0194.84
4.4.10.0040.0234.85
4.4.00.0020.0334.76
4.3.110.0040.0234.67
4.3.100.0090.0304.66
4.3.90.0040.0224.63
4.3.80.0020.0344.58
4.3.70.0030.0204.63
4.3.60.0080.0134.62
4.3.50.0040.0204.63
4.3.40.0030.0334.53
4.3.30.0010.0193.32
4.3.20.0010.0183.29
4.3.10.0040.0153.26
4.3.00.0170.0207.62

preferences:
159.98 ms | 1394 KiB | 7 Q