3v4l.org

run code in 300+ PHP versions simultaneously
<?php // wg twojego skryptu leci zwykly tekst $test = "hello <script type=\"text/javascript\"> alert('xds'); </script> \\//\\\\\\ //// "; // kasujemy / \ $removed = str_replace( ['/', '\\'], ['',''], $test ); // jak to wyglada: echo "1.". $test . PHP_EOL; echo "2.". $removed . PHP_EOL; // filtrujemy $cleared = filter_var($removed,FILTER_SANITIZE_STRING); // rezultat echo "3.". $cleared. PHP_EOL; echo json_encode($cleared). PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8nvMK
function name:  (null)
number of ops:  27
compiled vars:  !0 = $test, !1 = $removed, !2 = $cleared
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'hello+%3Cscript+type%3D%22text%2Fjavascript%22%3E+alert%28%27xds%27%29%3B+%3C%2Fscript%3E+%5C%2F%2F%5C%5C%5C+%2F%2F%2F%2F+'
    6     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    9     7        CONCAT                                           ~6      '1.', !0
          8        CONCAT                                           ~7      ~6, '%0A'
          9        ECHO                                                     ~7
   10    10        CONCAT                                           ~8      '2.', !1
         11        CONCAT                                           ~9      ~8, '%0A'
         12        ECHO                                                     ~9
   13    13        INIT_FCALL                                               'filter_var'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 513
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !2, $10
   16    18        CONCAT                                           ~12     '3.', !2
         19        CONCAT                                           ~13     ~12, '%0A'
         20        ECHO                                                     ~13
   17    21        INIT_FCALL                                               'json_encode'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $14     
         24        CONCAT                                           ~15     $14, '%0A'
         25        ECHO                                                     ~15
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.39 ms | 1400 KiB | 19 Q