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; } } } $sign = new Signature; $firstName = 'Ivan'; $lastName = 'Ivanov'; $email = 'ivan@ivanov.ivn'; $phone = '12345678901'; $orderNumber = 333; $orderAmount = 300; $signature = $sign->generate($orderNumber, $orderAmount); echo 'http://mirusoft.ru/include/payments/get_url.php' .'?Signature='.$signature .'&Order_ID='.$orderNumber .'&Subtotal='.$orderAmount .'&FirstName='.$firstName .'&LastName='.$lastName .'&Email='.$email .'&Phone='.$phone;
Output for git.master, git.master_jit, rfc.property-hooks
http://mirusoft.ru/include/payments/get_url.php?Signature=2dbb60dd8900f9c2ce388cfbec0067e1&Order_ID=333&Subtotal=300&FirstName=Ivan&LastName=Ivanov&Email=ivan@ivanov.ivn&Phone=12345678901

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:
48.56 ms | 401 KiB | 8 Q