3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $file_id = 1; $project_id = 1; $token = $project_id; $expiry = strtotime('+1 years'); $signature = hash_hmac('sha256', "{$file_id}-{$token}-{$expiry}", "shared-secret"); $url = "https://media.example.com/?file_id={$file_id}&token={$token}&expiry={$expiry}&signature={$signature}"; var_dump($file_id, $token, $expiry, $signature, $url);
Output for 5.6.28, 7.0.14 - 7.1.0
int(1) int(1) int(1427202418) string(64) "ad5de2f34db367962d1e9d327a30e571eb455faee5275eb97933bacf315c14c8" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202418&signature=ad5de2f34db367962d1e9d327a30e571eb455faee5275eb97933bacf315c14c8"
Output for 7.0.6
int(1) int(1) int(1493770630) string(64) "7ee3c68909df860fd9d4fdf03f595e4eca50cb30e1532a441a731e3ff1b2fbe2" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493770630&signature=7ee3c68909df860fd9d4fdf03f595e4eca50cb30e1532a441a731e3ff1b2fbe2"
Output for 7.0.5
int(1) int(1) int(1491139930) string(64) "6501c5b194df4ffcf135ceee4f774ff86a834dfed9449641aa766fad1a094b67" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1491139930&signature=6501c5b194df4ffcf135ceee4f774ff86a834dfed9449641aa766fad1a094b67"
Output for 7.0.4
int(1) int(1) int(1489104069) string(64) "6cc060f08a7a80607232da537c15495b41bc703b0c4d9fa505cf40c022280713" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489104069&signature=6cc060f08a7a80607232da537c15495b41bc703b0c4d9fa505cf40c022280713"
Output for 7.0.3
int(1) int(1) int(1489796006) string(64) "a3bbf009a1d4cf9c5595ae3c7f079d5f7b7d6d6b3b3514372d3e1a2dce7fad1d" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489796006&signature=a3bbf009a1d4cf9c5595ae3c7f079d5f7b7d6d6b3b3514372d3e1a2dce7fad1d"
Output for 7.0.2
int(1) int(1) int(1490093298) string(64) "f6923c9c87506219cb53f3572fd0c45485bb1329b3c9221430dd75afb4a585eb" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490093298&signature=f6923c9c87506219cb53f3572fd0c45485bb1329b3c9221430dd75afb4a585eb"
Output for 7.0.1
int(1) int(1) int(1490266809) string(64) "10a7d63690472e44a8e192691736d88915530da3d10e97c8a0dbb58167f68e1b" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490266809&signature=10a7d63690472e44a8e192691736d88915530da3d10e97c8a0dbb58167f68e1b"
Output for 7.0.0
int(1) int(1) int(1490531464) string(64) "759d70ba1bb15e4f57039d9f2999470cc17cca47d2599b09254cf482e3b7d4bb" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490531464&signature=759d70ba1bb15e4f57039d9f2999470cc17cca47d2599b09254cf482e3b7d4bb"
Output for 5.6.21
int(1) int(1) int(1493666378) string(64) "e0ee81432157262abb2ef9ecdef4f88de2ed5f349593a772f230cb0186b5723d" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493666378&signature=e0ee81432157262abb2ef9ecdef4f88de2ed5f349593a772f230cb0186b5723d"
Output for 5.6.20
int(1) int(1) int(1491727615) string(64) "54f45e52f7d58a87eab093155a1e4f6afef25d01546d9d3dbcd9636299ab714a" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1491727615&signature=54f45e52f7d58a87eab093155a1e4f6afef25d01546d9d3dbcd9636299ab714a"
Output for 5.6.19
int(1) int(1) int(1488838577) string(64) "87dcb3d1051ca0f443ba638e59a8245fb299df0a5020b21b094f596c531c04d7" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1488838577&signature=87dcb3d1051ca0f443ba638e59a8245fb299df0a5020b21b094f596c531c04d7"
Output for 5.6.18
int(1) int(1) int(1489485993) string(64) "19784290e489cf1eb386c8973843d12dc25849d1b39cfa8ced92a063528b4b05" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489485993&signature=19784290e489cf1eb386c8973843d12dc25849d1b39cfa8ced92a063528b4b05"
Output for 5.6.17
int(1) int(1) int(1489898538) string(64) "71cf609ee9cc1c753bc0f0d0e324d9479db5296ceaac18595d9b46c53a897073" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489898538&signature=71cf609ee9cc1c753bc0f0d0e324d9479db5296ceaac18595d9b46c53a897073"
Output for 5.6.16
int(1) int(1) int(1490624162) string(64) "611d55e7ed22662a3b38aafd89001afce7e92643cb7392c9e840738170fcd6a0" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490624162&signature=611d55e7ed22662a3b38aafd89001afce7e92643cb7392c9e840738170fcd6a0"
Output for 5.6.15
int(1) int(1) int(1490713783) string(64) "ade5dee59d00dfc4facd7407a00ee2d5b0721aec641724617d777184dd96aff8" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490713783&signature=ade5dee59d00dfc4facd7407a00ee2d5b0721aec641724617d777184dd96aff8"
Output for 5.6.14
int(1) int(1) int(1491068883) string(64) "268949ef5285f912bd332a90840d692061bd3b68a04386d8d1d40ab861bc8d51" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1491068883&signature=268949ef5285f912bd332a90840d692061bd3b68a04386d8d1d40ab861bc8d51"
Output for 5.6.13
int(1) int(1) int(1492205759) string(64) "ed2c6930b4c46018a5b11289b0fb394b172fbe6b098fd7567e1fad9e63620b6d" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492205759&signature=ed2c6930b4c46018a5b11289b0fb394b172fbe6b098fd7567e1fad9e63620b6d"
Output for 5.6.12
int(1) int(1) int(1492598664) string(64) "66550f48159af5a043aa094bef8a961670d21a24d6d508d83f0961d47462cce6" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492598664&signature=66550f48159af5a043aa094bef8a961670d21a24d6d508d83f0961d47462cce6"
Output for 5.6.11
int(1) int(1) int(1492884041) string(64) "061fe7a57657ab723624c57e186e93698927986d92b59a509e2005d69e8e3dd3" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492884041&signature=061fe7a57657ab723624c57e186e93698927986d92b59a509e2005d69e8e3dd3"
Output for 5.6.10
int(1) int(1) int(1493062837) string(64) "730b509471ca352459bbdb9e50e0de02559451854e9ef336c28d3596b11a4cc9" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493062837&signature=730b509471ca352459bbdb9e50e0de02559451854e9ef336c28d3596b11a4cc9"
Output for 5.6.9
int(1) int(1) int(1493254197) string(64) "f6fc8ba5b5636b0dea4d296e90a1840cfc88aa0173d2cc534fbbb842bef22820" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493254197&signature=f6fc8ba5b5636b0dea4d296e90a1840cfc88aa0173d2cc534fbbb842bef22820"
Output for 5.6.8
int(1) int(1) int(1493454314) string(64) "c99c57b6b55a4e3b30fec28b52ae6331870b3511a6419f74f3a364bc02cfc9a8" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493454314&signature=c99c57b6b55a4e3b30fec28b52ae6331870b3511a6419f74f3a364bc02cfc9a8"
Output for 5.6.7
int(1) int(1) int(1495652937) string(64) "fba74b5a1fed064cc1c4cc8047e2b5c6e61628a6c571230670629722d652f9c8" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1495652937&signature=fba74b5a1fed064cc1c4cc8047e2b5c6e61628a6c571230670629722d652f9c8"
Output for 5.5.35
int(1) int(1) int(1495406471) string(64) "4c04210f139afcf7620090b788e45b29727291b68759e90c7206c9ead099c923" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1495406471&signature=4c04210f139afcf7620090b788e45b29727291b68759e90c7206c9ead099c923"
Output for 5.5.34
int(1) int(1) int(1491835364) string(64) "a9692951e818ed8b9a74c5842b3c04a5a22bef2396d1a4ce7cde6949f1c0869f" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1491835364&signature=a9692951e818ed8b9a74c5842b3c04a5a22bef2396d1a4ce7cde6949f1c0869f"
Output for 5.5.33
int(1) int(1) int(1488970508) string(64) "249c768f91da59526e014aaf846cf3b3d93ec65085240ca46818a50d1d36c7ce" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1488970508&signature=249c768f91da59526e014aaf846cf3b3d93ec65085240ca46818a50d1d36c7ce"
Output for 5.5.32
int(1) int(1) int(1489682160) string(64) "4051ea4d4d06553f93fcac141a51a6e840ac07496b49e98e28b00e36f4965b78" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489682160&signature=4051ea4d4d06553f93fcac141a51a6e840ac07496b49e98e28b00e36f4965b78"
Output for 5.5.31
int(1) int(1) int(1489995313) string(64) "26a16adee63310d1daaefb6d4848d73f4a52e16cca5f8ab202df38269849f8ac" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1489995313&signature=26a16adee63310d1daaefb6d4848d73f4a52e16cca5f8ab202df38269849f8ac"
Output for 5.5.30
int(1) int(1) int(1490980275) string(64) "2d39f1edb019ed869c9d3248b84ae3683d996ac86b38ad54151015f41004eafb" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1490980275&signature=2d39f1edb019ed869c9d3248b84ae3683d996ac86b38ad54151015f41004eafb"
Output for 5.5.29
int(1) int(1) int(1492342971) string(64) "ee823b57c8f892cea104125bd50aa97041550d6ebad30d7375fc3b23bf2ffd07" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492342971&signature=ee823b57c8f892cea104125bd50aa97041550d6ebad30d7375fc3b23bf2ffd07"
Output for 5.5.28
int(1) int(1) int(1492696736) string(64) "6486cf41e99b513c6724817ceee88703e0f9c30fcb8b77449eb4f157d2bcf367" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492696736&signature=6486cf41e99b513c6724817ceee88703e0f9c30fcb8b77449eb4f157d2bcf367"
Output for 5.5.27
int(1) int(1) int(1492792326) string(64) "c3d43c18d356dfecd9e1ad047bb31a795a7afca80b86986564b231981e1c2dc3" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1492792326&signature=c3d43c18d356dfecd9e1ad047bb31a795a7afca80b86986564b231981e1c2dc3"
Output for 5.5.26
int(1) int(1) int(1493157481) string(64) "55fe8772198786bf03a82d45ea291510c433ec8ee2740d89a072523ecfe7ac6c" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493157481&signature=55fe8772198786bf03a82d45ea291510c433ec8ee2740d89a072523ecfe7ac6c"
Output for 5.5.25
int(1) int(1) int(1493352403) string(64) "1f4291bea9f93efcdaee2ce66456827780bf6b95957784e81d1a0d4c9f14eaba" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493352403&signature=1f4291bea9f93efcdaee2ce66456827780bf6b95957784e81d1a0d4c9f14eaba"
Output for 5.5.24
int(1) int(1) int(1493552225) string(64) "e71b580ed11d5e6861dea294e93d68ac8c8381357ead2234a34d116ebdcad11b" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1493552225&signature=e71b580ed11d5e6861dea294e93d68ac8c8381357ead2234a34d116ebdcad11b"
Output for 5.4.45
int(1) int(1) int(1474307122) string(64) "aab66acf03699da860a6dd9dab44b6bdc7494900b7a0478ebe49c6de61d1909e" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1474307122&signature=aab66acf03699da860a6dd9dab44b6bdc7494900b7a0478ebe49c6de61d1909e"
Output for 5.4.44
int(1) int(1) int(1474307118) string(64) "7cc8c28b249519cdef35106728413649eccc18b149c2b90faf0ebcd2c8eea724" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1474307118&signature=7cc8c28b249519cdef35106728413649eccc18b149c2b90faf0ebcd2c8eea724"
Output for 5.4.43
int(1) int(1) int(1474307114) string(64) "6d5c1e4d68577ed60d8f00e7789c50d3c3f26e8b0acab77b178dfe4fffcece90" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1474307114&signature=6d5c1e4d68577ed60d8f00e7789c50d3c3f26e8b0acab77b178dfe4fffcece90"
Output for 5.4.42
int(1) int(1) int(1474307113) string(64) "65948a92c6d6a17515df88e3d6896974366137d365174af97ab1cd1b65a7db10" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1474307113&signature=65948a92c6d6a17515df88e3d6896974366137d365174af97ab1cd1b65a7db10"
Output for 5.4.41
int(1) int(1) int(1474307111) string(64) "c7423d4310ca8f086a6fd90c69865e5e96105bcc7db71ed43f8db55eb1a14495" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1474307111&signature=c7423d4310ca8f086a6fd90c69865e5e96105bcc7db71ed43f8db55eb1a14495"
Output for 5.4.40
int(1) int(1) int(1463273644) string(64) "e91941a45628d799b619143c01bdbac4b9212cf52507fbcfe628bfad66d86b1d" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1463273644&signature=e91941a45628d799b619143c01bdbac4b9212cf52507fbcfe628bfad66d86b1d"
Output for 5.4.39
int(1) int(1) int(1463273643) string(64) "f053ca878b697394a5a7a61d703c3ec96a5180818df9fafeb9e6df5407ace838" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1463273643&signature=f053ca878b697394a5a7a61d703c3ec96a5180818df9fafeb9e6df5407ace838"
Output for 5.4.38
int(1) int(1) int(1456931262) string(64) "d631b12e1312649c050c15bd73a286d74e45822bca2c8a92cd2283e435ff04a2" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1456931262&signature=d631b12e1312649c050c15bd73a286d74e45822bca2c8a92cd2283e435ff04a2"
Output for 5.4.36 - 5.4.37
int(1) int(1) int(1454947698) string(64) "336bbdbc0e5e2b49bb6247bbce1efe75dbacf83f0919d1831e358d9bbdc5c924" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1454947698&signature=336bbdbc0e5e2b49bb6247bbce1efe75dbacf83f0919d1831e358d9bbdc5c924"
Output for 5.4.34 - 5.4.35
int(1) int(1) int(1454947697) string(64) "e8e8f620a04398da7291cbb535e1142647cb47bebbfe83da845723d090cf3f6d" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1454947697&signature=e8e8f620a04398da7291cbb535e1142647cb47bebbfe83da845723d090cf3f6d"
Output for 5.4.32
int(1) int(1) int(1441670287) string(64) "28be003b76ba6f7ea1e213066ef448d2b8b9174d1e723413f02b7f0588a12a48" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1441670287&signature=28be003b76ba6f7ea1e213066ef448d2b8b9174d1e723413f02b7f0588a12a48"
Output for 5.4.31
int(1) int(1) int(1441670284) string(64) "001596e32f104afbcf49bf27287e706f80768db92c0bd02261acc7db21bd8f18" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1441670284&signature=001596e32f104afbcf49bf27287e706f80768db92c0bd02261acc7db21bd8f18"
Output for 5.3.29, 5.4.29 - 5.4.30
int(1) int(1) int(1441670281) string(64) "c2728d3c91abc3308775ccd8bc5d00f8e31793af7b0b55a778d150befce8cdf3" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1441670281&signature=c2728d3c91abc3308775ccd8bc5d00f8e31793af7b0b55a778d150befce8cdf3"
Output for 5.4.28
int(1) int(1) int(1441670280) string(64) "d5ac3a1bfa2a78837c2d18167726da2564ae539af33a5f39266a04e2343eb1e2" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1441670280&signature=d5ac3a1bfa2a78837c2d18167726da2564ae539af33a5f39266a04e2343eb1e2"
Output for 5.4.27
int(1) int(1) int(1441670285) string(64) "cc20b016de7283c63fd17348973e0ebe54f0f8334e3614892486ebe564b48bf8" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1441670285&signature=cc20b016de7283c63fd17348973e0ebe54f0f8334e3614892486ebe564b48bf8"
Output for 5.4.20 - 5.4.26
int(1) int(1) int(1427202419) string(64) "fe3baefe26f7b09b94a892fed2443248301e52d28ebfb3e53097460d7ff75dd7" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202419&signature=fe3baefe26f7b09b94a892fed2443248301e52d28ebfb3e53097460d7ff75dd7"
Output for 5.3.27 - 5.3.28, 5.4.0 - 5.4.19
int(1) int(1) int(1427202420) string(64) "ead22d547744b83ef0d0fd7ff8cfdaf8f9da48ee782a9082073c40637df8dd4e" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202420&signature=ead22d547744b83ef0d0fd7ff8cfdaf8f9da48ee782a9082073c40637df8dd4e"
Output for 5.3.9 - 5.3.26
int(1) int(1) int(1427202421) string(64) "5587c4467bccf28341edbdaf866e15ba28a6657c4e3524344433d7147bf4fa75" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202421&signature=5587c4467bccf28341edbdaf866e15ba28a6657c4e3524344433d7147bf4fa75"
Output for 5.2.8 - 5.3.8
int(1) int(1) int(1427202422) string(64) "3772ab2119266d63ee0df2516780d2dfe1afec0fb7bfec861c23b503bc6a7d24" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202422&signature=3772ab2119266d63ee0df2516780d2dfe1afec0fb7bfec861c23b503bc6a7d24"
Output for 5.1.2 - 5.2.7
int(1) int(1) int(1427202423) string(64) "35f8438fe7107b2f04d07e0642817d53a58f2fadf70eca7f60933c934536d96b" string(137) "https://media.example.com/?file_id=1&token=1&expiry=1427202423&signature=35f8438fe7107b2f04d07e0642817d53a58f2fadf70eca7f60933c934536d96b"
Output for 5.0.0 - 5.1.1
Fatal error: Call to undefined function hash_hmac() in /in/q8v3h on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: hash_hmac() in /in/q8v3h on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: hash_hmac() in /in/q8v3h on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: hash_hmac() in /in/q8v3h on line 7