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

Election.php file giving Parse errors #56

Closed kbots-tech closed 3 years ago

kbots-tech commented 3 years ago
Q Election.php throwing Parse Error
Type Support
Condorcet version 3.1.0
PHP version 7.3.29
Installation Method __CondorcetAutoload.php

protected static ?int $_maxParseIteration = null; protected static ?int $_maxVoteNumber = null;

These two lines are causing the below error. I tried doing some debugging and different methods to fix but had simillar issues across the file. What may be causing me to get this issue and any suggestions on how to fix it? I was given a partially done research project to try and working without any prior instructions other than the errors telling me it couldn't find the __CondorcetAutoload.php so I started trying to get this working.

Thanks!

Parse error: syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST) in C:\Users\mcurr\Documents\GitHub\CondorcetPHP\lib\Election.php on line 28

julien-boudry commented 3 years ago

Hi @mcurranseijo

Condorcet 3.1 does not support PHP 7.x, . He's working only with PHP 8.0 and 8.1.

You need to use Condorcet 2.0 or upgrade your PHP version.

julien-boudry commented 3 years ago

(ps: Probably I can add a version check and fatal error on __CondorcetAutoload.php, but I suggest to use ComposerPHP autoloader instead, Composer do all checks)