3v4l.org

run code in 500+ PHP versions simultaneously
<?php $words = ["apple", "sample", "app", "justappgg", "тоҷик", "отабек", "баҳодурбек", "APELCIN", "API", "pap"]; mb_internal_encoding("UTF-8"); $items = [ "api", "ppal", "ap", "papp" ]; foreach ($items as $item) { foreach ($words as $word) { $wordSplit = preg_split('//u', $word, null, PREG_SPLIT_NO_EMPTY); $strSplit = preg_split('//u', $item, null, PREG_SPLIT_NO_EMPTY); $wordSplit = array_filter($wordSplit, function ($x) use (&$strSplit) { if (in_array(strtolower($x), array_map('strtolower', $strSplit), true)) { $pos = array_search(strtolower($x), array_map('strtolower', $strSplit), true); unset($strSplit[$pos]); return false; } return true; }); if (count($strSplit) === 0) { echo "$word contains all letters of $item" . PHP_EOL; } } echo PHP_EOL; }

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 42
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 42
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 39
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 39
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 39
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/E4Jgr
function name:  (null)
number of ops:  44
compiled vars:  !0 = $words, !1 = $items, !2 = $item, !3 = $word, !4 = $wordSplit, !5 = $strSplit
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        INIT_FCALL                                                   'mb_internal_encoding'
          2        SEND_VAL                                                     'UTF-8'
          3        DO_ICALL                                                     
    5     4        ASSIGN                                                       !1, <array>
   13     5      > FE_RESET_R                                           $9      !1, ->42
          6    > > FE_FETCH_R                                                   $9, !2, ->42
   14     7    > > FE_RESET_R                                           $10     !0, ->39
          8    > > FE_FETCH_R                                                   $10, !3, ->39
   15     9    >   INIT_FCALL                                                   'preg_split'
         10        SEND_VAL                                                     '%2F%2Fu'
         11        SEND_VAR                                                     !3
         12        SEND_VAL                                                     null
         13        SEND_VAL                                                     1
         14        DO_ICALL                                             $11     
         15        ASSIGN                                                       !4, $11
   16    16        INIT_FCALL                                                   'preg_split'
         17        SEND_VAL                                                     '%2F%2Fu'
         18        SEND_VAR                                                     !2
         19        SEND_VAL                                                     null
         20        SEND_VAL                                                     1
         21        DO_ICALL                                             $13     
         22        ASSIGN                                                       !5, $13
   17    23        INIT_FCALL                                                   'array_filter'
         24        SEND_VAR                                                     !4
         25        DECLARE_LAMBDA_FUNCTION                              ~15     [0]
         26        BIND_LEXICAL                                                 ~15, !5
   24    27        SEND_VAL                                                     ~15
   17    28        DO_ICALL                                             $16     
         29        ASSIGN                                                       !4, $16
   25    30        COUNT                                                ~18     !5
         31        IS_IDENTICAL                                                 ~18, 0
         32      > JMPZ                                                         ~19, ->38
   26    33    >   ROPE_INIT                                         3  ~21     !3
         34        ROPE_ADD                                          1  ~21     ~21, '+contains+all+letters+of+'
         35        ROPE_END                                          2  ~20     ~21, !2
         36        CONCAT                                               ~23     ~20, '%0A'
         37        ECHO                                                         ~23
   14    38    > > JMP                                                          ->8
         39    >   FE_FREE                                                      $10
   29    40        ECHO                                                         '%0A'
   13    41      > JMP                                                          ->6
         42    >   FE_FREE                                                      $9
   30    43      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E4Jgr
function name:  {closure:/in/E4Jgr:17}
number of ops:  29
compiled vars:  !0 = $x, !1 = $strSplit, !2 = $pos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   18     2        INIT_FCALL                                                   'strtolower'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $3      
          5        INIT_FCALL                                                   'array_map'
          6        SEND_VAL                                                     'strtolower'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                             $4      
          9        FRAMELESS_ICALL_3                in_array            ~5      $3, $4
         10        OP_DATA                                                      <true>
         11      > JMPZ                                                         ~5, ->27
   19    12    >   INIT_FCALL                                                   'array_search'
         13        INIT_FCALL                                                   'strtolower'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                             $6      
         16        SEND_VAR                                                     $6
         17        INIT_FCALL                                                   'array_map'
         18        SEND_VAL                                                     'strtolower'
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                             $7      
         21        SEND_VAR                                                     $7
         22        SEND_VAL                                                     <true>
         23        DO_ICALL                                             $8      
         24        ASSIGN                                                       !2, $8
   20    25        UNSET_DIM                                                    !1, !2
   21    26      > RETURN                                                       <false>
   23    27    > > RETURN                                                       <true>
   24    28*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
208.71 ms | 3295 KiB | 19 Q