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); $attribs['style'] = str_replace("display: none;","display: block;",$attribs['style']); print_r($attribs['style']); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 33
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 33
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/gXSoH
function name:  (null)
number of ops:  35
compiled vars:  !0 = $xml, !1 = $result, !2 = $node, !3 = $attribs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_string'
    3     1        SEND_VAL                                                 '%3Csvg+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22+xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22+version%3D%221.1%22+pw-version%3D%223%22+id%3D%22a5pzw2017004476-p1%22+width%3D%22523.92%22+height%3D%22743.4%22+viewBox%3D%2210.620000000000001+10.620000000000001+523.92+743.4%22+preserveAspectRatio%3D%22xMaxYMax%22%3E%3Cdesc%3ECreated+with+Snap%3C%2Fdesc%3E%3Cdefs%3E%3C%2Fdefs%3E%3Cimage+xlink%3Ahref%3D%22%2Fpe%2Ftemp%2F39599%2Fa5pzw2017004476%2Fimages%2Fp1bg_fb.png%22+preserveAspectRatio%3D%22none%22+x%3D%220%22+y%3D%220%22+width%3D%22545.16%22+height%3D%22764.64%22+id%3D%22p1bg%22%3E%3C%2Fimage%3E%3Ctext+x%3D%22293.671875%22+y%3D%22167%22+old_offsety%3D%22118%22+offsety%3D%22118%22+ox%3D%22293.671875%22+oy%3D%22167%22+id%3D%22text001%22+width%3D%22201%22+height%3D%22140%22+editable%3D%22no%22+default-font-size%3D%2250%22+min-font-size%3D%2210pt%22+line-spacing%3D%221%22+fill%3D%22%23000000%22+font-color%3D%22%23000000%22+style%3D%22font-size%3A+50px%3B+font-family%3A+Vagabond%3B+text-anchor%3A+middle%3B+display%3A+none%3B%22+transform%3D%22matrix%281%2C0%2C0%2C1%2C0%2C0%29%22+orig-text%3D%22testing%22+justify%3D%22no%22+vertical-align%3D%22middle%22+pdfonly%3D%22yes%22%3E%3C%2Ftext%3E%3Cg+id%3D%22text001-Group%22+style%3D%22display%3A+none%3B%22%3E%3Ctext+x%3D%22393.5%22+y%3D%22167%22+id%3D%22text001-001%22+font-color%3D%22%23000000%22+fill%3D%22%23000000%22+stroke%3D%22none%22+style%3D%22font-size%3A+50px%3B+font-family%3A+Vagabond%3B+text-anchor%3A+middle%3B+stroke-width%3A+1px%3B+opacity%3A+1%3B%22+dy%3D%2239.5%22%3Etesting%3C%2Ftext%3E%3C%2Fg%3E%3Crect+x%3D%22293.671875%22+y%3D%22118%22+width%3D%22201%22+height%3D%22140%22+id%3D%22text001-MoveTextSurface%22+fill%3D%22rgba%280%2C0%2C0%2C0%29%22+style%3D%22fill-opacity%3A+0%3B+stroke-width%3A+2%3B+stroke-dasharray%3A+0%2C+0%3B%22+transform%3D%22matrix%281%2C0%2C0%2C1%2C0%2C0%29%22%3E%3C%2Frect%3E%3Crect+x%3D%220%22+y%3D%220%22+width%3D%22545%22+height%3D%22764%22+id%3D%22gotoEditModeLayer%22+fill%3D%22rgba%280%2C0%2C0%2C0%29%22+remove%3D%22yes%22%3E%3C%2Frect%3E%3C%2Fsvg%3E'
          2        DO_ICALL                                         $4      
    2     3        ASSIGN                                                   !0, $4
    6     4        INIT_METHOD_CALL                                         !0, 'registerXPathNamespace'
          5        SEND_VAL_EX                                              'svg'
          6        SEND_VAL_EX                                              'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'
          7        DO_FCALL                                      0          
    8     8        INIT_METHOD_CALL                                         !0, 'xpath'
          9        SEND_VAL_EX                                              '%2F%2F%2A%5B%40pdfonly%3D%27yes%27%5D'
         10        DO_FCALL                                      0  $7      
         11        ASSIGN                                                   !1, $7
    9    12      > FE_RESET_R                                       $9      !1, ->33
         13    > > FE_FETCH_R                                               $9, !2, ->33
   10    14    >   INIT_METHOD_CALL                                         !2, 'attributes'
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !3, $10
   11    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
   12    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 'display%3A+none%3B'
         22        SEND_VAL                                                 'display%3A+block%3B'
         23        FETCH_DIM_R                                      ~14     !3, 'style'
         24        SEND_VAL                                                 ~14
         25        DO_ICALL                                         $15     
         26        ASSIGN_DIM                                               !3, 'style'
         27        OP_DATA                                                  $15
   13    28        INIT_FCALL                                               'print_r'
         29        FETCH_DIM_R                                      ~16     !3, 'style'
         30        SEND_VAL                                                 ~16
         31        DO_ICALL                                                 
    9    32      > JMP                                                      ->13
         33    >   FE_FREE                                                  $9
   15    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
202.37 ms | 1400 KiB | 19 Q