3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getDigest( $password, $data ) { $firstEncoding = base64_encode(hash('sha512', $data, true)); $withPass = $firstStep . $password; return base64_encode(hash('sha512', $withPass, true)); } $password= 'PASSWORD'; $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment><type>PAY_PAGE_AUTH_CAPTURE_INITIALISATION</type><mer chant><merchantid>10000001</merchantid><accountid>20000001</accountid></merchant>< customer><customerid>1</customerid><email>test@test.com</email><name>Test Client</name><dateofbirth>03042000</dateofbirth><address><addressline1>123 Street</addressline1><addressline2></addressline2><city>Guildford</city><province>Surrey</ province><postcode>GU2 2YG</postcode><country>GBR</country></address><mobilenumber>01234123123</mobilenu mber></customer><transaction><amount>1000</amount><currency>USD</currency><mercha ntref>3DIIWxxbGjhPR7g0OSk8</merchantref></transaction><url><responseurl>https://localho st:8443/response</responseurl></url></payment>'; $first = 'ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w=='; echo $first.PHP_EOL; echo $first.$password.PHP_EOL; $second = hash('sha512', $first, true); echo $second.PHP_EOL;
Output for 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w== ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORD v�ɞ�H\_t1�}^t���%��{tW�j^�`"�ڎ�ͣ�k�]�9�wQVd�J�K���4����
Output for 5.0.2 - 5.1.1
ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w== ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORD Fatal error: Call to undefined function hash() in /in/niRru on line 23
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 21 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 22 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORDPHP_EOL Fatal error: Call to undefined function hash() in /in/niRru on line 23
Process exited with code 255.
Output for 4.4.5 - 4.4.9
ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w== ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORD Fatal error: Call to undefined function: hash() in /in/niRru on line 23
Process exited with code 255.
Output for 4.3.10 - 4.4.4
ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w== ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORD Fatal error: Call to undefined function: hash() in /in/niRru on line 23
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 21 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 22 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORDPHP_EOL Fatal error: Call to undefined function: hash() in /in/niRru on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 21 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/niRru on line 22 ClKm6nuJYhM29fpYYf1zv2mJ4WdS6DZ6RMwvg8BCiCvLA3Nv1HtKh1YK30F1ljNOVWGEcuc9Mmim2DIVI4s+2w==PASSWORDPHP_EOL Fatal error: Call to undefined function: hash() in /in/niRru on line 23