3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "<link rel='stylesheet' href='http://www.foo.com/bar/baz.min.css' type='text/css' id='23434' foo='bar' media='all'/>"; $dom = new DOMDocument(); $dom->loadHTML($html); $link = $dom->getElementById('23434'); $link->setAttribute('foo', 'test'); echo $dom->saveHTML($dom->documentElement); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dkN1e
function name:  (null)
number of ops:  22
compiled vars:  !0 = $html, !1 = $dom, !2 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Clink+rel%3D%27stylesheet%27+href%3D%27http%3A%2F%2Fwww.foo.com%2Fbar%2Fbaz.min.css%27+type%3D%27text%2Fcss%27+id%3D%2723434%27+foo%3D%27bar%27+media%3D%27all%27%2F%3E'
    4     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    5     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        INIT_METHOD_CALL                                         !1, 'getElementById'
          8        SEND_VAL_EX                                              '23434'
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
    8    11        INIT_METHOD_CALL                                         !2, 'setAttribute'
         12        SEND_VAL_EX                                              'foo'
         13        SEND_VAL_EX                                              'test'
         14        DO_FCALL                                      0          
   10    15        INIT_METHOD_CALL                                         !1, 'saveHTML'
         16        CHECK_FUNC_ARG                                           
         17        FETCH_OBJ_FUNC_ARG                               $11     !1, 'documentElement'
         18        SEND_FUNC_ARG                                            $11
         19        DO_FCALL                                      0  $12     
         20        ECHO                                                     $12
   11    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.88 ms | 1393 KiB | 13 Q