3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = "/^[a-zA-Z ,.\p{Han}]+$/"; $tests = array( 'Mr Smith', 'Mr. Smith', 'Mr. 123 Smith', '姓名' ); foreach ($tests as $test) { if (preg_match($re, utf8_decode($test)) !== 1) { echo $test . ' failed' . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/f2b2G
function name:  (null)
number of ops:  19
compiled vars:  !0 = $re, !1 = $tests, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5E%5Ba-zA-Z+%2C.%5Cp%7BHan%7D%5D%2B%24%2F'
    4     1        ASSIGN                                                   !1, <array>
   11     2      > FE_RESET_R                                       $5      !1, ->17
          3    > > FE_FETCH_R                                               $5, !2, ->17
   12     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !0
          6        INIT_FCALL                                               'utf8_decode'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                         $7      
         11        IS_NOT_IDENTICAL                                         $7, 1
         12      > JMPZ                                                     ~8, ->16
   13    13    >   CONCAT                                           ~9      !2, '+failed'
         14        CONCAT                                           ~10     ~9, '%0A'
         15        ECHO                                                     ~10
   11    16    > > JMP                                                      ->3
         17    >   FE_FREE                                                  $5
   15    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.03 ms | 1386 KiB | 17 Q