3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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></dsr:SalesReportToSocietyMessage><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 7.0.0 - 7.1.0
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Extra content at the end of the document in /in/WXRtZ on line 2 Warning: SimpleXMLElement::__construct(): 13-03-31</EndDate></MessageNotificationPeriod></dsr:SalesReportToSocietyMessage> in /in/WXRtZ on line 2 Warning: SimpleXMLElement::__construct(): ^ in /in/WXRtZ on line 2 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/WXRtZ:2 Stack trace: #0 /in/WXRtZ(2): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/WXRtZ on line 2
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/WXRtZ:2 Stack trace: #0 /in/WXRtZ(2): SimpleXMLElement->__construct() #1 {main} Entity: line 1: parser error : Extra content at the end of the document 13-03-31</EndDate></MessageNotificationPeriod></dsr:SalesReportToSocietyMessage> ^
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Extra content at the end of the document in /in/WXRtZ on line 2 Warning: SimpleXMLElement::__construct(): 13-03-31</EndDate></MessageNotificationPeriod></dsr:SalesReportToSocietyMessage> in /in/WXRtZ on line 2 Warning: SimpleXMLElement::__construct(): ^ in /in/WXRtZ on line 2 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/WXRtZ:2 Stack trace: #0 /in/WXRtZ(2): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/WXRtZ on line 2
Process exited with code 255.
Output for 5.0.3 - 5.0.5
Warning: Entity: line 1: parser error : Extra content at the end of the document in /in/WXRtZ on line 2 Warning: 13-03-31</EndDate></MessageNotificationPeriod></dsr:SalesReportToSocietyMessage> in /in/WXRtZ on line 2 Warning: ^ in /in/WXRtZ on line 2 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/WXRtZ:2 Stack trace: #0 /in/WXRtZ(2): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /in/WXRtZ on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Warning: Entity: line 1: parser error : Extra content at the end of the document in /in/WXRtZ on line 2 Warning: 13-03-31</EndDate></MessageNotificationPeriod></dsr:SalesReportToSocietyMessage> in /in/WXRtZ on line 2 Warning: ^ in /in/WXRtZ on line 2 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /in/WXRtZ:2 Stack trace: #0 {main} thrown in /in/WXRtZ on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/WXRtZ 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/WXRtZ on line 2