Web Analytics Made Easy -
StatCounter Parse Syntax Unexpected T_FUNCTION Error Help!!! - CodingForum

Announcement

Collapse
No announcement yet.

Parse Syntax Unexpected T_FUNCTION Error Help!!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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; Aug 31, 2011, 02:53 PM.

  • #2
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment

        Working...
        X