3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function guidv4() { $data = openssl_random_pseudo_bytes(16); $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010 $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } echo guidv4(); ?>
Output for 7.1.0
69c54709-2fe5-40b6-a8f3-103b8864a35c
Output for 7.0.14
62402b7c-16bd-43cf-9c8d-6feb4d133215
Output for 7.0.7
4e9f4906-533b-46f4-8cb5-8fe185c12957
Output for 7.0.6
bbaacfd8-fc89-4ee2-8e5f-0bd74a8ac734
Output for 7.0.5
0108c57c-2cd1-40fc-b687-2a34b6902654
Output for 7.0.4
eb3e89a0-993c-460d-964d-1963644e004d
Output for 7.0.3
a12bd7b5-c5b3-44a0-b36b-ca8452a57548
Output for 7.0.2
0fe10009-ff30-49a0-95f0-57c2c885ecbc
Output for 7.0.1
1e3e0f8a-2399-453a-b6dd-5bc672e46d9e
Output for 7.0.0
a493d986-1ad8-4e25-86dd-aaa939c53f49
Output for hhvm-3.12.0
fab13f43-dcf2-4b4f-b0ba-bc967d929b12
Output for hhvm-3.10.0
56c8e73a-ec7e-4f8e-97fb-9d0ce400dfe1
Output for 5.6.28
78da7631-becd-4d4e-8a92-020ba505dc84
Output for 5.6.22
d3194675-a6cc-4760-a63e-8d7b3f4fb6ee
Output for 5.6.21
610ed712-0691-4b8f-8f5b-ca29f764d792
Output for 5.6.20
9b28115d-fb72-4f74-8f97-098849684381
Output for 5.6.19
d759cbe6-3094-48f0-86e1-491bf0b25bb5
Output for 5.6.18
2d9681e5-ca06-471b-a90c-fb7f0133cb20
Output for 5.6.17
346aa0ed-eccd-42bc-84a7-721a22de7d6e
Output for 5.6.16
0d1ba05a-be4b-4ec7-98aa-aa9f6c2aea5a
Output for 5.6.15
85dbd6fd-e59e-47f5-96b9-b571f9aab48e
Output for 5.6.14
e179216b-17b4-4384-8bd3-51d8429d4147
Output for 5.6.13
0412baee-e326-4253-ac57-3aff33b71456
Output for 5.6.12
149864e8-4912-4a14-81e2-c27a951a1746
Output for 5.6.11
ccddcc5d-5e78-4ea1-8a99-853ba635ef95
Output for 5.6.10
373c42b3-cc1d-4d51-bb7b-fd916f895d0d
Output for 5.6.9
86f60424-ee1a-424f-a3ef-39aff6b84717
Output for 5.6.8
75642c55-dcf1-4fb4-9dbf-b136be982c04
Output for 5.6.7
21bf21e7-bd10-43cf-9348-c7a7fc5eccfa
Output for 5.6.6
6c1032ed-0bc8-4088-9617-32cf407e0dc3
Output for 5.6.5
40e44149-1a52-4d4f-b4e2-f6e89d569655
Output for 5.6.4
615b4187-ab1d-4d6a-9901-d24db6570c3a
Output for 5.6.3
799bea04-2bc6-41cd-87a3-375535505647
Output for 5.6.2
298e448e-1919-44a1-8314-3447327df97e
Output for 5.6.1
4c49fb94-83be-4946-bf22-1013cd399eef
Output for 5.6.0
cbf654cc-d2ad-48b1-95ca-2f05286af979
Output for 5.5.36
01a41b10-2010-4f38-b7ab-0ba21d9f085d
Output for 5.5.35
c91d590c-1661-4eb2-a392-f147395275a3
Output for 5.5.34
3e13a762-1530-4c83-b9a5-e16f6ec6ec32
Output for 5.5.33
41f02e51-9e3d-4013-be9c-172a9ccb12c4
Output for 5.5.32
3782ad4d-dfbc-4a3b-af0c-fc987679e14b
Output for 5.5.31
3305e310-2924-45f3-af5e-49d2687853dd
Output for 5.5.30
2f3667a8-8320-4f9c-ad70-15f4d6971daf
Output for 5.5.29
52d3f91a-00fc-4476-acf4-d8881cf254fc
Output for 5.5.28
d8902c6b-af76-47bd-979b-6c2eb0e8092e
Output for 5.5.27
57b3117a-47a1-46af-9482-b52fcdccb752
Output for 5.5.26
3eac14aa-f900-41b1-83ef-ca46d15a74e2
Output for 5.5.25
febb1fc7-db76-4900-8c55-5652c5eff936
Output for 5.5.24
0235d60e-6dfd-46c9-aff9-ac48c5c24e57
Output for 5.5.23
02627022-1277-400d-983e-5ab246991866
Output for 5.5.22
19aeae7c-ab91-440d-bfa3-62a04f4c23a5
Output for 5.5.21
51963cad-aeef-4023-af6e-6344bdc5a0a3
Output for 5.5.20
19746d33-ff1b-4cca-9f7d-137e835c3f3f
Output for 5.5.19
b7af83ce-cc47-4dbb-a459-40f6b29d2aec
Output for 5.5.18
90137ff2-c7e6-44eb-ac88-66c7c8fba9f9
Output for 5.5.16
9b3da88f-a65f-46b3-b0c0-4a4ecd0178e7
Output for 5.5.15
3f55ea6d-2059-4607-802b-e25e9df53e4c
Output for 5.5.14
eefa208f-3237-4a54-afc5-70667d337d13
Output for 5.5.13
76ee1bd5-9579-4ad4-a097-8ccc5d20d867
Output for 5.5.12
a5251b87-24ed-4747-9068-d6c4e321f582
Output for 5.5.11
7b086239-936f-4f4f-874c-64373f80c8d3
Output for 5.5.10
b8134866-26cb-49dc-94b9-a7d1448a5801
Output for 5.5.9
6bde1c4e-f05c-44a6-9212-8ac0029f99e1
Output for 5.5.8
3abf48ed-bd93-4105-96c6-b5753a0756fe
Output for 5.5.7
2b8c6b53-4cbb-418e-ad67-92bad7efbed3
Output for 5.5.6
0e4f7530-6561-4e39-9950-9ec8ea97aa0b
Output for 5.5.5
11d0d2a8-5c83-4848-8e7c-111fa54b8d66
Output for 5.5.4
70d913ec-3f0d-4a74-a07e-257e91b6bc75
Output for 5.5.3
dc988ca6-e343-4f55-8a91-978b7ae3676a
Output for 5.5.2
fed96702-49e3-4a70-b138-9ee95cab13b2
Output for 5.5.1
7a3eca90-0b9d-4ecf-b352-02b317229a6e
Output for 5.5.0
a5ac957b-ac2b-490c-b1f7-7029d652323c
Output for 5.4.45
f5c48576-aa20-424a-b726-dd90814003b8
Output for 5.4.44
16fdc9ac-81d0-4bde-876b-acee32c66dcc
Output for 5.4.43
1c7febc3-2fcf-44f0-ac06-5aba1ea429f2
Output for 5.4.42
c71cd24e-9719-4c99-8cbe-8b42ff3a96d4
Output for 5.4.41
243c8174-63b6-4871-b707-543d2083f822
Output for 5.4.40
6ac8e48c-b984-436d-9baf-0faa3780ce3b
Output for 5.4.39
bcefc5d4-4ed3-4512-a757-036a8c29da5c
Output for 5.4.38
e4237ad8-f910-4476-baf3-5f0933d946ca
Output for 5.4.37
3b0189e0-3624-4b27-bcb5-4e72424ceee5
Output for 5.4.36
a3c75468-2b2f-4441-822d-2d5b838b17ac
Output for 5.4.35
cbdaadbc-baba-4c9d-9ad7-7fdb88cda24f
Output for 5.4.34
b68ade55-0e38-4738-8370-85b88fb5cf59
Output for 5.4.32
83d012b2-1901-42c0-8d88-f8ae5976f95a
Output for 5.4.31
a7986773-4325-444b-9a93-e2f42b91c164
Output for 5.4.30
c9a9b1b2-1991-4587-9952-74738d2b4e84
Output for 5.4.29
2a34cd35-d583-4b87-b114-83c2e0031131
Output for 5.4.28
481f025d-e3ce-45c1-b047-7c8f99435579
Output for 5.4.27
1a379eac-99cd-4043-931d-58e3b38fe754
Output for 5.4.26
78ae798e-6543-4d90-9d79-b2a32735f36b
Output for 5.4.25
9e83240c-7d6b-4a46-a682-122a66160c19
Output for 5.4.24
9dfdb9c5-e3e1-4733-9cc3-da2b1325cc8c
Output for 5.4.23
de628a0a-ca35-4776-9071-603d83e02d9b
Output for 5.4.22
3e63371c-300a-41f5-927f-cc64574f74f4
Output for 5.4.21
2e045c49-bd68-42f0-83c2-9b6d9a376ba4
Output for 5.4.20
2632f384-f66e-4e3b-9d47-a31c61661138
Output for 5.4.19
15d130b0-7bea-4625-8c11-acd22edf7a5c
Output for 5.4.18
768bb903-7ae1-4fb9-bd65-7b653c5effb3
Output for 5.4.17
c8e716eb-f1f2-4898-a4cd-c1f9f527d824
Output for 5.4.16
19c3dbff-3e77-4af9-adff-31f4c744aff3
Output for 5.4.15
6f164c82-05cd-4dc8-9465-0940af65931b
Output for 5.0.0 - 5.4.14
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/vbmhH on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/vbmhH on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/vbmhH on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/vbmhH on line 4