bizley / yii2-podium

Yii 2 forum module project
Apache License 2.0
168 stars 59 forks source link

podium crashes on php 5.4 #113

Open eLFuvo opened 7 years ago

eLFuvo commented 7 years ago

I.m using now 5.4.45 version of PHP. After install I had seen the following error:

PHP Compile Error – yii\base\ErrorException

Can't use function return value in write context

...
/vendor/bizley/podium/src/models/db/ThreadActiveRecord.php:147

public function requiredPollAnswers()
    {
        if ($this->pollAdded) {
            $this->pollAnswers = array_unique($this->pollAnswers);
            $filtered = [];
            foreach ($this->pollAnswers as $answer) {
->                if (!empty(trim($answer))) {

Same error in /vendor/bizley/podium/src/models/db/PollActiveRecord.php:89

Please fix it.

Thanks for you greate work!

tomaszkane commented 7 years ago

BTW, Yii2 works on 5.4, but this PHP version is end of life now. http://php.net/supported-versions.php so IMHO is not a crime to ignore it :-)

bizley commented 7 years ago

Yes, but unfortunately as long as Yii 2.0. supports this I must as well. With 2.1. we are back to sanity.