Hello

It looks that (i think) some very minor parts of the code are written for PHP 5.5, mimicking the behaviour of OSF.
But I don't think the module should be written for PHP 5.5.

The reasoning is that while OSF might require 5.5, modules in Drupal 7 are expected to work with the PHP versions supported by the core, ie, 5.2+, unless there is a very hard motive not to.

Wrappers and libraries for OSF can always be written in the PHP versions supported by Drupal, while the web service that OSF runs along with the OSF stack Virtuoso, can run whatever version and software they require.

It should not be assumed that the stack and the drupal frontend server should be that same machine, with the same PHP version (and compilation).

From what i looked into, it is very easy to make the code compatible with PHP 5.2/5.3/5.4.

One example is initializing arrays:
PHP 5.x, including 5.5

$arr = array();

PHP 5.5 only

$arr = [];

Can you look into this matter and do the required changes?

Thank you

Comments

fgiasson’s picture

Hi lpalgarvio,

Good point. Do you have a list of these PHP versions issues you encountered other than this one?

Thanks,

Fred

lpalgarvio’s picture

actually, this coding standard i referred applies to PHP >=5.4.

"As of PHP 5.4 you can also use the short array syntax, which replaces array() with []."
https://php.net/manual/en/language.types.array.php
https://php.net/manual/en/migration54.new-features.php

most issues are about arrays (and the new shorthand way of using them) i believe.

fgiasson’s picture

Ok, will find and fix those.

fgiasson’s picture

Assigned: Unassigned » fgiasson
Status: Active » Closed (fixed)

I only found one. Here is the related commit: http://cgit.drupalcode.org/osf/commit/?id=78f1060

lpalgarvio’s picture

thanks!