3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>header</title> </head> <body> <input id='printed_name' type='text' class='forma_input' required='' style='position: relative;top: -8px;'> </body> </html> HTML; $doc = new DOMDocument(); $doc->loadHtml($html); $el = $doc->getElementById('printed_name'); $el->setAttribute( "value", "1234" ); var_dump($doc->saveHTML());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SUuBL
function name:  (null)
number of ops:  21
compiled vars:  !0 = $html, !1 = $doc, !2 = $el
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A+%3Chead%3E%0A++%3Cmeta+charset%3D%22utf-8%22%3E%0A++%3Ctitle%3Eheader%3C%2Ftitle%3E%0A+%3C%2Fhead%3E+%0A+%3Cbody%3E%0A++%3Cinput+id%3D%27printed_name%27+type%3D%27text%27+class%3D%27forma_input%27+required%3D%27%27+style%3D%27position%3A+relative%3Btop%3A+-8px%3B%27%3E%0A+%3C%2Fbody%3E+%0A%3C%2Fhtml%3E'
   16     1        NEW                                                  $4      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $4
   17     4        INIT_METHOD_CALL                                             !1, 'loadHtml'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   18     7        INIT_METHOD_CALL                                             !1, 'getElementById'
          8        SEND_VAL_EX                                                  'printed_name'
          9        DO_FCALL                                          0  $8      
         10        ASSIGN                                                       !2, $8
   19    11        INIT_METHOD_CALL                                             !2, 'setAttribute'
         12        SEND_VAL_EX                                                  'value'
         13        SEND_VAL_EX                                                  '1234'
         14        DO_FCALL                                          0          
   21    15        INIT_FCALL                                                   'var_dump'
         16        INIT_METHOD_CALL                                             !1, 'saveHTML'
         17        DO_FCALL                                          0  $11     
         18        SEND_VAR                                                     $11
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.5 ms | 2081 KiB | 14 Q