3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Signature { private $salt = '00f40f6dd20548c514e62b666ebb9e98'; public function setSalt($salt) { $this->salt = $salt; } public function generate($orderNumber, $orderAmount) { if( !empty($orderNumber) && !empty($orderAmount) && isset($this->salt) ) { $orderId = htmlentities($orderNumber); $orderAmount = htmlentities($orderAmount); $amountSum = floatval(str_replace(array(',', ' ', "'", '`'), array('.', '', '', ''), $orderAmount)) * 100; $salt = $this->salt; $signature = md5($orderId.'&'.$orderAmount.'&'.$salt); return $signature; } else { throw new Exception("Ошибка: Не верно переданны параметры для генерации сигнатуры", 1); return 0; } } } $signature = new Signature; $orderNumber = 2; $orderAmount = 200; $key = $signature->generate($orderNumber, $orderAmount); echo 'http://mirusoft.ru/include/payments/aq.php?Signature='.$key.'&Order_ID='.$orderNumber.'&Subtotal='.$orderAmount.'&FirstName=Ivan&LastName=Ivanov&Email=ivan@ivanov.ru&Phone=1234567890';
Output for git.master, git.master_jit, rfc.property-hooks
http://mirusoft.ru/include/payments/aq.php?Signature=770b5b2f2e5cf93a59128d39d24b9acd&Order_ID=2&Subtotal=200&FirstName=Ivan&LastName=Ivanov&Email=ivan@ivanov.ru&Phone=1234567890

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.99 ms | 401 KiB | 8 Q