3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TXT /some /text / TXT; $pattern = "/"; $pattern = mb_convert_encoding($pattern, 'UTF-8', 'Windows-1251'); $pattern = preg_quote($pattern, '/'); $pattern = mb_convert_encoding($pattern, 'Windows-1251', 'UTF-8'); $pattern .= "(?:(text)|(some))"; var_dump($pattern); $matches = array(); $match = preg_match_all("/" . $pattern . "/mi", $text, $matches); var_dump($match, $matches); mb_regex_encoding('UTF-8'); mb_ereg_search_init($text); while(mb_ereg_search("" . $pattern, "imz")) { $r = mb_ereg_search_getregs(); mb_ereg_search_setpos(mb_ereg_search_getpos()); var_dump($r); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 43
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 43
Branch analysis from position: 60
Branch analysis from position: 43
filename:       /in/JWvmQ
function name:  (null)
number of ops:  61
compiled vars:  !0 = $text, !1 = $pattern, !2 = $matches, !3 = $match, !4 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%2Fsome+%2Ftext+%2F%0A'
    9     1        ASSIGN                                                   !1, '%2F'
   10     2        INIT_FCALL                                               'mb_convert_encoding'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 'UTF-8'
          5        SEND_VAL                                                 'Windows-1251'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
   11     8        INIT_FCALL                                               'preg_quote'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 '%2F'
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !1, $9
   12    13        INIT_FCALL                                               'mb_convert_encoding'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 'Windows-1251'
         16        SEND_VAL                                                 'UTF-8'
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !1, $11
   14    19        ASSIGN_OP                                     8          !1, '%28%3F%3A%28text%29%7C%28some%29%29'
   16    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   18    23        ASSIGN                                                   !2, <array>
   19    24        INIT_FCALL                                               'preg_match_all'
         25        CONCAT                                           ~16     '%2F', !1
         26        CONCAT                                           ~17     ~16, '%2Fmi'
         27        SEND_VAL                                                 ~17
         28        SEND_VAR                                                 !0
         29        SEND_REF                                                 !2
         30        DO_ICALL                                         $18     
         31        ASSIGN                                                   !3, $18
   21    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !3
         34        SEND_VAR                                                 !2
         35        DO_ICALL                                                 
   23    36        INIT_FCALL                                               'mb_regex_encoding'
         37        SEND_VAL                                                 'UTF-8'
         38        DO_ICALL                                                 
   24    39        INIT_FCALL                                               'mb_ereg_search_init'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                                 
   26    42      > JMP                                                      ->54
   28    43    >   INIT_FCALL                                               'mb_ereg_search_getregs'
         44        DO_ICALL                                         $23     
         45        ASSIGN                                                   !4, $23
   29    46        INIT_FCALL                                               'mb_ereg_search_setpos'
         47        INIT_FCALL                                               'mb_ereg_search_getpos'
         48        DO_ICALL                                         $25     
         49        SEND_VAR                                                 $25
         50        DO_ICALL                                                 
   30    51        INIT_FCALL                                               'var_dump'
         52        SEND_VAR                                                 !4
         53        DO_ICALL                                                 
   26    54    >   INIT_FCALL                                               'mb_ereg_search'
         55        CONCAT                                           ~28     '', !1
         56        SEND_VAL                                                 ~28
         57        SEND_VAL                                                 'imz'
         58        DO_ICALL                                         $29     
         59      > JMPNZ                                                    $29, ->43
   32    60    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.75 ms | 1392 KiB | 33 Q