0

The following code works fine on my localhost and my first hoster, but not at my new hoster.

static function setup ($childModel) {
  query::create()
   ->name($childModel::$tableName)
   ->mayExist()
   ->row($childModel::$struct)
   ->key($childModel::$index)
   ->run();
}

$childModel contains a string with the name of a class. Worked fine so far, but the new server says:

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /***/model.php on line 71

(line 71 is line 3 of the code above)

I know this means that he dont like the ::, but why do none of my other servers complain here? And what can I do about this?

UPDATE: It works now. It seems like it just took time for the server to switch to the new php version. Sorry everybody! (How do I close this thread?)

2
  • 2
    What versions of PHP are your 3 servers running? My guess is the new one is using an older one. Commented Nov 8, 2012 at 20:44
  • All servers run with php 5.3 Commented Nov 8, 2012 at 20:58

1 Answer 1

1

The $childModel::$tableName syntax (using variables as class names) only works in PHP 5.3+.

It seems like your new host is using an older version of PHP.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.