3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $req = 'Authorization: Digest nonce="53a193b54e06b",nc="0",cnonce="b059cf311750c47cf6baaf95b86260a6",qop="auth",username="Localstars",uri="http://sandbox.print.localstars.com/templates/d.1402656459.52/create.json",response="a7b7e42197b430c4359a4d6ed815c1b0"'; function http_digest_parse($txt) { // protect against missing data $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); $data = array(); $keys = implode('|', array_keys($needed_parts)); preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); foreach ($matches as $m) { $data[$m[1]] = $m[3] ? $m[3] : $m[4]; unset($needed_parts[$m[1]]); } return $needed_parts ? false : $data; } http_digest_parse($req);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 4 in /in/NTfGY on line 15
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 4 in /in/NTfGY on line 15
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 4 in /in/NTfGY on line 15