3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Tasodifiy kod generatsiya qiluvchi funksiya function generateFormattedCode() { // Harflar va raqamlar to'plami $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); // Format: GAME-XXXX-XXXX-XXXX-XXXX $format = 'GAME-XXXX-XXXX-XXXX-XXXX'; $formattedCode = ''; // Format bo'yicha kod yaratish for ($i = 0; $i < strlen($format); $i++) { if ($format[$i] === 'X') { $formattedCode .= $characters[rand(0, $charactersLength - 1)]; } else { $formattedCode .= $format[$i]; } } return $formattedCode; } // Bir necha o'yin kodi generatsiya qilish function generateMultipleCodes($count) { $codes = []; // $count miqdorida kod yaratish for ($i = 0; $i < $count; $i++) { $codes[] = generateFormattedCode(); } return $codes; } // 10 ta kod generatsiya qilish $gameCodes = generateMultipleCodes(4); // Natijani ko'rsatish foreach ($gameCodes as $code) { echo $code . PHP_EOL; } ?>
Output for git.master_jit
GAME-HC2X-RU28-WJF5-ZZLI GAME-ZZ9Z-7QGS-3LWQ-TXZ6 GAME-SVVQ-4PDM-UN5S-FS5D GAME-67YP-XO2S-M6Z0-Z1AK
Output for git.master
GAME-6NFR-D7NU-72ZT-I0WM GAME-GFQC-FJOL-487F-NUM8 GAME-CNX2-BO9P-8GZG-9BEE GAME-2AEQ-ADGU-O9N4-UHYO

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.19 ms | 406 KiB | 5 Q