3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><paymentresponse><merchant><merchantid>1000001</merchantid><accountid>2000034</accountid></merchant><transaction><merchantref>yAq3ueCIDG1u3Q9Y2Tfs</merchantref><amount>1000</amount><currency>USD</currency><transactiontype>ECOMMERCE</transactiontype></transaction><status><code>SUCCESS</code><message>Operation successful</message><timestamp>2012-07-24T13:48:05+01:00</timestamp></status></paymentresponse>'; $data = (array) simplexml_load_string($xml); var_dump($data); var_dump(json_decode(json_encode($data),1));
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["merchant"]=> object(SimpleXMLElement)#2 (2) { ["merchantid"]=> string(7) "1000001" ["accountid"]=> string(7) "2000034" } ["transaction"]=> object(SimpleXMLElement)#3 (4) { ["merchantref"]=> string(20) "yAq3ueCIDG1u3Q9Y2Tfs" ["amount"]=> string(4) "1000" ["currency"]=> string(3) "USD" ["transactiontype"]=> string(9) "ECOMMERCE" } ["status"]=> object(SimpleXMLElement)#4 (3) { ["code"]=> string(7) "SUCCESS" ["message"]=> string(20) "Operation successful" ["timestamp"]=> string(25) "2012-07-24T13:48:05+01:00" } } array(3) { ["merchant"]=> array(2) { ["merchantid"]=> string(7) "1000001" ["accountid"]=> string(7) "2000034" } ["transaction"]=> array(4) { ["merchantref"]=> string(20) "yAq3ueCIDG1u3Q9Y2Tfs" ["amount"]=> string(4) "1000" ["currency"]=> string(3) "USD" ["transactiontype"]=> string(9) "ECOMMERCE" } ["status"]=> array(3) { ["code"]=> string(7) "SUCCESS" ["message"]=> string(20) "Operation successful" ["timestamp"]=> string(25) "2012-07-24T13:48:05+01:00" } }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.43 ms | 404 KiB | 8 Q