...

View Full Version : Parse Syntax Unexpected T_FUNCTION Error Help!!!



Dakotamay
08-31-2011, 06:16 PM
Hello
I have an issue with a parse syntax error. Here is the error message: Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /admin/rb.php on line 7806

Here is that section of the code:


*/
public static function exec( $sql, $values=array() ) {
return self::secureExec(function($sql, $values) {
return R::$adapter->exec( $sql, $values );
}, NULL,$sql, $values );
}

Line 7806 is the line containing return self::
Could someone tell me this issue?
Also for further background knowledge. I am on a server using php 5.2.12. I also tried this on a different server and it was the same error. I also uploaded the file two ways in case my ftp program was causing the data to be changed or jumbled during upload. No avail.
Thanks in advance for all help.

Inigoesdr
08-31-2011, 06:54 PM
Anonymous functions (http://php.net/functions.anonymous) weren't added until PHP 5.3. Convert it to a regular function if you need to pass it to another function like that.

m1l
08-31-2011, 08:16 PM
This usually means you are missing something like a bracket, quote, semi colon, looks like it is a bracket here

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

you have two open and only one close.

Dakotamay
08-31-2011, 08:21 PM
Anonymous functions (http://php.net/functions.anonymous) weren't added until PHP 5.3. Convert it to a regular function if you need to pass it to another function like that.

Thanks. I've been researching and have now learned that this script requires 5.3 and above.
I didn't write this script it is one I purchased. Guess it's to a host that has PHP 5.3.
Thanks all.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum