3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!-- main layout and navbar stylesheets --> <style type="text/css" media="all and (min-width:481px)"> @import url("/styles/main.css?v=11") screen, projection; @import url("/styles/navbar.css?v=11") screen, projection; </style> <p>Example of @import rule <blockquote> @import url("/styles/main.css?v=11") screen, projection; @import url("/styles/navbar.css?v=11") screen, projection; </blockquote> </p>'; $doc = new DOMDocument(); $doc->loadHTML($html); $nodes = $doc->getElementsByTagName("style"); for($i=0;$i<$nodes->length;$i++){ $style = $nodes->item($i)->textContent; preg_match_all("!@import\s+url\((['\"])(.+?)\\1\)!", $style, $m); print_r($m[1]); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 13
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 13
Branch analysis from position: 31
Branch analysis from position: 13
filename:       /in/tPRrb
function name:  (null)
number of ops:  32
compiled vars:  !0 = $html, !1 = $doc, !2 = $nodes, !3 = $i, !4 = $style, !5 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%21--+main+layout+and+navbar+stylesheets+--%3E%0A%3Cstyle+type%3D%22text%2Fcss%22+media%3D%22all+and+%28min-width%3A481px%29%22%3E%0A++%40import+url%28%22%2Fstyles%2Fmain.css%3Fv%3D11%22%29+screen%2C+projection%3B%0A++%40import+url%28%22%2Fstyles%2Fnavbar.css%3Fv%3D11%22%29+screen%2C+projection%3B%0A%3C%2Fstyle%3E%0A%3Cp%3EExample+of+%40import+rule%0A%3Cblockquote%3E%0A++%40import+url%28%22%2Fstyles%2Fmain.css%3Fv%3D11%22%29+screen%2C+projection%3B%0A++%40import+url%28%22%2Fstyles%2Fnavbar.css%3Fv%3D11%22%29+screen%2C+projection%3B%0A%3C%2Fblockquote%3E%0A%3C%2Fp%3E'
   13     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
   14     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'style'
          9        DO_FCALL                                      0  $11     
         10        ASSIGN                                                   !2, $11
   16    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->28
   17    13    >   INIT_METHOD_CALL                                         !2, 'item'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $14     
         16        FETCH_OBJ_R                                      ~15     $14, 'textContent'
         17        ASSIGN                                                   !4, ~15
   18    18        INIT_FCALL                                               'preg_match_all'
         19        SEND_VAL                                                 '%21%40import%5Cs%2Burl%5C%28%28%5B%27%22%5D%29%28.%2B%3F%29%5C1%5C%29%21'
         20        SEND_VAR                                                 !4
         21        SEND_REF                                                 !5
         22        DO_ICALL                                                 
   19    23        INIT_FCALL                                               'print_r'
         24        FETCH_DIM_R                                      ~18     !5, 1
         25        SEND_VAL                                                 ~18
         26        DO_ICALL                                                 
   16    27        PRE_INC                                                  !3
         28    >   FETCH_OBJ_R                                      ~21     !2, 'length'
         29        IS_SMALLER                                               !3, ~21
         30      > JMPNZ                                                    ~22, ->13
   22    31    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.6 ms | 1396 KiB | 17 Q