3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "this is sachinĂ¹s school of sachin"; $pattern = "sachinĂ¹s"; if(preg_match("/[^ [:punct:]]*".$pattern."([^ [:punct:]]*)/u", $a, $match)){ print(mb_strlen($match[1], "UTF-8")); if($pattern == $match[0]){ print(" (full word)"); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/7vvGT
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $pattern, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'this+is+sachin%C3%B9s+school+of+sachin'
    3     1        ASSIGN                                                   !1, 'sachin%C3%B9s'
    4     2        INIT_FCALL                                               'preg_match'
          3        CONCAT                                           ~5      '%2F%5B%5E+%5B%3Apunct%3A%5D%5D%2A', !1
          4        CONCAT                                           ~6      ~5, '%28%5B%5E+%5B%3Apunct%3A%5D%5D%2A%29%2Fu'
          5        SEND_VAL                                                 ~6
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !2
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->20
    5    10    >   INIT_FCALL                                               'mb_strlen'
         11        FETCH_DIM_R                                      ~8      !2, 1
         12        SEND_VAL                                                 ~8
         13        SEND_VAL                                                 'UTF-8'
         14        DO_ICALL                                         $9      
         15        ECHO                                                     $9
    6    16        FETCH_DIM_R                                      ~10     !2, 0
         17        IS_EQUAL                                                 !1, ~10
         18      > JMPZ                                                     ~11, ->20
    7    19    >   ECHO                                                     '+%28full+word%29'
   10    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.73 ms | 1395 KiB | 17 Q