Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Parse Syntax Unexpected T_FUNCTION Error Help!!!

    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:
    PHP 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.
    Last edited by Inigoesdr; 08-31-2011 at 06:53 PM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Anonymous functions weren't added until PHP 5.3. Convert it to a regular function if you need to pass it to another function like that.

  • Users who have thanked Inigoesdr for this post:

    Dakotamay (08-31-2011)

  • #3
    m1l
    m1l is offline
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.

  • #4
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Inigoesdr View Post
    Anonymous functions 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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •