3v4l.org

run code in 300+ PHP versions simultaneously
<?php $writer = new SimpleXMLElement('<?xml version="1.0"?><dsr:SalesReportToSocietyMessage xmlns:dsr="http://ddex.net/xml/2010/dsr-main/32" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MessageSchemaVersionId="2010/dsr-main/32" xsi:schemaLocation="http://ddex.net/xml/2010/dsr-main/32 http://ddex.net/xml/2010/dsr-main/32/dsr-main.xsd"><MessageHeader><MessageThreadId>0000000024</MessageThreadId><MessageId>000000002401</MessageId><MessageSender><PartyId>PADPIDA2010071901R</PartyId><PartyName><FullName>RHAPSODY INTERNATIONAL, INC.</FullName></PartyName><TradingName>Premier Extra</TradingName></MessageSender><MessageRecipient><PartyId>SWAPFORSOCIETYID</PartyId><PartyName><FullName>SWAPFORSOCIETYNAME</FullName></PartyName></MessageRecipient><MessageCreatedDateTime>2014-06-30T14:14:29</MessageCreatedDateTime></MessageHeader><MessageNotificationPeriod><StartDate>2013-01-01</StartDate><EndDate>2013-03-31</EndDate></MessageNotificationPeriod><ContainedResourceList><SoundRecording><SoundRecordingId><ISRC>GBAYE0501671</ISRC><ProprietaryId Namespace="DspResourceID">10116839</ProprietaryId></SoundRecordingId><IndirectSoundRecordingId><ISWC></ISWC></IndirectSoundRecordingId><ResourceReference>A00000001</ResourceReference><ReferenceTitle><TitleText>Put Your Records On (Radio Single)</TitleText></ReferenceTitle><Duration>PT0H03M33S</Duration><SoundRecordingDetailsByTerritory><TerritoryCode>Worldwide</TerritoryCode><Title><TitleText>Put Your Records On (Radio Single)</TitleText></Title><DisplayArtist><PartyName><FullName>Corinne Bailey Rae</FullName></PartyName><ArtistRole>FeaturedArtist</ArtistRole></DisplayArtist><IndirectResourceContributor><PartyName><FullName></FullName></PartyName><IndirectResourceContributorRole>Composer</IndirectResourceContributorRole></IndirectResourceContributor></SoundRecordingDetailsByTerritory></SoundRecording></ContainedResourceList><ContainedReleaseList><Release><ReleaseId><ProprietaryId Namespace="DspReleaseID">10116839</ProprietaryId></ReleaseId><ReferenceTitle><TitleText>Put Your Records On (Radio Single)</TitleText></ReferenceTitle><ReleaseResourceReferenceList><ReleaseResourceReference>A00000001</ReleaseResourceReference></ReleaseResourceReferenceList><ReleaseType>TrackRelease</ReleaseType><ReleaseDetailsByTerritory><TerritoryCode>Worldwide</TerritoryCode><DisplayArtist><PartyName><FullName>Corinne Bailey Rae</FullName></PartyName></DisplayArtist></ReleaseDetailsByTerritory></Release><Release><ReleaseId><ProprietaryId Namespace="DspReleaseID">10121948</ProprietaryId></ReleaseId><ReferenceTitle><TitleText>Under The Bridge</TitleText></ReferenceTitle><ReleaseResourceReferenceList><ReleaseResourceReference>A00000002</ReleaseResourceReference></ReleaseResourceReferenceList><ReleaseType>TrackRelease</ReleaseType><ReleaseDetailsByTerritory><TerritoryCode>Worldwide</TerritoryCode><DisplayArtist><PartyName><FullName>Red Hot Chili Peppers</FullName></PartyName></DisplayArtist></ReleaseDetailsByTerritory></Release></ContainedReleaseList><SalesReport><DSP><PartyName><FullName>RHAPSODY INTERNATIONAL, INC.</FullName></PartyName><PartyId>PADPIDA2010071901R</PartyId></DSP><Licensor><PartyName><FullName>SWAPFORSOCIETYNAME</FullName></PartyName><PartyId>SWAPFORSOCIETYID</PartyId></Licensor><SalesByCommercialModel><CommercialModelType>SubscriptionModel</CommercialModelType><CurrencyOfAccounting>SWAPFORCURRENCY</CurrencyOfAccounting><SalesByTerritory><TerritoryCode>PT</TerritoryCode><ReleaseTransactions><ReleaseId><ProprietaryId Namespace="DspReleaseID">10116839</ProprietaryId></ReleaseId><SalesTransaction><UseType>OnDemandStream</UseType><DistributionChannelType>InternetAndMobile</DistributionChannelType><SalesData><NumberOfConsumerSalesGross>1</NumberOfConsumerSalesGross><NumberOfFreeUnitsToConsumers>0</NumberOfFreeUnitsToConsumers><PriceConsumerPaidExcSalesTax>000000000.00</PriceConsumerPaidExcSalesTax></SalesData></SalesTransaction></ReleaseTransactions><ReleaseTransactions><ReleaseId><ProprietaryId Namespace="DspReleaseID">10121948</ProprietaryId></ReleaseId><SalesTransaction><UseType>OnDemandStream</UseType><DistributionChannelType>InternetAndMobile</DistributionChannelType><SalesData><NumberOfConsumerSalesGross>1</NumberOfConsumerSalesGross><NumberOfFreeUnitsToConsumers>0</NumberOfFreeUnitsToConsumers><PriceConsumerPaidExcSalesTax>000000000.00</PriceConsumerPaidExcSalesTax></SalesData></SalesTransaction></ReleaseTransactions><ReleaseTransactions><ReleaseId><ProprietaryId Namespace="DspReleaseID">101925613</ProprietaryId></ReleaseId><SalesTransaction><UseType>OnDemandStream</UseType><DistributionChannelType>InternetAndMobile</DistributionChannelType><SalesData><NumberOfConsumerSalesGross>1</NumberOfConsumerSalesGross><NumberOfFreeUnitsToConsumers>0</NumberOfFreeUnitsToConsumers><PriceConsumerPaidExcSalesTax>000000000.00</PriceConsumerPaidExcSalesTax></SalesData></SalesTransaction></ReleaseTransactions><ReleaseTransactions><ReleaseId><ProprietaryId Namespace="DspReleaseID">10269415</ProprietaryId></ReleaseId><SalesTransaction><UseType>OnDemandStream</UseType><DistributionChannelType>InternetAndMobile</DistributionChannelType><SalesData><NumberOfConsumerSalesGross>2</NumberOfConsumerSalesGross><NumberOfFreeUnitsToConsumers>0</NumberOfFreeUnitsToConsumers><PriceConsumerPaidExcSalesTax>000000000.00</PriceConsumerPaidExcSalesTax></SalesData></SalesTransaction></ReleaseTransactions><ReleaseTransactions><ReleaseId><ProprietaryId Namespace="DspReleaseID">10269417</ProprietaryId></ReleaseId><SalesTransaction><UseType>OnDemandStream</UseType><DistributionChannelType>InternetAndMobile</DistributionChannelType><SalesData><NumberOfConsumerSalesGross>3</NumberOfConsumerSalesGross><NumberOfFreeUnitsToConsumers>0</NumberOfFreeUnitsToConsumers><PriceConsumerPaidExcSalesTax>000000000.00</PriceConsumerPaidExcSalesTax></SalesData></SalesTransaction></ReleaseTransactions><NumberOfSubscribers><Quantity>SWAPFORSOCIETYSUBSCRIBERCOUNT</Quantity><UseType>OnDemandStream</UseType></NumberOfSubscribers><DspNetRevenue><Amount>SWAPFORSOCIETYAMOUNT</Amount><UseType>OnDemandStream</UseType></DspNetRevenue></SalesByTerritory></SalesByCommercialModel></SalesReport><NumberOfSalesTransactionRecords>3448</NumberOfSalesTransactionRecords></dsr:SalesReportToSocietyMessage>'); $numberofsubscribers = $writer->xpath('//SalesReport/SalesByCommercialModel/SalesByTerritory/DspNetRevenue'); $numberofsubscribers[0]->Quantity = '169.10'; var_dump($numberofsubscribers); //$output = $writer->asXML(); //echo $output; ?>
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> object(SimpleXMLElement)#2 (3) { ["Amount"]=> string(20) "SWAPFORSOCIETYAMOUNT" ["UseType"]=> string(14) "OnDemandStream" ["Quantity"]=> string(6) "169.10" } }

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:
47.31 ms | 401 KiB | 8 Q