3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <VehicleDescription xmlns="urn:description7b.services.chrome.com" country="US" language="en" modelYear="2008" bestMakeName="Audi" bestModelName="S4" bestStyleName="5dr Avant Wgn"> <responseStatus responseCode="Successful" description="Successful"/> <vinDescription vin="WAUUL78E38A092113" modelYear="2008" division="Audi" modelName="S4" styleName="5dr Avant Wgn" bodyType="Wagon 4 Dr." drivingWheels="AWD" builddata="no"> <WorldManufacturerIdentifier>Germany Audi Nsu</WorldManufacturerIdentifier> <restraintTypes> <group id="9">Safety</group> <header id="38">Air Bag - Frontal</header> <category id="1001">Driver Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="38">Air Bag - Frontal</header> <category id="1002">Passenger Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1005">Front Side Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1007">Front Head Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1008">Rear Head Air Bag</category> </restraintTypes> <marketClass id="53">Small Wagon</marketClass> </vinDescription> </VehicleDescription> </S:Body></S:Envelope>'; $dom = new DOMDocument(); $dom->loadXML($xml); $node = $dom->getElementsByTagName('VehicleDescription')->item(0); echo $dom->saveXml($node); // outputs xml without envelope and body echo "\n-------------------\n"; $id = $dom->getElementsByTagName('WorldManufacturerIdentifier')->item(0); echo $id->textContent;
Output for 5.6.38 - 5.6.40, 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
<VehicleDescription xmlns="urn:description7b.services.chrome.com" country="US" language="en" modelYear="2008" bestMakeName="Audi" bestModelName="S4" bestStyleName="5dr Avant Wgn"> <responseStatus responseCode="Successful" description="Successful"/> <vinDescription vin="WAUUL78E38A092113" modelYear="2008" division="Audi" modelName="S4" styleName="5dr Avant Wgn" bodyType="Wagon 4 Dr." drivingWheels="AWD" builddata="no"> <WorldManufacturerIdentifier>Germany Audi Nsu</WorldManufacturerIdentifier> <restraintTypes> <group id="9">Safety</group> <header id="38">Air Bag - Frontal</header> <category id="1001">Driver Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="38">Air Bag - Frontal</header> <category id="1002">Passenger Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1005">Front Side Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1007">Front Head Air Bag</category> </restraintTypes> <restraintTypes> <group id="9">Safety</group> <header id="39">Air Bag - Side</header> <category id="1008">Rear Head Air Bag</category> </restraintTypes> <marketClass id="53">Small Wagon</marketClass> </vinDescription> </VehicleDescription> ------------------- Germany Audi Nsu
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
192.01 ms | 409 KiB | 5 Q