3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "a1a2a3a4aaaa", "a3333aaaaaaa", "a1a2a3aaaaa2", "a1a2a3", "a222", "aaaa", "a2aa", "f2fdfgdd", "w333rrrrrrr4", "rrrrrrrr4444", "r22rrrrrrrrr", "g4fff333ffff", "333333333333", "1111", "1aaa", "1aaaaaaaaaaa", "1a2aaaaaaaaa", "a1aaaaaaaaaaa", "a11111aaaaaa", "a122a3aaaaa2", "a1a2a3a4a5aa" ]; $pattern = "/^[a-z](?=(?:[a-z]*\d){0,4}(?![a-z]*\d))(?=[a-z\d]{3,11}$)[a-z\d]+$/"; foreach ($strings as $string) { echo $string . " ==> " . preg_match($pattern, $string) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/2mWEk
function name:  (null)
number of ops:  12
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   26     1        ASSIGN                                                       !1, '%2F%5E%5Ba-z%5D%28%3F%3D%28%3F%3A%5Ba-z%5D%2A%5Cd%29%7B0%2C4%7D%28%3F%21%5Ba-z%5D%2A%5Cd%29%29%28%3F%3D%5Ba-z%5Cd%5D%7B3%2C11%7D%24%29%5Ba-z%5Cd%5D%2B%24%2F'
   27     2      > FE_RESET_R                                           $5      !0, ->10
          3    > > FE_FETCH_R                                                   $5, !2, ->10
   28     4    >   CONCAT                                               ~6      !2, '+%3D%3D%3E+'
          5        FRAMELESS_ICALL_2                preg_match          ~7      !1, !2
          6        CONCAT                                               ~8      ~6, ~7
          7        CONCAT                                               ~9      ~8, '%0A'
          8        ECHO                                                         ~9
   27     9      > JMP                                                          ->3
         10    >   FE_FREE                                                      $5
   29    11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.24 ms | 2702 KiB | 13 Q