__construct() // #1 C:\dev_scripts\Condorcet\lib\Algo\Methods\STV\SingleTransferableVote.php(91): CondorcetPHP\Condorcet\Algo\Method->createResult() // #2 C:\dev_scripts\Condorcet\lib\Algo\Method.php(63): CondorcetPHP\Condorcet\Algo\Methods\STV\SingleTransferableVote->compute() // #3 C:\dev_scripts\Condorcet\lib\ElectionProcess\ResultsProcess.php(80): CondorcetPHP\Condorcet\Algo\Method->getResult() // #4 C:\dev_scripts\Condorcet\Dev\bugs\JitBug.php(24): CondorcetPHP\Condorcet\Election->getResult() // #5 {main} // thrown in C:\dev_scripts\Condorcet\lib\Result.php on line 89 # Test code namespace CondorcetPHP\Condorcet; require_once __DIR__.'/../../__CondorcetAutoload.php'; for ($i=1; $i <= 4000; $i++) { # With Condorcet $election = new Election; $election->parseCandidates('A;B;C'); $election->addVote('A>B>C'); $election->getResult('Schulze'); $election->getResult('STV'); # Tentative to reproduce (impossible...) // $a = new A (new Bar); // $b = new B (new Bar); } # Tentative to reproduce (impossible...) class Foo { public function __construct(public string $fromMethod, public string $byClass, public Bar $election, public array $result, public $stats, public ?int $seats = null, public array $methodOptions = []) { } } class Bar { } abstract class Base { public const IS_PROPORTIONAL = false; public Foo $foo; public function __construct(public Bar $barInstance) { $this->foo = new Foo( fromMethod: 'test', byClass: $this::class, election: $this->barInstance, result: [], stats: [], seats: (static::IS_PROPORTIONAL) ? $this->getSeats() : null, methodOptions: [] ); } public function getSeats(): int { return 6; } } class A extends Base { public const IS_PROPORTIONAL = false; } class B extends Base { public const IS_PROPORTIONAL = true; }