3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Value = 'rId4'; $rels= new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet2.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>'); $rels->registerXPathNamespace('r', 'http://schemas.openxmlformats.org/package/2006/relationships'); $elems = $rels->xpath('/r:Relationships/r:Relationship[@Id and @Target and @Type = \'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\']'); echo get_class($elems[0]), PHP_EOL; echo get_class($elems[0]->Target), PHP_EOL; echo '1:', $elems[0]->Target, PHP_EOL; echo '2:', $elems[0]['Target'], PHP_EOL; echo get_class($elems[0]->Target[0]), PHP_EOL; echo '3:', $elems[0]->Target[0], PHP_EOL; echo '4:', $elems[0]['Target'][0], PHP_EOL; $map = []; foreach ( $elems as $elem ) { $map[$elem['Id']] = $elem['Target']; } print_r($map);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 52, Position 2 = 58
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 58
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
filename:       /in/APecv
function name:  (null)
number of ops:  63
compiled vars:  !0 = $Value, !1 = $rels, !2 = $elems, !3 = $map, !4 = $elem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'rId4'
    3     1        NEW                                              $6      'SimpleXMLElement'
          2        SEND_VAL_EX                                              '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+standalone%3D%22yes%22%3F%3E%0A%3CRelationships+xmlns%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2Fpackage%2F2006%2Frelationships%22%3E%3CRelationship+Id%3D%22rId3%22+Type%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2Ftheme%22+Target%3D%22theme%2Ftheme1.xml%22%2F%3E%3CRelationship+Id%3D%22rId2%22+Type%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2Fworksheet%22+Target%3D%22worksheets%2Fsheet2.xml%22%2F%3E%3CRelationship+Id%3D%22rId1%22+Type%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2Fworksheet%22+Target%3D%22worksheets%2Fsheet1.xml%22%2F%3E%3CRelationship+Id%3D%22rId5%22+Type%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2FsharedStrings%22+Target%3D%22sharedStrings.xml%22%2F%3E%3CRelationship+Id%3D%22rId4%22+Type%3D%22http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2Fstyles%22+Target%3D%22styles.xml%22%2F%3E%3C%2FRelationships%3E'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    6     5        INIT_METHOD_CALL                                         !1, 'registerXPathNamespace'
          6        SEND_VAL_EX                                              'r'
          7        SEND_VAL_EX                                              'http%3A%2F%2Fschemas.openxmlformats.org%2Fpackage%2F2006%2Frelationships'
          8        DO_FCALL                                      0          
    7     9        INIT_METHOD_CALL                                         !1, 'xpath'
         10        SEND_VAL_EX                                              '%2Fr%3ARelationships%2Fr%3ARelationship%5B%40Id+and+%40Target+and+%40Type+%3D+%27http%3A%2F%2Fschemas.openxmlformats.org%2FofficeDocument%2F2006%2Frelationships%2Fworksheet%27%5D'
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                                   !2, $10
    9    13        FETCH_DIM_R                                      ~12     !2, 0
         14        GET_CLASS                                        ~13     ~12
         15        ECHO                                                     ~13
         16        ECHO                                                     '%0A'
   10    17        FETCH_DIM_R                                      ~14     !2, 0
         18        FETCH_OBJ_R                                      ~15     ~14, 'Target'
         19        GET_CLASS                                        ~16     ~15
         20        ECHO                                                     ~16
         21        ECHO                                                     '%0A'
   11    22        ECHO                                                     '1%3A'
         23        FETCH_DIM_R                                      ~17     !2, 0
         24        FETCH_OBJ_R                                      ~18     ~17, 'Target'
         25        ECHO                                                     ~18
         26        ECHO                                                     '%0A'
   12    27        ECHO                                                     '2%3A'
         28        FETCH_DIM_R                                      ~19     !2, 0
         29        FETCH_DIM_R                                      ~20     ~19, 'Target'
         30        ECHO                                                     ~20
         31        ECHO                                                     '%0A'
   13    32        FETCH_DIM_R                                      ~21     !2, 0
         33        FETCH_OBJ_R                                      ~22     ~21, 'Target'
         34        FETCH_DIM_R                                      ~23     ~22, 0
         35        GET_CLASS                                        ~24     ~23
         36        ECHO                                                     ~24
         37        ECHO                                                     '%0A'
   14    38        ECHO                                                     '3%3A'
         39        FETCH_DIM_R                                      ~25     !2, 0
         40        FETCH_OBJ_R                                      ~26     ~25, 'Target'
         41        FETCH_DIM_R                                      ~27     ~26, 0
         42        ECHO                                                     ~27
         43        ECHO                                                     '%0A'
   15    44        ECHO                                                     '4%3A'
         45        FETCH_DIM_R                                      ~28     !2, 0
         46        FETCH_DIM_R                                      ~29     ~28, 'Target'
         47        FETCH_DIM_R                                      ~30     ~29, 0
         48        ECHO                                                     ~30
         49        ECHO                                                     '%0A'
   17    50        ASSIGN                                                   !3, <array>
   18    51      > FE_RESET_R                                       $32     !2, ->58
         52    > > FE_FETCH_R                                               $32, !4, ->58
   20    53    >   FETCH_DIM_R                                      ~33     !4, 'Id'
         54        FETCH_DIM_R                                      ~35     !4, 'Target'
         55        ASSIGN_DIM                                               !3, ~33
         56        OP_DATA                                                  ~35
   18    57      > JMP                                                      ->52
         58    >   FE_FREE                                                  $32
   23    59        INIT_FCALL                                               'print_r'
         60        SEND_VAR                                                 !3
         61        DO_ICALL                                                 
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.5 ms | 1400 KiB | 15 Q