<?php
class IssuanceScheme
{
private $lower_1 = 0;
private $upper_1 = 20;
private $issuanceFee_1 = '15p';
private $lower_2 = 21;
private $upper_2 = 30;
private $issuanceFee_2 = '12p';
private $lower_3 = 31;
private $upper_3 = null; //50;
private $issuanceFee_3 = '10p';
private $lower_4 = null; //51;
private $upper_4 = null; //75;
private $issuanceFee_4 = null;
private $lower_5 = null; //76;
// no $upper_5
private $issuanceFee_5 = null;
public function calculateIssuanceFee($volume)
{
$issuanceFee = $this->issuanceFee_1;
if ($volume >= $this->lower_1 && ($this->upper_1===null || $volume <= $this->upper_1)) {
return $this->issuanceFee_1;
}
if ($volume >= $this->lower_2 && ($this->upper_2===null || $volume <= $this->upper_2)) {
return $this->issuanceFee_2;
}
if ($volume >= $this->lower_3 && ($this->upper_3===null || $volume <= $this->upper_3)) {
return $this->issuanceFee_3;
}
if ($volume >= $this->lower_4 && ($this->upper_4===null || $volume <= $this->upper_4)) {
return $this->issuanceFee_4;
}
if ($volume >= $this->lower_5) {
return $this->issuanceFee_5;
}
}
}
$issuanceScheme = new IssuanceScheme;
// 15p
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 0, '15p', $issuanceScheme->calculateIssuanceFee(0)) . PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 5, '15p', $issuanceScheme->calculateIssuanceFee(5)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 10, '15p', $issuanceScheme->calculateIssuanceFee(10)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 15, '15p', $issuanceScheme->calculateIssuanceFee(15)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 20, '15p', $issuanceScheme->calculateIssuanceFee(20)). PHP_EOL;
// 12p
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 25, '12p', $issuanceScheme->calculateIssuanceFee(25)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 30, '12p', $issuanceScheme->calculateIssuanceFee(30)). PHP_EOL;
// 10p
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 50, '10p', $issuanceScheme->calculateIssuanceFee(50)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 60, '10p', $issuanceScheme->calculateIssuanceFee(60)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 75, '10p', $issuanceScheme->calculateIssuanceFee(75)). PHP_EOL;
echo sprintf("Passed in: %s, Exp: %s, Got: %s", 100, '10p', $issuanceScheme->calculateIssuanceFee(100)). PHP_EOL;
- Output for git.master, git.master_jit, rfc.property-hooks
- Passed in: 0, Exp: 15p, Got: 15p
Passed in: 5, Exp: 15p, Got: 15p
Passed in: 10, Exp: 15p, Got: 15p
Passed in: 15, Exp: 15p, Got: 15p
Passed in: 20, Exp: 15p, Got: 15p
Passed in: 25, Exp: 12p, Got: 12p
Passed in: 30, Exp: 12p, Got: 12p
Passed in: 50, Exp: 10p, Got: 10p
Passed in: 60, Exp: 10p, Got: 10p
Passed in: 75, Exp: 10p, Got: 10p
Passed in: 100, Exp: 10p, Got: 10p
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:
69.97 ms | 402 KiB | 8 Q