3v4l.org

run code in 300+ PHP versions simultaneously
<?php $words = "systematic,gear,synthesis,mysterious"; $words=explode(",",$words); $your_array = preg_grep('~(?=[^s]*s)(?=[^m]*m)(?=[^e]*e)~', $words);; foreach ($words as $w) { if (strpos($w, array('s', 'e', 'm')) == 0) { echo $w; } } print_r($your_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/f8T3X
function name:  (null)
number of ops:  26
compiled vars:  !0 = $words, !1 = $your_array, !2 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'systematic%2Cgear%2Csynthesis%2Cmysterious'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    6     6        INIT_FCALL                                               'preg_grep'
          7        SEND_VAL                                                 '%7E%28%3F%3D%5B%5Es%5D%2As%29%28%3F%3D%5B%5Em%5D%2Am%29%28%3F%3D%5B%5Ee%5D%2Ae%29%7E'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    8    11      > FE_RESET_R                                       $8      !0, ->21
         12    > > FE_FETCH_R                                               $8, !2, ->21
    9    13    >   INIT_FCALL                                               'strpos'
         14        SEND_VAR                                                 !2
         15        SEND_VAL                                                 <array>
         16        DO_ICALL                                         $9      
         17        IS_EQUAL                                                 $9, 0
         18      > JMPZ                                                     ~10, ->20
   10    19    >   ECHO                                                     !2
    8    20    > > JMP                                                      ->12
         21    >   FE_FREE                                                  $8
   15    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.05 ms | 1396 KiB | 21 Q