3v4l.org

run code in 300+ PHP versions simultaneously
<?php $word="developer"; $shuffled_consonants=str_shuffle(str_replace(['a','e','i','o','u'],'',$word)); // generate shuffled string of consonants // reinsert shuffled consonants at original consonant positions echo preg_replace_callback( '~[^aeiou]~', // match each consonant at original position function($m)use($shuffled_consonants){ // pass in the shuffled string static $offset=0; // init the offset counter return $shuffled_consonants[$offset++]; // insert new consonant at original position using post-incrementation }, $word);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.20.0230.01018.26
7.2.10.0200.01318.40
7.2.00.0260.00918.22
7.1.140.0220.00917.13
7.1.130.0200.01217.09
7.1.120.0170.01317.08
7.1.110.0200.01316.59
7.1.100.0170.00916.43
7.1.90.0180.01316.35
7.1.80.0240.00816.25
7.1.70.0290.00915.53
7.1.60.0360.00833.61
7.1.50.0330.00733.06
7.1.40.0220.01732.77
7.1.30.0390.01032.99
7.1.20.0280.02033.06
7.1.10.0200.00814.98
7.1.00.0240.00815.15

preferences:
31.65 ms | 403 KiB | 5 Q