3v4l.org

run code in 300+ PHP versions simultaneously
<?php function codePoints($utf8_str){ //入力をUTF-32に変換 $utf32_str=mb_convert_encoding($utf8_str,'UTF-32','UTF-8'); for($i=0;$i<mb_strlen($utf32_str,'UTF-32');++$i) //1文字ずつ16進文字列に変換 $result[]=bin2hex(mb_substr($utf32_str,$i,1,'UTF-32')); return $result; } //mb_internal_encoding('UTF-8'); $string ='aab'; $pattern = '/aaa/'; if(preg_match_all($pattern, $string, $matches, PREG_OFFSET_CAPTURE)) { echo 'test'; } $string ="⏳"; $test = codePoints($string); echo "$test:".print_r($test,true); $pattern = '/23f0|23f3/'; if(preg_match_all($pattern, $test[0], $matches )) { echo 'test2'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 10
filename:       /in/lZXdM
function name:  (null)
number of ops:  33
compiled vars:  !0 = $string, !1 = $pattern, !2 = $matches, !3 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'aab'
   18     1        ASSIGN                                                   !1, '%2Faaa%2F'
   19     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
   20     4        SEND_VAR                                                 !0
   21     5        SEND_REF                                                 !2
   22     6        SEND_VAL                                                 256
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->10
   23     9    >   ECHO                                                     'test'
   27    10    >   ASSIGN                                                   !0, '%E2%8F%B3'
   28    11        INIT_FCALL                                               'codepoints'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $8      
         14        ASSIGN                                                   !3, $8
   29    15        NOP                                                      
         16        FAST_CONCAT                                      ~10     !3, '%3A'
         17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !3
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $11     
         21        CONCAT                                           ~12     ~10, $11
         22        ECHO                                                     ~12
   30    23        ASSIGN                                                   !1, '%2F23f0%7C23f3%2F'
   31    24        INIT_FCALL                                               'preg_match_all'
         25        SEND_VAR                                                 !1
   32    26        FETCH_DIM_R                                      ~14     !3, 0
         27        SEND_VAL                                                 ~14
   33    28        SEND_REF                                                 !2
         29        DO_ICALL                                         $15     
         30      > JMPZ                                                     $15, ->32
   35    31    >   ECHO                                                     'test2'
   36    32    > > RETURN                                                   1

Function codepoints:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
Branch analysis from position: 9
filename:       /in/lZXdM
function name:  codePoints
number of ops:  29
compiled vars:  !0 = $utf8_str, !1 = $utf32_str, !2 = $i, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'mb_convert_encoding'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'UTF-32'
          4        SEND_VAL                                                 'UTF-8'
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    7     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->21
    9     9    >   INIT_FCALL                                               'bin2hex'
         10        INIT_FCALL                                               'mb_substr'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 1
         14        SEND_VAL                                                 'UTF-32'
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        ASSIGN_DIM                                               !3
         19        OP_DATA                                                  $9
    7    20        PRE_INC                                                  !2
         21    >   INIT_FCALL                                               'mb_strlen'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 'UTF-32'
         24        DO_ICALL                                         $11     
         25        IS_SMALLER                                               !2, $11
         26      > JMPNZ                                                    ~12, ->9
   10    27    > > RETURN                                                   !3
   11    28*     > RETURN                                                   null

End of function codepoints

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1403 KiB | 26 Q