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'); 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 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 42
Branch analysis from position: 59
Branch analysis from position: 42
filename:       /in/b9qFQ
function name:  (null)
number of ops:  60
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+text%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        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   16    22        ASSIGN                                                   !2, <array>
   17    23        INIT_FCALL                                               'preg_match_all'
         24        CONCAT                                           ~15     '%2F%5E', !1
         25        CONCAT                                           ~16     ~15, '%2Fmi'
         26        SEND_VAL                                                 ~16
         27        SEND_VAR                                                 !0
         28        SEND_REF                                                 !2
         29        DO_ICALL                                         $17     
         30        ASSIGN                                                   !3, $17
   19    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !3
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
   21    35        INIT_FCALL                                               'mb_regex_encoding'
         36        SEND_VAL                                                 'UTF-8'
         37        DO_ICALL                                                 
   22    38        INIT_FCALL                                               'mb_ereg_search_init'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                                 
   24    41      > JMP                                                      ->53
   26    42    >   INIT_FCALL                                               'mb_ereg_search_getregs'
         43        DO_ICALL                                         $22     
         44        ASSIGN                                                   !4, $22
   27    45        INIT_FCALL                                               'mb_ereg_search_setpos'
         46        INIT_FCALL                                               'mb_ereg_search_getpos'
         47        DO_ICALL                                         $24     
         48        SEND_VAR                                                 $24
         49        DO_ICALL                                                 
   28    50        INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !4
         52        DO_ICALL                                                 
   24    53    >   INIT_FCALL                                               'mb_ereg_search'
         54        CONCAT                                           ~27     '%5E', !1
         55        SEND_VAL                                                 ~27
         56        SEND_VAL                                                 'imz'
         57        DO_ICALL                                         $28     
         58      > JMPNZ                                                    $28, ->42
   30    59    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.71 ms | 1405 KiB | 33 Q