3v4l.org

run code in 300+ PHP versions simultaneously
<?php $help_path = 'http:xxx.com/wp-content/help/'; $contents = <<<MYVAR <img src="../Links/WAS_PIC_ControlBox-1-2-3.jpg" alt="WAS-Betjeningsboks-1-2-3" style="border: none; margin-left: 20px; margin-right: 0px; margin-top: 0px; margin-bottom: 0px;" border="0"> <script type="text/javascript" src="../ehlpdhtm.js"></script> MYVAR; $find = array( '#<script\s+type="(.*?)"\s+src="(?:\.{2}/)?(.*?)">(.*?)</script>#is', '#<img\s+src="(?:\.{2}/)?(.*?)"\s+alt="(.*?)"([^>]*?)/?>#i' ); $replace = array( '<script type="${1}" src="' . $help_path . '${2}"></script>', '<img src="' . $help_path . '${1}" alt="${2}"${3} />' ); $preg_rep = preg_replace($find, $replace, $contents); print_r($preg_rep);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tBQjR
function name:  (null)
number of ops:  20
compiled vars:  !0 = $help_path, !1 = $contents, !2 = $find, !3 = $replace, !4 = $preg_rep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3Axxx.com%2Fwp-content%2Fhelp%2F'
    4     1        ASSIGN                                                   !1, '%3Cimg+src%3D%22..%2FLinks%2FWAS_PIC_ControlBox-1-2-3.jpg%22+alt%3D%22WAS-Betjeningsboks-1-2-3%22+%0Astyle%3D%22border%3A+none%3B+margin-left%3A+20px%3B+margin-right%3A+0px%3B+margin-top%3A+0px%3B+margin-bottom%3A+0px%3B%22+border%3D%220%22%3E%0A%0A%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22..%2Fehlpdhtm.js%22%3E%3C%2Fscript%3E'
   11     2        ASSIGN                                                   !2, <array>
   17     3        CONCAT                                           ~8      '%3Cscript+type%3D%22%24%7B1%7D%22+src%3D%22', !0
          4        CONCAT                                           ~9      ~8, '%24%7B2%7D%22%3E%3C%2Fscript%3E'
          5        INIT_ARRAY                                       ~10     ~9
   18     6        CONCAT                                           ~11     '%3Cimg+src%3D%22', !0
          7        CONCAT                                           ~12     ~11, '%24%7B1%7D%22+alt%3D%22%24%7B2%7D%22%24%7B3%7D+%2F%3E'
          8        ADD_ARRAY_ELEMENT                                ~10     ~12
   16     9        ASSIGN                                                   !3, ~10
   21    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $14     
         15        ASSIGN                                                   !4, $14
   22    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.2 ms | 1011 KiB | 15 Q