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>'); $licensor = $writer->xpath('//SalesReport/Licensor'); var_dump($licensor); //$licensor[0]->PartyId = trim(getPartyID($ingestion_dbc, $society_name)); //$output = $writer->asXML(); //echo $output; ?>
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
array(1) { [0]=> object(SimpleXMLElement)#2 (2) { ["PartyName"]=> object(SimpleXMLElement)#3 (1) { ["FullName"]=> string(18) "SWAPFORSOCIETYNAME" } ["PartyId"]=> string(16) "SWAPFORSOCIETYID" } }
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/fXq95 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/fXq95 on line 2

preferences:
305 ms | 401 KiB | 456 Q