3v4l.org

run code in 300+ 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 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/2mWEk
function name:  (null)
number of ops:  15
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, ->13
          3    > > FE_FETCH_R                                               $5, !2, ->13
   28     4    >   CONCAT                                           ~6      !2, '+%3D%3D%3E+'
          5        INIT_FCALL                                               'preg_match'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        CONCAT                                           ~8      ~6, $7
         10        CONCAT                                           ~9      ~8, '%0A'
         11        ECHO                                                     ~9
   27    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $5
   29    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.23 ms | 999 KiB | 14 Q