Users of the formulas question, what is your php version

Users of the formulas question, what is your php version

by Jean-Michel Védrine -
Number of replies: 7

Hello to all users of the formulas question.

I am preparing a new release where the only change will be  compatibility of the formulas qtype with php 7.2

To do that I need to make some changes to the variables.php file and some of these changes will not work for some old versions of php

Of course I can add and "if" testing the php version and executing either the old code or the new one. But I wonder if this is really necessary.

So I need to know what is the older php version of people running the formulas questions.

My reason for trying to avoid the if is that these lines are executed many times so better to not slow down execution if this is not really necessary.

Average of ratings: -
In reply to Jean-Michel Védrine

Re: Users of the formulas question, what is your php version

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jean-Michel,

At my school, I am just a "user" of the Formulas question among several other users and I do not have administrator rights. I have no idea of the php version that is used. I have asked our site administrator and will let you know if I get an answer. He might invoke security reasons for not answering.

I would think that most, not all, but most users with no administrator rights also have no idea of the php version that their Moodle runs on, or how to find out.  I am also wondering how many site administrators, who should know the answer to your question, regularly read this forum.

Would it not be simpler to have two versions of your new release, one that works with new php versions and the other that works with old php versions. The person who installs the plugin, that is, the administrator should know which version to select.

In reply to Jean-Michel Védrine

Re: Users of the formulas question, what is your php version

by lucia liljegren -
PHP 5.6
(Update: I decided to visit my host and upgraded to 7.0).
In reply to Jean-Michel Védrine

Re: Users of the formulas question, what is your php version

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

École de technologie supérieure, Montréal, Canada (http://www.etsmtl.ca/)
Engineering school with 10700 students.

Moodle

In reply to Dominique Bauer

Re: Users of the formulas question, what is your php version

by Bernat Martinez -

COMPASS project http://formulas.compasspro.eu/

MOODLE: Moodle 3.4.1+ (Build: 20180125)

PHP: 7.0.28


Jean-Michel, if you are going to create a new FORMULAS version, my question is: 

would it be possible to integrate in FORMULAS some features of ALGEBRA question, for example, evaluating if a polynomial is factorised or not. 

ALGEBRA questions use PHPparser, could it be transferred to FORMULAS?

or would it be possible to define a factor function in FORMULAS similar to POLY function? 

or.......

Many thanks

In reply to Bernat Martinez

Re: Users of the formulas question, what is your php version

by Jean-Michel Védrine -

I don't have the resources (time) to do very deep changes to the formulas code.

But at the same time I don't want the formulas qtype to slowly die because of incompatibilities with current versions of Moodle, php, javascript.

This is why I converted all tests that were previously in variables.php to real phpunit tests : to ensure that all is working as expected and be able to run these tests very frequently..

And I can say now this was a wise move: in running these tests with php 7.2 Renaad Debleu was able to spot that there were problems and alert me so that I can fix them.

Without the tests, most probably we would have only noticed the problem when some sites upgrade their php to version 7.2

But just fixing a problem with change in the count() function and one function deprecation (create_function) took me several hours.

This is because the code in the variables.php is very complicated and when you make a change, even a small one it is not easy to be sure you haven't break something. Fortunately now all the tests are here to give some confidence that the code is still working as expected.

So I can't make any promise that I will be able to do more than what I currently do: run the tests periodically and fix problems when they are discovered by the tests or reported by one of you.

In reply to Jean-Michel Védrine

Re: Users of the formulas question, what is your php version

by Matthias Giger -
Picture of Particularly helpful Moodlers

Our school is using Moodle 3.1 and PHP 7.0.

I hope that for the next school year we can move on to at least Moodle 3.4 (or 3.5) and PHP 7.2.

Thanks for your continuing work on the Formulas plugin.