3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadXML('<root><label>text content</label></root>'); $xpath = new DOMXPath($doc); $labelElement = $doc->getElementsByTagName('label')->item(0); var_dump($xpath->evaluate('count(//label[text() = "text content"])')); $expectedElmt = $doc->createElement('label', 'text content'); var_dump($expectedElement->tagName);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iQubg
function name:  (null)
number of ops:  33
compiled vars:  !0 = $doc, !1 = $xpath, !2 = $labelElement, !3 = $expectedElmt, !4 = $expectedElement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    4     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Croot%3E%3Clabel%3Etext+content%3C%2Flabel%3E%3C%2Froot%3E'
          5        DO_FCALL                                      0          
    6     6        NEW                                              $9      'DOMXPath'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $9
    8    10        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
         11        SEND_VAL_EX                                              'label'
         12        DO_FCALL                                      0  $12     
         13        INIT_METHOD_CALL                                         $12, 'item'
         14        SEND_VAL_EX                                              0
         15        DO_FCALL                                      0  $13     
         16        ASSIGN                                                   !2, $13
   10    17        INIT_FCALL                                               'var_dump'
         18        INIT_METHOD_CALL                                         !1, 'evaluate'
         19        SEND_VAL_EX                                              'count%28%2F%2Flabel%5Btext%28%29+%3D+%22text+content%22%5D%29'
         20        DO_FCALL                                      0  $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                                 
   12    23        INIT_METHOD_CALL                                         !0, 'createElement'
         24        SEND_VAL_EX                                              'label'
         25        SEND_VAL_EX                                              'text+content'
         26        DO_FCALL                                      0  $17     
         27        ASSIGN                                                   !3, $17
   14    28        INIT_FCALL                                               'var_dump'
         29        FETCH_OBJ_R                                      ~19     !4, 'tagName'
         30        SEND_VAL                                                 ~19
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.99 ms | 1396 KiB | 15 Q