3v4l.org

run code in 300+ 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;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
158.83 ms | 1230 KiB | 12 Q