3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Utils { public static function guid() { return sprintf("%04X%04X-%04X-%04X-%04X-%04X%04X%04X", rand(0, 65535), rand(0, 65535), rand(0, 65535), rand(16384, 20479), rand(32768, 49151), rand(0, 65535), rand(0, 65535), rand(0, 65535)); } } $count = 1000000; $i = 0; $time = microtime(true); while ($i++ < $count) { Utils::guid(); } echo "total: " . (microtime(true) - $time) . "\n"; echo Utils::guid();
Output for 5.4.0 - 5.4.1, 5.4.4 - 5.4.16, 5.4.20 - 5.4.32, 5.4.34, 5.4.36 - 5.4.41, 5.5.0, 5.5.3 - 5.5.16, 5.5.18, 5.5.20 - 5.5.21, 5.5.23 - 5.5.24, 5.6.0 - 5.6.1, 5.6.9

Process exited with code 137.
Output for 5.6.8
total: 2.2512819766998 BB954FFF-190B-47AB-B80E-A59E65BA011D
Output for 5.6.7
total: 2.0351541042328 EED1DCFC-FE42-465A-B65E-3D629444A34D
Output for 5.6.6
total: 2.116171836853 65949C0B-9E20-4AD3-B7D6-3478B4CD3DCC
Output for 5.6.5
total: 2.3088071346283 71680208-FA68-4547-B6BA-E455DF3CEF22
Output for 5.6.4
total: 2.1944758892059 2D34EA52-5055-4D0D-855F-6F0B66E87274
Output for 5.6.3
total: 2.2026200294495 2AEAE19D-3458-4FA5-9867-37FD065AB0FA
Output for 5.6.2
total: 2.4465160369873 024B5E5D-0773-449D-9E63-D9716685B957
Output for 5.5.25
total: 2.3607981204987 092E1BBF-8560-42C1-ABA8-722804A0A904
Output for 5.5.22
total: 2.2274339199066 F44FCFF6-0370-4EF9-89D0-6AB947360E33
Output for 5.5.19
total: 2.44517993927 82B20CAD-65F9-44DD-8A9A-86EDA18E6CC3
Output for 5.5.17
total: 2.2556190490723 EC55AB39-B970-457B-9B9E-98C95C0A2D1D
Output for 5.5.2
total: 2.0823922157288 AD8A2D9F-EBBD-489A-B49E-92DE70E395FE
Output for 5.5.1
total: 2.3879148960114 FC3A5954-7A30-4588-A74E-E64FEEB9306E
Output for 5.4.35
total: 2.1748058795929 5142C8E8-3AFD-4D3D-9772-AEABCA2DEE15
Output for 5.4.33
total: 2.4076659679413 35741D9C-EF2F-4D5C-A227-E438A9820D62
Output for 5.4.19
total: 1.9964430332184 B1D45CCC-8A51-4F3C-A36C-7AE38FCF8322
Output for 5.4.18
total: 2.2763550281525 D2938BD3-AAF6-4E46-B691-94D67495AE60
Output for 5.4.17
total: 2.2026479244232 B79B350F-ADC2-4015-83E5-FCDE825293D5
Output for 5.4.3
total: 2.2540521621704 C24F7B9E-325D-46E7-9BA2-814ED397EBB5
Output for 5.4.2
total: 2.1220560073853 9F3C28B2-28C8-4F40-BE6C-18CBCCEB563E

preferences:
102.65 ms | 401 KiB | 83 Q