julien-boudry / Condorcet

Command line application and PHP library, providing an election engine with a high-level interface. Native support 20+ voting methods, easy to extend. Support simple elections with ease or billions of votes in low resource environment. Intensively tested and highly polyvalent.
https://www.condorcet.io
MIT License
119 stars 11 forks source link

Unserialize crash with new && empty election object #127

Closed julien-boudry closed 1 year ago

julien-boudry commented 1 year ago
Q A
Type Bug
Condorcet version 4.2.2
PHP version 8.2

Describe the bug Serialize / Unserialize an election without any votes in the lifecycle will crash.

To Reproduce

        $e = new Election;
        $e->parseCandidates('A;B');
        $e = serialize($e);
        $e = unserialize($e);