3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string="developer"; $consonants=[]; for($offset=0, $length=strlen($string); $offset<$length; ++$offset){ // iterate each letter of the string if(strpos('aeiou',$string[$offset])===false){ // isolate the consonants $consonants[]=$string[$offset]; // store the consonant $offsets[]=$offset; // store the offset (aka indexed position of the consonant in the string) } } shuffle($consonants); // shuffle the array of stored consonants foreach($consonants as $index=>$consonant){ // iterate only the stored consonants $string[$offsets[$index]]=$consonant; // reassign the consonants in their new positions } echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
Branch analysis from position: 15
filename:       /in/YFtvv
function name:  (null)
number of ops:  31
compiled vars:  !0 = $string, !1 = $consonants, !2 = $offset, !3 = $length, !4 = $offsets, !5 = $consonant, !6 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'developer'
    3     1        ASSIGN                                                       !1, <array>
    4     2        ASSIGN                                                       !2, 0
          3        STRLEN                                               ~10     !0
          4        ASSIGN                                                       !3, ~10
          5      > JMP                                                          ->16
    5     6    >   FETCH_DIM_R                                          ~12     !0, !2
          7        FRAMELESS_ICALL_2                strpos              ~13     'aeiou', ~12
          8        TYPE_CHECK                                        4          ~13
          9      > JMPZ                                                         ~14, ->15
    6    10    >   FETCH_DIM_R                                          ~16     !0, !2
         11        ASSIGN_DIM                                                   !1
         12        OP_DATA                                                      ~16
    7    13        ASSIGN_DIM                                                   !4
         14        OP_DATA                                                      !2
    4    15    >   PRE_INC                                                      !2
         16    >   IS_SMALLER                                                   !2, !3
         17      > JMPNZ                                                        ~19, ->6
   10    18    >   INIT_FCALL                                                   'shuffle'
         19        SEND_REF                                                     !1
         20        DO_ICALL                                                     
   12    21      > FE_RESET_R                                           $21     !1, ->28
         22    > > FE_FETCH_R                                           ~22     $21, !5, ->28
         23    >   ASSIGN                                                       !6, ~22
   13    24        FETCH_DIM_R                                          ~24     !4, !6
         25        ASSIGN_DIM                                                   !0, ~24
         26        OP_DATA                                                      !5
   12    27      > JMP                                                          ->22
         28    >   FE_FREE                                                      $21
   16    29        ECHO                                                         !0
   17    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.93 ms | 1220 KiB | 14 Q