3v4l.org

run code in 300+ PHP versions simultaneously
<?php function acceptOne($a) {}; $words = ['ACCESSIBLE', 'ACTION', 'AFTER', 'AGAINST', 'AGGREGATE', 'ALGORITHM', 'ALL', 'ALTER', 'ANALYSE', 'ANALYZE', 'AS', 'ASC', 'AUTOCOMMIT', 'AUTO_INCREMENT', 'BACKUP', 'BEGIN', 'BETWEEN', 'BINLOG', 'BOTH', 'CASCADE', 'CASE', 'CHANGE', 'CHANGED', 'CHARACTER', 'CHARSET', 'CHECK', 'CHECKSUM', 'COLLATE', 'COLLATION', 'COLUMN', 'COLUMNS', 'COMMENT', 'COMMIT', 'COMMITTED', 'COMPRESSED', 'CONCURRENT', 'CONSTRAINT', 'CONTAINS', 'CONVERT', 'CREATE', 'CROSS', 'CURRENT', 'CURRENT_TIMESTAMP', 'DATABASE', 'DATABASES', 'DAY', 'DAY_HOUR', 'DAY_MINUTE', 'DAY_SECOND', 'DEFAULT', 'DEFINER', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DIV', 'DO', 'DUMPFILE', 'DUPLICATE', 'DYNAMIC', 'ELSE', 'ENCLOSED', 'END', 'ENGINE', 'ENGINES', 'ENGINE_TYPE', 'ESCAPE', 'ESCAPED', 'EVENTS', 'EXEC', 'EXECUTE', 'EXISTS', 'EXPLAIN', 'EXTENDED', 'FAST', 'FETCH', 'FIELDS', 'FILE', 'FILTER', 'FIRST', 'FIXED', 'FLUSH', 'FOLLOWING', 'FOR', 'FORCE', 'FOREIGN', 'FULL', 'FULLTEXT', 'FUNCTION', 'GLOBAL', 'GRANT', 'GRANTS', 'GROUP', 'GROUPS', 'HEAP', 'HIGH_PRIORITY', 'HOSTS', 'HOUR', 'HOUR_MINUTE', 'HOUR_SECOND', 'IDENTIFIED', 'IF', 'IFNULL', 'IGNORE', 'IN', 'INDEX', 'INDEXES', 'INFILE', 'INSERT', 'INSERT_ID', 'INSERT_METHOD', 'INTERVAL', 'INTO', 'INVOKER', 'IS', 'ISOLATION', 'KEY', 'KEYS', 'KILL', 'LAST_INSERT_ID', 'LEADING', 'LEVEL', 'LIKE', 'LINEAR', 'LINES', 'LOAD', 'LOCAL', 'LOCK', 'LOCKS', 'LOGS', 'LOW_PRIORITY', 'MARIA', 'MASTER', 'MASTER_CONNECT_RETRY', 'MASTER_HOST', 'MASTER_LOG_FILE', 'MATCH', 'MAX_CONNECTIONS_PER_HOUR', 'MAX_QUERIES_PER_HOUR', 'MAX_ROWS', 'MAX_UPDATES_PER_HOUR', 'MAX_USER_CONNECTIONS', 'MEDIUM', 'MERGE', 'MINUTE', 'MINUTE_SECOND', 'MIN_ROWS', 'MODE', 'MONTH', 'MRG_MYISAM', 'MYISAM', 'NAMES', 'NATURAL', 'NOT', 'NULL', 'OFFSET', 'ON', 'OPEN', 'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'OUTFILE', 'OVER', 'PACK_KEYS', 'PAGE', 'PARTIAL', 'PARTITION', 'PARTITIONS', 'PASSWORD', 'PRECEDING', 'PRIMARY', 'PRIVILEGES', 'PROCEDURE', 'PROCESS', 'PROCESSLIST', 'PURGE', 'QUICK', 'RAID0', 'RAID_CHUNKS', 'RAID_CHUNKSIZE', 'RAID_TYPE', 'RANGE', 'READ', 'READ_ONLY', 'READ_WRITE', 'RECURSIVE', 'REFERENCES', 'REGEXP', 'RELOAD', 'RENAME', 'REPAIR', 'REPEATABLE', 'REPLACE', 'REPLICATION', 'RESET', 'RESTORE', 'RESTRICT', 'RETURN', 'RETURNS', 'REVOKE', 'RLIKE', 'ROLLBACK', 'ROW', 'ROWS', 'ROW_FORMAT', 'SECOND', 'SECURITY', 'SEPARATOR', 'SERIALIZABLE', 'SESSION', 'SET', 'SHARE', 'SHOW', 'SHUTDOWN', 'SLAVE', 'SONAME', 'SOUNDS', 'SQL', 'SQL_AUTO_IS_NULL', 'SQL_BIG_RESULT', 'SQL_BIG_SELECTS', 'SQL_BIG_TABLES', 'SQL_BUFFER_RESULT', 'SQL_CACHE', 'SQL_CALC_FOUND_ROWS', 'SQL_LOG_BIN', 'SQL_LOG_OFF', 'SQL_LOG_UPDATE', 'SQL_LOW_PRIORITY_UPDATES', 'SQL_MAX_JOIN_SIZE', 'SQL_NO_CACHE', 'SQL_QUOTE_SHOW_CREATE', 'SQL_SAFE_UPDATES', 'SQL_SELECT_LIMIT', 'SQL_SLAVE_SKIP_COUNTER', 'SQL_SMALL_RESULT', 'SQL_WARNINGS', 'START', 'STARTING', 'STATUS', 'STOP', 'STORAGE', 'STRAIGHT_JOIN', 'STRING', 'STRIPED', 'SUPER', 'TABLE', 'TABLES', 'TEMPORARY', 'TERMINATED', 'THEN', 'TIES', 'TO', 'TRAILING', 'TRANSACTIONAL', 'TRUE', 'TRUNCATE', 'TYPE', 'TYPES', 'UNBOUNDED', 'UNCOMMITTED', 'UNIQUE', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USE', 'USING', 'VARIABLES', 'VIEW', 'WHEN', 'WITH', 'WORK', 'WRITE', 'YEAR_MONTH']; $regexDummy = '/' . makeRegexFromListDummy($words) . '/'; $regexOptimized = '/' . makeRegexFromListOptimized($words) . '/'; $regexDummyWithS = '/' . makeRegexFromListDummy($words) . '/S'; var_dump($regexDummy); var_dump($regexOptimized); $testStr = 'BLOB'; $benchFx = function (string $msg, \Closure $fx) { $times = []; for ($i = 0; $i < 100; $i++) { $t = microtime(true); $fx(); $t = microtime(true) - $t; $times[] = $t; } $bestTime = min($times); echo $msg . ': ' . round($bestTime * 1000, 2) . " ms\n"; }; $benchFx('dummy', function () { global $regexDummy, $testStr; for ($i = 0; $i < 5_000; $i++) { preg_match($regexDummy, $testStr . $i, $matches); acceptOne($matches); } }); $benchFx('optimized', function () { global $regexOptimized, $testStr; for ($i = 0; $i < 5_000; $i++) { preg_match($regexOptimized, $testStr . $i, $matches); acceptOne($matches); } }); $benchFx('dummy /w S', function () { global $regexDummyWithS, $testStr; for ($i = 0; $i < 5_000; $i++) { preg_match($regexDummyWithS, $testStr . $i, $matches); acceptOne($matches); } }); function makeRegexFromListDummy(array $values): string { // sort list by alphabet and from longest word to shortest usort($values, static function (string $a, string $b) { return str_starts_with($a, $b) || str_starts_with($b, $a) ? strlen($b) <=> strlen($a) : $a <=> $b; }); $regex = '(?>'; foreach ($values as $v) { if ($regex !== '(?>') { $regex .= '|'; } $regex .= preg_quote($v, '/'); } return $regex . ')'; } function makeRegexFromListOptimized(array $values, bool $sorted = false): string { // sort list by alphabet and from longest word to shortest if (! $sorted) { usort($values, static function (string $a, string $b) { return str_starts_with($a, $b) || str_starts_with($b, $a) ? strlen($b) <=> strlen($a) : $a <=> $b; }); } /** @var array<int|string, list<string>> $valuesBySharedPrefix */ $valuesBySharedPrefix = []; $items = []; $prefix = null; foreach ($values as $v) { if ($prefix !== null && ! str_starts_with($v, substr($prefix, 0, 1))) { $valuesBySharedPrefix[$prefix] = $items; $items = []; $prefix = null; } $items[] = $v; if ($prefix === null) { $prefix = $v; } else { while (! str_starts_with($v, $prefix)) { $prefix = substr($prefix, 0, -1); } } } if ($items !== []) { $valuesBySharedPrefix[$prefix] = $items; $items = []; $prefix = null; } $regex = '(?>'; foreach ($valuesBySharedPrefix as $prefix => $items) { if ($regex !== '(?>') { $regex .= '|'; } if (is_int($prefix)) { $prefix = (string) $prefix; } $regex .= preg_quote($prefix, '/'); $regex .= count($items) === 1 ? preg_quote(substr(reset($items), strlen($prefix)), '/') : makeRegexFromListOptimized(array_map(static fn ($v) => substr($v, strlen($prefix)), $items), true); } return $regex . ')'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JKn6D
function name:  (null)
number of ops:  44
compiled vars:  !0 = $words, !1 = $regexDummy, !2 = $regexOptimized, !3 = $regexDummyWithS, !4 = $testStr, !5 = $benchFx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL_BY_NAME                                       'makeRegexFromListDummy'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $7      
          4        CONCAT                                           ~8      '%2F', $7
          5        CONCAT                                           ~9      ~8, '%2F'
          6        ASSIGN                                                   !1, ~9
    8     7        INIT_FCALL_BY_NAME                                       'makeRegexFromListOptimized'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $11     
         10        CONCAT                                           ~12     '%2F', $11
         11        CONCAT                                           ~13     ~12, '%2F'
         12        ASSIGN                                                   !2, ~13
    9    13        INIT_FCALL_BY_NAME                                       'makeRegexFromListDummy'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0  $15     
         16        CONCAT                                           ~16     '%2F', $15
         17        CONCAT                                           ~17     ~16, '%2FS'
         18        ASSIGN                                                   !3, ~17
   11    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   12    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   14    25        ASSIGN                                                   !4, 'BLOB'
   16    26        DECLARE_LAMBDA_FUNCTION                          ~22     [0]
         27        ASSIGN                                                   !5, ~22
   29    28        INIT_DYNAMIC_CALL                                        !5
         29        SEND_VAL_EX                                              'dummy'
         30        DECLARE_LAMBDA_FUNCTION                          ~24     [1]
   36    31        SEND_VAL_EX                                              ~24
   29    32        DO_FCALL                                      0          
   38    33        INIT_DYNAMIC_CALL                                        !5
         34        SEND_VAL_EX                                              'optimized'
         35        DECLARE_LAMBDA_FUNCTION                          ~26     [2]
   45    36        SEND_VAL_EX                                              ~26
   38    37        DO_FCALL                                      0          
   47    38        INIT_DYNAMIC_CALL                                        !5
         39        SEND_VAL_EX                                              'dummy+%2Fw+S'
         40        DECLARE_LAMBDA_FUNCTION                          ~28     [3]
   54    41        SEND_VAL_EX                                              ~28
   47    42        DO_FCALL                                      0          
  137    43      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
Branch analysis from position: 5
filename:       /in/JKn6D
function name:  {closure}
number of ops:  35
compiled vars:  !0 = $msg, !1 = $fx, !2 = $times, !3 = $i, !4 = $t, !5 = $bestTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        ASSIGN                                                   !2, <array>
   18     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->19
   19     5    >   INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !4, $8
   20     9        INIT_DYNAMIC_CALL                                        !1
         10        DO_FCALL                                      0          
   21    11        INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $11     
         14        SUB                                              ~12     $11, !4
         15        ASSIGN                                                   !4, ~12
   22    16        ASSIGN_DIM                                               !2
         17        OP_DATA                                                  !4
   18    18        PRE_INC                                                  !3
         19    >   IS_SMALLER                                               !3, 100
         20      > JMPNZ                                                    ~16, ->5
   25    21    >   INIT_FCALL                                               'min'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $17     
         24        ASSIGN                                                   !5, $17
   26    25        CONCAT                                           ~19     !0, '%3A+'
         26        INIT_FCALL                                               'round'
         27        MUL                                              ~20     !5, 1000
         28        SEND_VAL                                                 ~20
         29        SEND_VAL                                                 2
         30        DO_ICALL                                         $21     
         31        CONCAT                                           ~22     ~19, $21
         32        CONCAT                                           ~23     ~22, '+ms%0A'
         33        ECHO                                                     ~23
   27    34      > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/JKn6D
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $regexDummy, !1 = $testStr, !2 = $i, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   BIND_GLOBAL                                              !0, 'regexDummy'
          1        BIND_GLOBAL                                              !1, 'testStr'
   32     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->14
   33     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !0
          6        CONCAT                                           ~5      !1, !2
          7        SEND_VAL                                                 ~5
          8        SEND_REF                                                 !3
          9        DO_ICALL                                                 
   34    10        INIT_FCALL                                               'acceptone'
         11        SEND_VAR                                                 !3
         12        DO_FCALL                                      0          
   32    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 5000
         15      > JMPNZ                                                    ~9, ->4
   36    16    > > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/JKn6D
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $regexOptimized, !1 = $testStr, !2 = $i, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   BIND_GLOBAL                                              !0, 'regexOptimized'
          1        BIND_GLOBAL                                              !1, 'testStr'
   41     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->14
   42     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !0
          6        CONCAT                                           ~5      !1, !2
          7        SEND_VAL                                                 ~5
          8        SEND_REF                                                 !3
          9        DO_ICALL                                                 
   43    10        INIT_FCALL                                               'acceptone'
         11        SEND_VAR                                                 !3
         12        DO_FCALL                                      0          
   41    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 5000
         15      > JMPNZ                                                    ~9, ->4
   45    16    > > RETURN                                                   null

End of Dynamic Function 2

Dynamic Function 3
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/JKn6D
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $regexDummyWithS, !1 = $testStr, !2 = $i, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   BIND_GLOBAL                                              !0, 'regexDummyWithS'
          1        BIND_GLOBAL                                              !1, 'testStr'
   50     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->14
   51     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !0
          6        CONCAT                                           ~5      !1, !2
          7        SEND_VAL                                                 ~5
          8        SEND_REF                                                 !3
          9        DO_ICALL                                                 
   52    10        INIT_FCALL                                               'acceptone'
         11        SEND_VAR                                                 !3
         12        DO_FCALL                                      0          
   50    13        PRE_INC                                                  !2
         14    >   IS_SMALLER                                               !2, 5000
         15      > JMPNZ                                                    ~9, ->4
   54    16    > > RETURN                                                   null

End of Dynamic Function 3

Function acceptone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JKn6D
function name:  acceptOne
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function acceptone

Function makeregexfromlistdummy:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/JKn6D
function name:  makeRegexFromListDummy
number of ops:  24
compiled vars:  !0 = $values, !1 = $regex, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   59     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   63     4        SEND_VAL                                                 ~3
   59     5        DO_ICALL                                                 
   65     6        ASSIGN                                                   !1, '%28%3F%3E'
   67     7      > FE_RESET_R                                       $6      !0, ->18
          8    > > FE_FETCH_R                                               $6, !2, ->18
   68     9    >   IS_NOT_IDENTICAL                                         !1, '%28%3F%3E'
         10      > JMPZ                                                     ~7, ->12
   69    11    >   ASSIGN_OP                                     8          !1, '%7C'
   72    12    >   INIT_FCALL                                               'preg_quote'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 '%2F'
         15        DO_ICALL                                         $9      
         16        ASSIGN_OP                                     8          !1, $9
   67    17      > JMP                                                      ->8
         18    >   FE_FREE                                                  $6
   75    19        CONCAT                                           ~11     !1, '%29'
         20        VERIFY_RETURN_TYPE                                       ~11
         21      > RETURN                                                   ~11
   76    22*       VERIFY_RETURN_TYPE                                       
         23*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/JKn6D
function name:  {closure}
number of ops:  22
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   60     2        INIT_FCALL                                               'str_starts_with'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPNZ_EX                                         ~3      $2, ->12
          7    >   INIT_FCALL                                               'str_starts_with'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        BOOL                                             ~3      $4
         12    > > JMPZ                                                     ~3, ->18
   61    13    >   STRLEN                                           ~5      !1
         14        STRLEN                                           ~6      !0
         15        SPACESHIP                                        ~7      ~5, ~6
         16        QM_ASSIGN                                        ~8      ~7
         17      > JMP                                                      ->20
   62    18    >   SPACESHIP                                        ~9      !0, !1
         19        QM_ASSIGN                                        ~8      ~9
         20    > > RETURN                                                   ~8
   63    21*     > RETURN                                                   null

End of Dynamic Function 0

End of function makeregexfromlistdummy

Function makeregexfromlistoptimized:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 52
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 52
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 39
Branch analysis from position: 51
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 39
Branch analysis from position: 51
Branch analysis from position: 39
Branch analysis from position: 32
Branch analysis from position: 27
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 59
Branch analysis from position: 55
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 105
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 105
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 66
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 70
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 92
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 70
Branch analysis from position: 66
Branch analysis from position: 105
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 105
Branch analysis from position: 59
Branch analysis from position: 52
Branch analysis from position: 9
filename:       /in/JKn6D
function name:  makeRegexFromListOptimized
number of ops:  111
compiled vars:  !0 = $values, !1 = $sorted, !2 = $valuesBySharedPrefix, !3 = $items, !4 = $prefix, !5 = $v, !6 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   81     2        BOOL_NOT                                         ~7      !1
          3      > JMPZ                                                     ~7, ->9
   82     4    >   INIT_FCALL                                               'usort'
          5        SEND_REF                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
   86     7        SEND_VAL                                                 ~8
   82     8        DO_ICALL                                                 
   90     9    >   ASSIGN                                                   !2, <array>
   91    10        ASSIGN                                                   !3, <array>
   92    11        ASSIGN                                                   !4, null
   94    12      > FE_RESET_R                                       $13     !0, ->52
         13    > > FE_FETCH_R                                               $13, !5, ->52
   95    14    >   TYPE_CHECK                                  1020  ~14     !4
         15      > JMPZ_EX                                          ~14     ~14, ->27
         16    >   INIT_FCALL                                               'str_starts_with'
         17        SEND_VAR                                                 !5
         18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !4
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 1
         22        DO_ICALL                                         $15     
         23        SEND_VAR                                                 $15
         24        DO_ICALL                                         $16     
         25        BOOL_NOT                                         ~17     $16
         26        BOOL                                             ~14     ~17
         27    > > JMPZ                                                     ~14, ->32
   96    28    >   ASSIGN_DIM                                               !2, !4
         29        OP_DATA                                                  !3
   97    30        ASSIGN                                                   !3, <array>
   98    31        ASSIGN                                                   !4, null
  101    32    >   ASSIGN_DIM                                               !3
         33        OP_DATA                                                  !5
  103    34        TYPE_CHECK                                    2          !4
         35      > JMPZ                                                     ~22, ->38
  104    36    >   ASSIGN                                                   !4, !5
  103    37      > JMP                                                      ->51
  106    38    > > JMP                                                      ->45
  107    39    >   INIT_FCALL                                               'substr'
         40        SEND_VAR                                                 !4
         41        SEND_VAL                                                 0
         42        SEND_VAL                                                 -1
         43        DO_ICALL                                         $24     
         44        ASSIGN                                                   !4, $24
  106    45    >   INIT_FCALL                                               'str_starts_with'
         46        SEND_VAR                                                 !5
         47        SEND_VAR                                                 !4
         48        DO_ICALL                                         $26     
         49        BOOL_NOT                                         ~27     $26
         50      > JMPNZ                                                    ~27, ->39
   94    51    > > JMP                                                      ->13
         52    >   FE_FREE                                                  $13
  112    53        IS_NOT_IDENTICAL                                         !3, <array>
         54      > JMPZ                                                     ~28, ->59
  113    55    >   ASSIGN_DIM                                               !2, !4
         56        OP_DATA                                                  !3
  114    57        ASSIGN                                                   !3, <array>
  115    58        ASSIGN                                                   !4, null
  118    59    >   ASSIGN                                                   !6, '%28%3F%3E'
  120    60      > FE_RESET_R                                       $33     !2, ->105
         61    > > FE_FETCH_R                                       ~34     $33, !3, ->105
         62    >   ASSIGN                                                   !4, ~34
  121    63        IS_NOT_IDENTICAL                                         !6, '%28%3F%3E'
         64      > JMPZ                                                     ~36, ->66
  122    65    >   ASSIGN_OP                                     8          !6, '%7C'
  125    66    >   TYPE_CHECK                                   16          !4
         67      > JMPZ                                                     ~38, ->70
  126    68    >   CAST                                          6  ~39     !4
         69        ASSIGN                                                   !4, ~39
  129    70    >   INIT_FCALL                                               'preg_quote'
         71        SEND_VAR                                                 !4
         72        SEND_VAL                                                 '%2F'
         73        DO_ICALL                                         $41     
         74        ASSIGN_OP                                     8          !6, $41
  131    75        COUNT                                            ~43     !3
         76        IS_IDENTICAL                                             ~43, 1
         77      > JMPZ                                                     ~44, ->92
  132    78    >   INIT_FCALL                                               'preg_quote'
         79        INIT_FCALL                                               'substr'
         80        INIT_FCALL                                               'reset'
         81        SEND_REF                                                 !3
         82        DO_ICALL                                         $45     
         83        SEND_VAR                                                 $45
         84        STRLEN                                           ~46     !4
         85        SEND_VAL                                                 ~46
         86        DO_ICALL                                         $47     
         87        SEND_VAR                                                 $47
         88        SEND_VAL                                                 '%2F'
         89        DO_ICALL                                         $48     
         90        QM_ASSIGN                                        ~49     $48
         91      > JMP                                                      ->103
  133    92    >   INIT_FCALL_BY_NAME                                       'makeRegexFromListOptimized'
         93        INIT_FCALL                                               'array_map'
         94        DECLARE_LAMBDA_FUNCTION                          ~50     [1]
         95        BIND_LEXICAL                                             ~50, !4
         96        SEND_VAL                                                 ~50
         97        SEND_VAR                                                 !3
         98        DO_ICALL                                         $51     
         99        SEND_VAR_NO_REF_EX                                       $51
        100        SEND_VAL_EX                                              <true>
        101        DO_FCALL                                      0  $52     
        102        QM_ASSIGN                                        ~49     $52
        103    >   ASSIGN_OP                                     8          !6, ~49
  120   104      > JMP                                                      ->61
        105    >   FE_FREE                                                  $33
  136   106        CONCAT                                           ~54     !6, '%29'
        107        VERIFY_RETURN_TYPE                                       ~54
        108      > RETURN                                                   ~54
  137   109*       VERIFY_RETURN_TYPE                                       
        110*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.12 ms | 1052 KiB | 27 Q