PHP Classes

Extended Ini File

Recommend this page to a friend!

      Extended Ini File  >  All threads  >  Extended Ini File  >  (Un) Subscribe thread alerts  
Subject:Extended Ini File
Summary:Syntax Error
Messages:13
Author:Frankie P
Date:2015-10-18 14:16:28
 
  1 - 10   11 - 13  

  1. Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 14:16:28
I get syntax error, unexpected '[' line 1209
Any ideas?

  2. Re: Extended Ini File   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2015-10-18 19:40:31 - In reply to message 1 from Frankie P
Hello,

Can you confirm me that line 1209 contains the following :

$keys = ( is_array ( $key ) ) ? $key : [ $key ] ;

This is because I'm using the new array syntax which appeared in PHP 5.4.0 (note that this package is targeted for PHP 5.5). Apparently, your PHP version is at most 5.3.

However, since this is (normally) the only place in this package where I'm using this new array notation, I just replaced it with the traditional one :

$keys = ( is_array ( $key ) ) ? $key : array ( $key ) ;

I uploaded the change so that you can download the latest version of IniFile.class.php once again.

With kind regards,
Christian.

  3. Re: Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 19:43:42 - In reply to message 2 from Christian Vigh
Yes, line 1209 contains:

$keys = ( is_array ( $key ) ) ? $key : [ $key ] ;

I had previously changes [ and ] to ( and ) but it did not update the ini file. I will download your up date and try that.

Thank you very much,
Frankie

  4. Re: Extended Ini File   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2015-10-18 19:45:22 - In reply to message 3 from Frankie P
Oops !

do you mean that you changed "[ $key ]" to "( $key )" or to "array( $key )" ?

  5. Re: Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 19:51:59 - In reply to message 4 from Christian Vigh
I changed:
$keys = ( is_array ( $key ) ) ? $key : [ $key ] ;
to:
$keys = ( is_array ( $key ) ) ? $key : ( $key ) ;

With your modified version I get syntax error on line 1268.

  6. Re: Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 19:53:19 - In reply to message 5 from Frankie P

FYI:
I am using php 5.4.38

  7. Re: Extended Ini File   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2015-10-18 20:01:32 - In reply to message 5 from Frankie P
I'm really surprised it does not work with version 5.4.38, since I thought that the new array syntax appeared in 5.4.0.

However, I modified again the class, because there were two other places (including line 1268) where it was used.

Please let me know if you have any other issue.

  8. Re: Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 20:12:33 - In reply to message 7 from Christian Vigh
Hi Christian,

I appreciate your help.
Now I get: synta error on line 1360

PHP Parse error: syntax error,
unexpected '[' in /.../extended-ini-file-2015-10-18/IniFile.class.php on line 1360

  9. Re: Extended Ini File   Reply   Report abuse  
Picture of Christian Vigh Christian Vigh - 2015-10-18 20:31:34 - In reply to message 8 from Frankie P
Hello Frankie,

there was remaining a "new array" syntax notation at line 1360 (normally this should be the last one in the file, unless I made a mistake).

I'm sorry not to have anticipated past errors ; I have several PHP versions online but unfortunately, my oldest one is 5.5.12.

Please let me know if you have any other issue,
Christian.


  10. Re: Extended Ini File   Reply   Report abuse  
Picture of Frankie P Frankie P - 2015-10-18 20:45:35 - In reply to message 9 from Christian Vigh
Thanks Christian.

How can I correct line 1360?

Thanks again, Frankie

 
  1 - 10   11 - 13