3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*自己的選項*/ $url[] = array('url' => 'http://tw.yahoo.com','option' => 'yahoo.tw'); $url[] = array('url' => 'http://cn.yahoo.com','option' => 'yahoo.cn'); ?> <html> <head> <script> function chglink() {document.getElementById("link").innerHTML = document.getElementById("addr").value;} function chgFrame() {document.getElementById("iframe1").src = document.getElementById("link").innerHTML;} </script> </head> <body> 自己的選項 <?php print_r($url);?> <hr> <table border="1"> <tr><td>有select表單</td></tr> <tr><td>php在table內<select id="addr" onchange="chglink();"> <?php foreach($url as $k => $v) echo '<option value="'.$v["url"].'">'.$v["option"].'</option>'; ?> </select></td></tr> <tr><td>會顯示url(<a id="link" href="#" onclick="chgFrame();"></a>),請點我控制iframe</td></tr> <tr><td><iframe id="iframe1" src="<?php echo $url[0]["url"];?>" width="600px" height="400px"></td></tr> </table> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/mmuil
function name:  (null)
number of ops:  27
compiled vars:  !0 = $url, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    6     4        ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Cscript%3E%0Afunction+chglink%28%29+%7Bdocument.getElementById%28%22link%22%29.innerHTML+%3D+document.getElementById%28%22addr%22%29.value%3B%7D%0Afunction+chgFrame%28%29+%7Bdocument.getElementById%28%22iframe1%22%29.src+%3D+document.getElementById%28%22link%22%29.innerHTML%3B%7D%0A%3C%2Fscript%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%E8%87%AA%E5%B7%B1%E7%9A%84%E9%81%B8%E9%A0%85%0A'
   15     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   16     8        ECHO                                                     '%3Chr%3E%0A%3Ctable+border%3D%221%22%3E%0A%3Ctr%3E%3Ctd%3E%E6%9C%89select%E8%A1%A8%E5%96%AE%3C%2Ftd%3E%3C%2Ftr%3E%0A%3Ctr%3E%3Ctd%3Ephp%E5%9C%A8table%E5%85%A7%3Cselect+id%3D%22addr%22+onchange%3D%22chglink%28%29%3B%22%3E%0A'
   21     9      > FE_RESET_R                                       $6      !0, ->20
         10    > > FE_FETCH_R                                       ~7      $6, !1, ->20
         11    >   ASSIGN                                                   !2, ~7
   22    12        FETCH_DIM_R                                      ~9      !1, 'url'
         13        CONCAT                                           ~10     '%3Coption+value%3D%22', ~9
         14        CONCAT                                           ~11     ~10, '%22%3E'
         15        FETCH_DIM_R                                      ~12     !1, 'option'
         16        CONCAT                                           ~13     ~11, ~12
         17        CONCAT                                           ~14     ~13, '%3C%2Foption%3E'
         18        ECHO                                                     ~14
   21    19      > JMP                                                      ->10
         20    >   FE_FREE                                                  $6
   24    21        ECHO                                                     '%3C%2Fselect%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A%3Ctr%3E%3Ctd%3E%E6%9C%83%E9%A1%AF%E7%A4%BAurl%28%3Ca+id%3D%22link%22+href%3D%22%23%22+onclick%3D%22chgFrame%28%29%3B%22%3E%3C%2Fa%3E%29%EF%BC%8C%E8%AB%8B%E9%BB%9E%E6%88%91%E6%8E%A7%E5%88%B6iframe%3C%2Ftd%3E%3C%2Ftr%3E%0A%3Ctr%3E%3Ctd%3E%3Ciframe+id%3D%22iframe1%22+src%3D%22'
   26    22        FETCH_DIM_R                                      ~15     !0, 0
         23        FETCH_DIM_R                                      ~16     ~15, 'url'
         24        ECHO                                                     ~16
         25        ECHO                                                     '%22+width%3D%22600px%22+height%3D%22400px%22%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   29    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.37 ms | 1388 KiB | 15 Q