3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exp = '/^[a-z]{2}|all$/'; $tests = array('fr', 'french', 'FR', 'all', 'ALL'); foreach ($tests as $test) { echo sprintf("%-10s : %s", $test, preg_match($exp, $test) ? "OK" : "ERROR"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/dsQHh
function name:  (null)
number of ops:  21
compiled vars:  !0 = $exp, !1 = $tests, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5E%5Ba-z%5D%7B2%7D%7Call%24%2F'
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $5      !1, ->19
          3    > > FE_FETCH_R                                               $5, !2, ->19
    6     4    >   INIT_FCALL                                               'sprintf'
          5        SEND_VAL                                                 '%25-10s+%3A+%25s'
          6        SEND_VAR                                                 !2
          7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $6      
         11      > JMPZ                                                     $6, ->14
         12    >   QM_ASSIGN                                        ~7      'OK'
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~7      'ERROR'
         15    >   SEND_VAL                                                 ~7
         16        DO_ICALL                                         $8      
         17        ECHO                                                     $8
    5    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
    7    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.02 ms | 1395 KiB | 17 Q