3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" pw-version="3" id="a5pzw2017004476-p1" width="523.92" height="743.4" viewBox="10.620000000000001 10.620000000000001 523.92 743.4" preserveAspectRatio="xMaxYMax"><desc>Created with Snap</desc><defs></defs><image xlink:href="/pe/temp/39599/a5pzw2017004476/images/p1bg_fb.png" preserveAspectRatio="none" x="0" y="0" width="545.16" height="764.64" id="p1bg"></image><text x="293.671875" y="167" old_offsety="118" offsety="118" ox="293.671875" oy="167" id="text001" width="201" height="140" editable="no" default-font-size="50" min-font-size="10pt" line-spacing="1" fill="#000000" font-color="#000000" style="font-size: 50px; font-family: Vagabond; text-anchor: middle; display: none;" transform="matrix(1,0,0,1,0,0)" orig-text="testing" justify="no" vertical-align="middle" pdfonly="yes"></text><g id="text001-Group" style="display: none;"><text x="393.5" y="167" id="text001-001" font-color="#000000" fill="#000000" stroke="none" style="font-size: 50px; font-family: Vagabond; text-anchor: middle; stroke-width: 1px; opacity: 1;" dy="39.5">testing</text></g><rect x="293.671875" y="118" width="201" height="140" id="text001-MoveTextSurface" fill="rgba(0,0,0,0)" style="fill-opacity: 0; stroke-width: 2; stroke-dasharray: 0, 0;" transform="matrix(1,0,0,1,0,0)"></rect><rect x="0" y="0" width="545" height="764" id="gotoEditModeLayer" fill="rgba(0,0,0,0)" remove="yes"></rect></svg> XML ); $xml->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg'); $result = $xml->xpath( "//*[@pdfonly='yes']" ); foreach ( $result as $node ) { $attribs = $node->attributes(); print_r($attribs['style']); $attribs['style'] = str_replace("display: none;","display: block;",$attribs['style']); print_r($attribs['style']); }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
SimpleXMLElement Object ( [0] => font-size: 50px; font-family: Vagabond; text-anchor: middle; display: none; ) SimpleXMLElement Object ( [0] => font-size: 50px; font-family: Vagabond; text-anchor: middle; display: block; )
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 SimpleXMLElement Object ( [0] => font-size: 50px; font-family: Vagabond; text-anchor: middle; display: none; ) SimpleXMLElement Object ( [0] => font-size: 50px; font-family: Vagabond; text-anchor: middle; display: block; )

preferences:
167.26 ms | 402 KiB | 171 Q