Parse error help?

hi yall…

I’m having an issue with a script im trying to run.

below is the error when I run this script on my website…

Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in /home/mysite/public_html/mysubdomain/admin/rb.php on line 7806

php version used - 5.2.9

I know an upgrade to php 5.3 will solve the issue but my hosting company wont upgrade anytime soon.

My question - Is there a way around this issue using my current php version?

below is an extract from the rb.php file starting from lines 7796 to 7809 -

the issue is with line 7806 which is - return self::secureExec(function($sql, $values) {

/**
* Convenience function to execute Queries directly.
* Executes SQL.
*
* @param string $sql sql
* @param array $values values
*
* @return array $results
*/
public static function exec( $sql, $values=array() ) {
return self::secureExec(function($sql, $values) {
return R::$adapter->exec( $sql, $values );
}, NULL,$sql, $values );
}

any help would be much appreciated

thanks

Any bracket opened needs to be closed.

return self::secureExec(function($sql, $values)) {

self::secureExec(function($sql, $values) {

/**
* Convenience function to execute Queries directly.
* Executes SQL.
*
* @param string $sql sql
* @param array $values values
*
* @return array $results
*/
public static function exec( $sql, $values=array() ) {
return self::secureExec(function($sql, $values) {
return R::$adapter->exec( $sql, $values );
}, NULL,$sql, $values );

I think there is something wrong with your coding above. Review your coding again

thanks for replying…same error still there…

cheers

hi,

the code is correct but it is not compatible with my php version 5.2…the script was made to work with php version 5.3…

my question is - is there a way to make it work with php version 5.2…my hosting provider only using php 5.2 which sux IMO…

I read something about calling from outside the array, but not quite sure how to do it…

thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service