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: CUBE-XXXX-XXXX-XXXX-XXXX $format = 'CUBE-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.0390.00316.53
8.3.110.0300.01316.39
8.3.100.0390.00716.61
8.3.90.0370.00916.27
8.3.80.0220.00716.58
8.3.70.0380.01016.66
8.3.60.0460.00316.19
8.3.50.0430.00716.55
8.3.40.0340.00917.43
8.3.30.0270.01017.53
8.3.20.0260.01317.34
8.3.10.0290.01017.34
8.3.00.0170.00717.34
8.2.240.0300.00316.33
8.2.230.0190.00016.58
8.2.220.0090.00916.71
8.2.210.0250.00416.36
8.2.200.0130.00516.35
8.2.190.0300.00916.61
8.2.180.0320.00616.50
8.2.170.0320.00317.44
8.2.160.0390.00317.59
8.2.150.0320.01117.60
8.2.140.0340.00717.47
8.2.130.0450.00717.30
8.2.120.0240.01417.54
8.2.110.0210.00017.47
8.2.100.0160.00517.44
8.2.90.0200.00017.72
8.2.80.0380.00317.54
8.2.70.0350.00517.52
8.2.60.0320.00917.50
8.2.50.0310.01017.35
8.2.40.0360.00717.43
8.2.30.0350.01217.52
8.2.20.0350.01017.01
8.2.10.0280.01117.46
8.2.00.0330.00817.41
8.1.300.0280.01416.03
8.1.290.0280.01616.04
8.1.280.0220.01615.98
8.1.270.0310.01017.12
8.1.260.0350.00617.36
8.1.250.0390.00317.39
8.1.240.0320.00517.24
8.1.230.0230.01317.05
8.1.220.0270.01017.33
8.1.210.0280.01217.04
8.1.200.0310.00917.15
8.1.190.0320.00517.02
8.1.180.0230.01417.09
8.1.170.0240.01217.04
8.1.160.0330.00417.04
8.1.150.0320.00517.26
8.1.140.0230.01317.02
8.1.130.0290.00817.13
8.1.120.0320.00417.10
8.1.110.0280.00617.19
8.1.100.0310.00617.32
8.1.90.0230.01317.21
8.1.80.0280.00917.11
8.1.70.0230.01417.06
8.1.60.0300.01117.22
8.1.50.0260.01717.02
8.1.40.0420.00017.15
8.1.30.0310.00917.12
8.1.20.0410.00017.20
8.1.10.0340.00617.11
8.1.00.0250.01817.11

preferences:
32.61 ms | 403 KiB | 5 Q