3v4l.org

run code in 300+ PHP versions simultaneously
<?php function writeXML( $xml, $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( $xml, $value ); $xml->endElement( ); continue; } $xml->text( $value ); $xml->endElement( ); } else { if( is_array( $value )) { $xml->startElement( $key ); writeXML( $xml, $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( "episodeTitle" => 'test', "episodeDescription" => 'test', "pubDate" => 'test', "imdbid" => 'test', "MediaType" => "TV", "seasonNumber" => 1, "episodeNumber" => 1, "episodeImage" => array ( "url" => 'test', ), "duration" => 'test', "episodeKeywords" => "", "episodePopularity scale=" => 5, "VideoType" => "Episode", "country" => "United States", "language" => "en-us", "geoRestrictions" => 'test', //"dateAvailable" => $start_date, //"expDate" =>$end_date, "category" => 'test', "sourceID" => 'test', "streamType" => "SD", //TODO: multiple formats? "iOSAllowed" => 1, "subscription" => "yes", "price" => 0.00, "videoURL" => 'test', "showtitle" => 'test', "link" => "http://www.flixfling.com/movies/", "showdescription" => 'test', "showLogo" => array ( "url" => 'test', ), "showsourceID" => 'test', "showPubDate" => 'test', "showImdbid>" => 'test', "showCategory" => 'test', "showKeywords" => "", ); writeXML( $xml, $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)
8.5.10.0110.00720.21
8.5.00.0140.00720.66
8.4.150.0020.00014.05
8.4.140.0110.01017.92
8.4.130.0130.00719.01
8.4.120.0080.01222.24
8.4.110.0070.00318.53
8.4.100.0140.00618.25
8.4.90.0110.01020.99
8.4.80.0150.00919.31
8.4.70.0150.00622.38
8.4.60.0060.00720.95
8.4.50.0130.00818.99
8.4.40.0090.01318.04
8.4.30.0000.01218.16
8.4.20.0060.01518.21
8.4.10.0000.00918.26
8.3.280.0110.01018.86
8.3.270.0130.00917.02
8.3.260.0040.00517.10
8.3.250.0130.00616.94
8.3.240.0080.01217.28
8.3.230.0130.00616.98
8.3.220.0110.00819.10
8.3.210.0060.01017.18
8.3.200.0120.00716.98
8.3.190.0130.00717.69
8.3.180.0040.00417.09
8.3.170.0100.01017.32
8.3.160.0060.01320.46
8.3.150.0160.00318.98
8.3.140.0060.00317.35
8.3.130.0030.00618.77
8.3.120.0190.00419.24
8.3.110.0150.00720.94
8.3.100.0050.00317.01
8.3.90.0030.01317.20
8.3.80.0030.00718.68
8.3.70.0150.00617.13
8.3.60.0110.00419.05
8.3.50.0130.01022.23
8.3.40.0090.00919.18
8.3.30.0110.00419.34
8.3.20.0070.00020.45
8.3.10.0060.00320.85
8.3.00.0040.00419.63
8.2.290.0130.00718.78
8.2.280.0080.01018.69
8.2.270.0060.01317.25
8.2.260.0120.00616.93
8.2.250.0040.00417.32
8.2.240.0100.01019.19
8.2.230.0060.00322.58
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0090.00018.78
8.2.190.0120.00917.00
8.2.180.0170.00316.88
8.2.170.0120.00322.96
8.2.160.0100.00720.64
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0030.00519.75
8.2.110.0070.00319.39
8.2.100.0120.00018.47
8.2.90.0030.00519.47
8.2.80.0040.00418.00
8.2.70.0040.00418.00
8.2.60.0070.00518.30
8.2.50.0000.00818.10
8.2.40.0030.00618.28
8.2.30.0030.00618.34
8.2.20.0000.00918.08
8.2.10.0030.00518.16
8.2.00.0060.00318.07
8.1.330.0110.00918.63
8.1.320.0130.00616.34
8.1.310.0130.00618.46
8.1.300.0060.00320.36
8.1.290.0090.00018.88
8.1.280.0120.00425.92
8.1.270.0040.00420.85
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00321.43
8.1.230.0070.00417.89
8.1.220.0040.00418.00
8.1.210.0030.00618.77
8.1.200.0070.00317.73
8.1.190.0000.00817.60
8.1.180.0030.00618.10
8.1.170.0000.01118.76
8.1.160.0040.00422.22
8.1.150.0070.00419.12
8.1.140.0020.00517.86
8.1.130.0000.00718.11
8.1.120.0000.00717.75
8.1.110.0030.00617.71
8.1.100.0070.00017.82
8.1.90.0030.00517.80
8.1.80.0000.00717.71
8.1.70.0000.00717.68
8.1.60.0060.00317.89
8.1.50.0000.00817.80
8.1.40.0100.00317.89
8.1.30.0030.00617.93
8.1.20.0000.00817.93
8.1.10.0040.00417.93
8.1.00.0050.00317.71
8.0.300.0000.00718.77
8.0.290.0000.00917.13
8.0.280.0030.00318.54
8.0.270.0070.00017.30
8.0.260.0060.00017.47
8.0.250.0000.00717.27
8.0.240.0050.00317.39
8.0.230.0070.00017.29
8.0.220.0070.00017.27
8.0.210.0040.00417.23
8.0.200.0030.00317.33
8.0.190.0030.00617.26
8.0.180.0050.00317.29
8.0.170.0050.00317.22
8.0.160.0000.00717.17
8.0.150.0070.00017.18
8.0.140.0000.00717.18
8.0.130.0060.00013.62
8.0.120.0030.00617.23
8.0.110.0030.00617.31
8.0.100.0080.00017.25
8.0.90.0070.00017.16
8.0.80.0090.00917.12
8.0.70.0070.00017.38
8.0.60.0030.00517.38
8.0.50.0000.00717.36
8.0.30.0110.00817.50
8.0.20.0150.00617.54
8.0.10.0060.00317.35
8.0.00.0090.00917.13
7.4.330.0030.00315.29
7.4.320.0000.00716.90
7.4.300.0000.00616.97
7.4.290.0000.00816.94
7.4.280.0080.00316.90
7.4.270.0070.00016.89
7.4.260.0040.00416.84
7.4.250.0040.00416.85
7.4.240.0000.00716.85
7.4.230.0040.00416.84
7.4.220.0030.01417.13
7.4.210.0060.01016.69
7.4.200.0000.00716.99
7.4.150.0070.01317.40
7.4.140.0120.00517.86
7.4.130.0130.00616.83
7.4.120.0160.00416.99
7.4.110.0140.00416.91
7.4.100.0110.00716.94
7.4.90.0120.00616.80
7.4.80.0150.00619.39
7.4.70.0140.00816.90
7.4.60.0120.00616.76
7.4.50.0000.00816.76
7.4.40.0110.00716.73
7.4.30.0080.00917.04
7.4.00.0060.01315.33
7.3.330.0000.00613.70
7.3.320.0060.00013.64
7.3.310.0040.00416.72
7.3.300.0070.00016.80
7.3.290.0080.00616.68
7.3.280.0140.00516.69
7.3.270.0060.01617.40
7.3.260.0140.00416.82
7.3.250.0140.00516.78
7.3.240.0060.01216.85
7.3.230.0030.01517.01
7.3.210.0090.00916.70
7.3.200.0090.01519.39
7.3.190.0060.01116.91
7.3.180.0030.01716.92
7.3.170.0120.01116.67
7.3.160.0000.01616.93
7.3.120.0050.01415.35
7.3.110.0130.00515.27
7.3.100.0060.00715.19
7.3.90.0050.00915.25
7.3.80.0080.00815.03
7.3.70.0070.00615.16
7.3.60.0050.00515.12
7.3.50.0080.00715.08
7.3.40.0050.00915.12
7.3.30.0050.01015.20
7.3.20.0100.00716.90
7.3.10.0060.01016.97
7.3.00.0030.01217.07
7.2.330.0090.00917.09
7.2.320.0040.01617.07
7.2.310.0100.00917.09
7.2.300.0120.01416.98
7.2.290.0070.01117.09
7.2.250.0060.01315.54
7.2.240.0130.00515.39
7.2.230.0070.01015.34
7.2.220.0060.00615.42
7.2.210.0070.00915.29
7.2.200.0020.01315.18
7.2.190.0060.00815.46
7.2.180.0070.00715.47
7.2.170.0070.00515.23
7.2.160.0030.00715.37
7.2.150.0060.01017.17
7.2.140.0060.00617.40
7.2.130.0070.01117.05
7.2.120.0040.01417.42
7.2.110.0070.00717.03
7.2.100.0030.01217.32
7.2.90.0030.01017.45
7.2.80.0050.01017.15
7.2.70.0100.00317.33
7.2.60.0100.00017.12
7.2.50.0130.00317.11
7.2.40.0030.01317.15
7.2.30.0000.01317.34
7.2.20.0000.01517.19
7.2.10.0080.00417.14
7.2.00.0050.00818.50
7.1.330.0070.00715.96
7.1.320.0050.00615.97
7.1.310.0050.01116.04
7.1.300.0050.01015.81
7.1.290.0020.01215.82
7.1.280.0060.00715.89
7.1.270.0100.00416.11
7.1.260.0050.01115.84
7.1.250.0030.01315.88
7.1.200.0050.01615.34
7.1.100.0060.00618.41
7.1.70.0000.00717.47
7.1.60.0130.01319.32
7.1.50.0030.02117.22
7.1.00.0070.07022.50
7.0.200.0000.00916.83
7.0.140.0000.07722.15
7.0.60.0130.05319.99
7.0.50.0030.06317.87
7.0.40.0000.04720.46
7.0.30.0230.05720.29
7.0.20.0200.03720.17
7.0.10.0130.08320.36
7.0.00.0000.09020.32
5.6.280.0100.06721.05
5.6.210.0100.07020.82
5.6.200.0070.06718.35
5.6.190.0100.08720.59
5.6.180.0230.05020.52
5.6.170.0200.05720.61
5.6.160.0130.07720.58
5.6.150.0170.07718.36
5.6.140.0070.08318.34
5.6.130.0070.08318.28
5.6.120.0200.07021.07
5.6.110.0130.07721.11
5.6.100.0200.07021.01
5.6.90.0100.04021.05
5.6.80.0070.08320.43
5.6.70.4600.03320.54
5.5.350.0330.07020.48
5.5.340.0130.07318.16
5.5.330.0070.04320.42
5.5.320.0200.04720.58
5.5.310.0400.07720.39
5.5.300.0200.06718.09
5.5.290.0030.06318.12
5.5.280.0030.04320.86
5.5.270.0100.04720.93
5.5.260.0100.08320.96
5.5.250.0030.07720.75
5.5.240.0170.07720.32
5.4.450.0870.06319.47
5.4.440.0770.06019.67
5.4.430.0770.07019.38
5.4.420.0200.06719.60
5.4.410.0170.05719.64
5.4.400.0030.06319.21
5.4.390.0130.04719.23
5.4.380.0200.05319.13
5.4.370.0200.04319.13
5.4.360.0100.07319.19
5.4.350.0170.05319.34
5.4.340.0050.04012.11
5.4.320.0050.03812.60
5.4.310.0130.03712.59
5.4.300.0030.04112.60
5.4.290.0110.05512.59
5.4.280.0050.04412.49
5.4.270.0090.03412.49
5.4.260.0050.04112.49
5.4.250.0080.03712.49
5.4.240.0060.04212.49
5.4.230.0020.04512.48
5.4.220.0030.04012.48
5.4.210.0060.03712.48
5.4.200.0060.03812.48
5.4.190.0060.03812.48
5.4.180.0090.05512.48
5.4.170.0060.03912.49
5.4.160.0110.03912.48
5.4.150.0080.03612.48
5.4.140.0080.04112.16
5.4.130.0100.03812.15
5.4.120.0060.04112.11
5.4.110.0070.03612.11
5.4.100.0100.03412.11
5.4.90.0040.04212.10
5.4.80.0080.04112.11
5.4.70.0070.03712.10
5.4.60.0080.03812.10
5.4.50.0080.04512.10
5.4.40.0040.04812.09
5.4.30.0060.04212.09
5.4.20.0090.04012.09
5.4.10.0050.04312.08
5.4.00.0080.04011.58
5.3.290.0050.04712.86
5.3.280.0060.04312.79
5.3.270.0050.04212.80
5.3.260.0060.04712.80
5.3.250.0110.04712.80
5.3.240.0090.03812.80
5.3.230.0090.04712.79
5.3.220.0110.06512.76
5.3.210.0070.03912.76
5.3.200.0080.03612.76
5.3.190.0070.04212.77
5.3.180.0070.04212.75
5.3.170.0080.03712.75
5.3.160.0070.03912.76
5.3.150.0070.03712.76
5.3.140.0080.05112.75
5.3.130.0080.03912.75
5.3.120.0060.03812.75
5.3.110.0090.04012.74
5.3.100.0050.03912.23
5.3.90.0080.05212.20
5.3.80.0060.03912.20
5.3.70.0060.03912.20
5.3.60.0050.03812.18
5.3.50.0080.04012.13
5.3.40.0060.03612.13
5.3.30.0070.03612.10
5.3.20.0050.03811.88
5.3.10.0070.03411.84
5.3.00.0070.03811.82
5.2.170.0100.0289.33
5.2.160.0040.0339.33
5.2.150.0040.0359.33
5.2.140.0030.0349.33
5.2.130.0070.0389.29
5.2.120.0050.0299.29
5.2.110.0060.0299.29
5.2.100.0050.0299.29
5.2.90.0070.0289.29
5.2.80.0070.0329.28
5.2.70.0100.0269.29
5.2.60.0070.0309.24
5.2.50.0050.0329.21
5.2.40.0060.0289.19
5.2.30.0030.0339.16
5.2.20.0040.0319.16
5.2.10.0090.0299.07
5.2.00.0040.0298.93
5.1.60.0060.0298.21
5.1.50.0080.0348.21
5.1.40.0090.0328.19
5.1.30.0130.0498.54
5.1.20.0020.0328.57
5.1.10.0120.0288.18
5.1.00.0030.0298.18
5.0.50.0060.0216.67
5.0.40.0050.0196.53
5.0.30.0030.0376.35
5.0.20.0050.0256.32
5.0.10.0050.0196.30
5.0.00.0050.0316.29
4.4.90.0050.0174.78
4.4.80.0010.0194.75
4.4.70.0040.0164.75
4.4.60.0040.0204.76
4.4.50.0020.0314.77
4.4.40.0040.0354.71
4.4.30.0060.0224.76
4.4.20.0080.0424.84
4.4.10.0080.0434.85
4.4.00.0040.0314.76
4.3.110.0030.0204.67
4.3.100.0040.0194.66
4.3.90.0050.0174.63
4.3.80.0030.0294.58
4.3.70.0020.0234.63
4.3.60.0050.0224.63
4.3.50.0060.0224.63
4.3.40.0060.0304.54
4.3.30.0040.0213.33
4.3.20.0050.0223.30
4.3.10.0040.0173.26
4.3.00.0130.0207.62

preferences:
182.75 ms | 403 KiB | 5 Q