3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_ALL, 'ru_RU.utf8'); $str = '<p>Тут новая статья вышла. Вот картинка к ней</p><img src="/vdf.png"> и вот <img src="/vdf.png"><div>Обязательно нужно почитать</div> '; $img_stripped = preg_replace('/<img[^>]*>/u', ' __IMG__', $str, 1); $img_stripped = preg_replace('/<[^>]+>/u', '', $img_stripped); var_dump(str_word_count($img_stripped, 2,'_'), $img_stripped);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6ARq9
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str, !1 = $img_stripped
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'setlocale'
          1        SEND_VAL                                                 6
          2        SEND_VAL                                                 'ru_RU.utf8'
          3        DO_ICALL                                                 
    4     4        ASSIGN                                                   !0, '%3Cp%3E%D0%A2%D1%83%D1%82+%D0%BD%D0%BE%D0%B2%D0%B0%D1%8F+%D1%81%D1%82%D0%B0%D1%82%D1%8C%D1%8F+%D0%B2%D1%8B%D1%88%D0%BB%D0%B0.+%D0%92%D0%BE%D1%82+%D0%BA%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D0%BA%D0%B0+%D0%BA+%D0%BD%D0%B5%D0%B9%3C%2Fp%3E%3Cimg+src%3D%22%2Fvdf.png%22%3E+%D0%B8+%D0%B2%D0%BE%D1%82+%3Cimg+src%3D%22%2Fvdf.png%22%3E%3Cdiv%3E%D0%9E%D0%B1%D1%8F%D0%B7%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE+%D0%BD%D1%83%D0%B6%D0%BD%D0%BE+%D0%BF%D0%BE%D1%87%D0%B8%D1%82%D0%B0%D1%82%D1%8C%3C%2Fdiv%3E+'
    6     5        INIT_FCALL                                               'preg_replace'
          6        SEND_VAL                                                 '%2F%3Cimg%5B%5E%3E%5D%2A%3E%2Fu'
          7        SEND_VAL                                                 '+__IMG__'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $4      
         11        ASSIGN                                                   !1, $4
    7    12        INIT_FCALL                                               'preg_replace'
         13        SEND_VAL                                                 '%2F%3C%5B%5E%3E%5D%2B%3E%2Fu'
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $6      
         17        ASSIGN                                                   !1, $6
   10    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'str_word_count'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 2
         22        SEND_VAL                                                 '_'
         23        DO_ICALL                                         $8      
         24        SEND_VAR                                                 $8
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.44 ms | 1388 KiB | 21 Q