3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function uuid($c = 4) { $x = function($c) { for ($n = ''; strlen($n) < $c + 1; $n = $n.mt_rand()); return substr($n, -$c); }; return sprintf( '%s-%04d-%04d-%04d-%04d%04d%04d', time(), $x($c), $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } echo uuid();
based on 9ttt4
Output for 7.1.0
1410543253-3248-0185-9377-610130194057
Output for 7.0.14
1410543253-8020-6548-5864-245199313095
Output for 7.0.11
1410543253-8938-8318-8706-523804502968
Output for 7.0.10
1410543253-4109-1054-8249-275569160080
Output for 7.0.9
1410543253-2747-5412-6761-093650798355
Output for 7.0.8
1410543253-3358-9870-3770-455016996754
Output for 7.0.7
1410543253-4022-3117-2570-636288845007
Output for 7.0.6
1410543253-0365-0175-3707-132879763238
Output for 7.0.5
1410543253-8931-9283-5736-647033504742
Output for 7.0.4
1410543253-1966-7653-8771-829958019257
Output for 7.0.3
1410543253-4698-7709-7907-652740327840
Output for 7.0.2
1410543253-2709-7980-9610-887264237539
Output for 7.0.1
1410543253-0264-2821-2980-002263130600
Output for 7.0.0
1410543253-7017-3831-5975-467468436085
Output for 5.6.28
1410543253-9873-6481-2780-148307679504
Output for 5.6.25
1410543253-2853-3739-2004-217780902063
Output for 5.6.24
1410543253-6627-3737-0810-908433043050
Output for 5.6.23
1410543253-8349-9477-9528-432885176504
Output for 5.6.22
1410543253-3015-7013-7003-455141387969
Output for 5.6.21
1410543253-7088-4450-7057-764482439765
Output for 5.6.20
1410543253-1442-0000-8084-623502364869
Output for 5.6.19
1410543253-2205-3523-7647-118685707269
Output for 5.6.18
1410543253-1814-5090-7066-664245993233
Output for 5.6.17
1410543253-5412-6674-0825-251479074640
Output for 5.6.16
1410543253-8267-3737-8816-550341527212
Output for 5.6.15
1410543253-9327-0371-2322-553905708018
Output for 5.6.14
1410543253-4552-3458-0057-827346205213
Output for 5.6.13
1410543253-4180-0260-6349-231897932861
Output for 5.6.12
1410543253-7769-3009-0303-753254131876
Output for 5.6.11
1410543253-8309-8951-2407-377602646398
Output for 5.6.10
1410543253-6009-0683-7791-220643736712
Output for 5.6.9
1410543253-6983-5458-3813-330651209942
Output for 5.6.8
1410543253-2893-5700-4794-403541170673
Output for 5.6.7
1410543253-0276-8467-6422-200067567578
Output for 5.6.6
1410543253-2571-9859-1577-731389974815
Output for 5.6.5
1410543253-1591-2119-8982-876125833021
Output for 5.6.4
1410543253-5425-0997-6644-798810438037
Output for 5.6.3
1410543253-2508-1135-8293-549419087871
Output for 5.6.2
1410543253-9041-8605-6852-374179149865
Output for 5.6.1
1410543253-5469-9209-7408-813624752183
Output for 5.6.0
1410543253-0694-5272-2093-020913577175
Output for 5.5.38
1410543253-5583-4102-2567-746933406854
Output for 5.5.37
1410543253-4723-8933-8860-504504624774
Output for 5.5.36
1410543253-3931-3001-7370-267144852420
Output for 5.5.35
1410543253-7012-3224-9373-081673672348
Output for 5.5.34
1410543253-9953-5223-9794-530607601302
Output for 5.5.33
1410543253-4473-8607-0232-999704421995
Output for 5.5.32
1410543253-2678-1870-1022-931200143124
Output for 5.5.31
1410543253-1523-5650-1002-036542029566
Output for 5.5.30
1410543253-0305-9222-4408-920216476632
Output for 5.5.29
1410543253-4978-7953-2937-524337635787
Output for 5.5.28
1410543253-9746-0676-3725-962135738363
Output for 5.5.27
1410543253-0320-9273-7572-352015360280
Output for 5.5.26
1410543253-5013-1077-1116-869162267499
Output for 5.5.25
1410543253-3720-9195-6451-212793729978
Output for 5.5.24
1410543253-3232-0996-0288-611278168283
Output for 5.5.23
1410543253-6694-9554-2461-864144441787
Output for 5.5.22
1410543253-3838-2027-3772-898395858528
Output for 5.5.21
1410543253-5955-6677-2965-409724619988
Output for 5.5.20
1410543253-6581-7322-1954-621169257575
Output for 5.5.19
1410543253-9887-7905-0376-047611154182
Output for 5.5.18
1410543253-0322-8104-7751-515963467829
Output for 5.5.16
1410543253-8435-9514-1232-756144255973
Output for 5.5.15
1410543253-2117-0453-2748-136413967048
Output for 5.5.14
1410543253-2270-0081-5891-189023610107
Output for 5.5.13
1410543253-4106-1947-5258-820532510201
Output for 5.5.12
1410543253-0563-9285-6140-922467414198
Output for 5.5.11
1410543253-7771-2744-7076-386423659687
Output for 5.5.10
1410543253-5855-2011-5519-764639616044
Output for 5.5.9
1410543253-0096-3017-1589-184105455982
Output for 5.5.8
1410543253-2648-8178-8609-680579074394
Output for 5.5.7
1410543253-2949-6082-2727-796755373742
Output for 5.5.6
1410543253-7184-0787-8774-314836606345
Output for 5.5.5
1410543253-8627-1417-2747-308737418070
Output for 5.5.4
1410543253-2459-1417-6032-035168064347
Output for 5.5.3
1410543253-7436-9472-1175-248550246906
Output for 5.5.2
1410543253-9555-5126-7333-992801358671
Output for 5.5.1
1410543253-8589-7342-5724-726053841980
Output for 5.5.0
1410543253-5602-6860-2393-267174181569
Output for 5.4.45
1410543253-7491-8435-5841-985760404988
Output for 5.4.44
1410543253-9019-1902-3625-046548229517
Output for 5.4.43
1410543253-1766-0290-7527-538997881562
Output for 5.4.42
1410543253-7802-1935-5842-371686552594
Output for 5.4.41
1410543253-7942-8030-2683-387669074230
Output for 5.4.40
1410543253-9171-8531-8948-050723617461
Output for 5.4.39
1410543253-1979-3826-7249-884263800778
Output for 5.4.38
1410543253-1846-8539-9367-783257762554
Output for 5.4.37
1410543253-8632-0198-2157-514192361701
Output for 5.4.36
1410543253-1699-3096-8576-228187889673
Output for 5.4.35
1410543253-5171-3681-4868-114030001060
Output for 5.4.34
1410543253-1138-1424-6843-702224764950
Output for 5.4.32
1410543253-5473-1095-7584-965217695541
Output for 5.4.31
1410543253-5332-7667-2034-971205705951
Output for 5.4.30
1410543253-4562-6505-5544-780113999382
Output for 5.4.29
1410543253-2971-3714-7575-016222925452
Output for 5.4.28
1410543253-0912-2335-7508-668557095812
Output for 5.4.27
1410543253-0806-7190-8574-441757735417
Output for 5.4.26
1410543253-5502-6424-6756-732795835847
Output for 5.4.25
1410543253-5225-8028-1974-390713689385
Output for 5.4.24
1410543253-5750-7963-1882-769895615300
Output for 5.4.23
1410543253-1872-1727-7239-560697637297
Output for 5.4.22
1410543253-1407-0184-8498-160121211708
Output for 5.4.21
1410543253-9162-3155-5332-333708371202
Output for 5.4.20
1410543253-7867-3860-1656-967718040044
Output for 5.4.19
1410543253-6727-4208-2266-332875124312
Output for 5.4.18
1410543253-4385-3763-5101-362431664013
Output for 5.4.17
1410543253-5639-3064-8412-394048194877
Output for 5.4.16
1410543253-3305-6395-6979-511669707011
Output for 5.4.15
1410543253-1068-1777-2037-895104396598
Output for 5.4.14
1410543253-3752-5511-8244-257292653920
Output for 5.4.13
1410543253-1012-0204-0036-043023796170
Output for 5.4.12
1410543253-9322-3881-4890-210043887061
Output for 5.4.11
1410543253-9915-5463-5324-684275312826
Output for 5.4.10
1410543253-7349-2535-2083-230773466142
Output for 5.4.9
1410543253-0017-0841-9965-499714214900
Output for 5.4.8
1410543253-9002-3707-9419-543295935963
Output for 5.4.7
1410543253-2439-5231-2883-709207409521
Output for 5.4.6
1410543253-7657-0166-8559-067047006421
Output for 5.4.5
1410543253-4743-1502-9205-997947436064
Output for 5.4.4
1410543253-1548-3087-7692-970426367071
Output for 5.4.3
1410543253-6204-9783-3984-731281057990
Output for 5.4.2
1410543253-4449-8954-0490-518049157028
Output for 5.4.1
1410543253-7940-4404-2784-212858943279
Output for 5.4.0
1410543253-8712-5080-9260-875759743371
Output for 5.3.29
1410543253-9592-8561-7096-361572383153
Output for 5.3.28
1410543253-0937-7706-4497-742206463521
Output for 5.3.27
1410543253-3635-9442-8323-792900770385
Output for 5.3.26
1410543253-3722-2649-1226-796615761532
Output for 5.3.25
1410543253-8486-7822-4276-815012456992
Output for 5.3.24
1410543253-3281-2694-6202-412949488542
Output for 5.3.23
1410543253-1321-8478-7309-350827060842
Output for 5.3.22
1410543253-4834-2480-5606-778258556004
Output for 5.3.21
1410543253-8925-7367-3806-177713844722
Output for 5.3.20
1410543253-5761-3964-3397-931431972176
Output for 5.3.19
1410543253-4363-2954-9767-746552527701
Output for 5.3.18
1410543253-8705-1688-5101-932562062201
Output for 5.3.17
1410543253-8340-2554-4568-622182993049
Output for 5.3.16
1410543253-9767-1420-9011-234640027008
Output for 5.3.15
1410543253-9612-4487-7657-077208225420
Output for 5.3.14
1410543253-7560-6009-7664-190973256344
Output for 5.3.13
1410543253-0335-4505-0162-926718841679
Output for 5.3.12
1410543253-7610-3520-8712-699172635567
Output for 5.3.11
1410543253-1383-4735-2920-199705592479
Output for 5.3.10
1410543253-4626-9984-5485-300014198360
Output for 5.3.9
1410543253-8797-4215-2440-484548022492
Output for 5.3.8
1410543253-5674-9666-7951-800229005963
Output for 5.3.7
1410543253-5206-7949-6567-187058835917
Output for 5.3.6
1410543253-6867-9033-3051-968390790334
Output for 5.3.5
1410543253-3923-5794-2086-963023019121
Output for 5.3.4
1410543253-0648-2256-2721-604978721145
Output for 5.3.3
1410543253-6805-5883-0813-626516838301
Output for 5.3.2
1410543253-5120-0154-2218-689292881761
Output for 5.3.1
1410543253-7918-0482-1057-817292976919
Output for 5.3.0
1410543253-3929-7784-5865-434054538756
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/YdOQf on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/YdOQf on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/YdOQf on line 4
Process exited with code 255.