3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Adds a CDATA property to an XML document. * * @param string $name * Name of property that should contain CDATA. * @param string $value * Value that should be inserted into a CDATA child. * @param object $parent * Element that the CDATA child should be attached too. */ $add_cdata = function($name, $value, &$parent) { $child = $parent->addChild($name); if ($child !== NULL) { $child_node = dom_import_simplexml($child); $child_owner = $child_node->ownerDocument; $child_node->appendChild($child_owner->createCDATASection($value)); } return $child; }; $parent = new SimpleXMLElement('<?xml version="1.0"?><ITEM />'); $child = $add_cdata('name', 'DELL S2721DGFA 68,5cm (27") WQHD IPS', $parent); echo $parent->asXML(), "\n"; echo $child->asXML(), "\n";

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.0070.01020.41
8.5.00.0150.00620.32
8.4.150.0020.00114.05
8.4.140.0120.01017.85
8.4.130.0100.01117.83
8.4.120.0070.00120.84
8.4.110.0140.00518.98
8.4.100.0100.01117.96
8.4.90.0130.00720.98
8.4.80.0090.00919.04
8.4.70.0040.00420.86
8.4.60.0130.00720.85
8.4.50.0070.00918.87
8.4.40.0130.00624.36
8.4.30.0030.00619.23
8.4.20.0140.00719.15
8.4.10.0050.00324.04
8.3.280.0110.00918.65
8.3.270.0090.01016.88
8.3.260.0140.00616.83
8.3.250.0090.01117.06
8.3.240.0100.00916.84
8.3.230.0120.00516.75
8.3.220.0100.00620.89
8.3.210.0060.00916.76
8.3.200.0070.00216.82
8.3.190.0060.00317.46
8.3.180.0120.00719.26
8.3.170.0100.00616.74
8.3.160.0060.01317.32
8.3.150.0130.00719.30
8.3.140.0090.00619.17
8.3.130.0050.00318.52
8.3.120.0130.00618.65
8.3.110.0100.01017.04
8.3.100.0160.00318.44
8.3.90.0040.00420.48
8.3.80.0040.00818.55
8.3.70.0120.00617.00
8.3.60.0040.01118.68
8.3.50.0100.01316.64
8.3.40.0100.00322.33
8.3.30.0090.00618.97
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0040.00417.49
8.2.280.0050.00518.88
8.2.270.0100.01018.67
8.2.260.0080.00016.81
8.2.250.0080.00017.24
8.2.240.0040.00417.69
8.2.230.0030.00720.94
8.2.220.0090.00924.06
8.2.210.0030.00626.77
8.2.200.0110.00018.91
8.2.190.0110.00416.88
8.2.180.0070.01516.88
8.2.170.0130.00619.21
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00420.04
8.2.110.0060.00322.45
8.2.100.0040.00420.60
8.2.30.0020.00817.93
8.1.330.0110.00816.32
8.1.320.0090.00618.23
8.1.310.0000.00717.24
8.1.300.0060.00318.75
8.1.290.0030.00618.88
8.1.280.0200.00325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0090.00319.15
8.1.230.0030.00718.99
8.1.90.0050.00517.72
7.4.160.0060.00518.04

preferences:
32.16 ms | 403 KiB | 5 Q