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; } ?>

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)
8.3.120.0440.01016.41
8.3.110.0340.01016.32
8.3.100.0410.00616.70
8.3.90.0400.00716.71
8.3.80.0420.00016.38
8.3.70.0370.01116.11
8.3.60.0320.00716.23
8.3.50.0220.00016.61
8.3.40.0200.00317.36
8.3.30.0260.00517.41
8.3.20.0190.00316.86
8.3.10.0210.00517.30
8.3.00.0190.00317.51
8.2.240.0330.00716.59
8.2.230.0300.01016.50
8.2.220.0290.00716.58
8.2.210.0280.00616.50
8.2.200.0240.01416.55
8.2.190.0230.01616.54
8.2.180.0330.00716.03
8.2.170.0400.00617.66
8.2.160.0300.01517.42
8.2.150.0360.00617.54
8.2.140.0320.01117.48
8.2.130.0310.01017.59
8.2.120.0250.01817.53
8.2.110.0400.00417.45
8.2.100.0310.01217.48
8.2.90.0300.01417.55
8.2.80.0390.00717.36
8.2.70.0270.00017.55
8.2.60.0170.00317.39
8.2.50.0170.01317.08
8.2.40.0190.00017.37
8.2.30.0210.00017.34
8.2.20.0320.00817.51
8.2.10.0240.00617.25
8.2.00.0110.00717.40
8.1.300.0210.00915.83
8.1.290.0240.00315.54
8.1.280.0180.01115.72
8.1.270.0250.01517.21
8.1.260.0320.01017.23
8.1.250.0200.00717.35
8.1.240.0240.00417.15
8.1.230.0260.00717.02
8.1.220.0240.00817.09
8.1.210.0400.00017.37
8.1.200.0300.00716.84
8.1.190.0290.00817.18
8.1.180.0290.00917.25
8.1.170.0340.00317.08
8.1.160.0320.00517.21
8.1.150.0210.01716.86
8.1.140.0270.00917.15
8.1.130.0340.00317.13
8.1.120.0320.00417.35
8.1.110.0260.00617.15
8.1.100.0270.00817.16
8.1.90.0330.01217.22
8.1.80.0230.01317.45
8.1.70.0310.00617.38
8.1.60.0300.01017.40
8.1.50.0320.00417.18
8.1.40.0270.01717.48
8.1.30.0280.01017.45
8.1.20.0340.00017.38
8.1.10.0300.00317.15
8.1.00.0250.00717.34

preferences:
19.81 ms | 403 KiB | 5 Q