What Does This Mean? "Parse Error: Syntax Error, Unexpected T_Paamayim_Nekudotayim"

What does this mean? Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

T_PAAMAYIM_NEKUDOTAYIM is the double colon scope resolution thingy PHP uses - ::

Quick glance at your code, I think this line:

return $cnf::getConfig($key);

should be

return $cnf->getConfig($key);

The first is the way to call a method statically - this code would be valid if $cnf contained a string that was also a valid class. The -> syntax is for calling a method on an instance of a class/object.

Wordpress debugging Unexpected T_PAAMAYIM_NEKUDOTAYIM

Your code contains two extraneous dashes, amongst other things that look a little strange. Removing the dashes allows the parser to continue.

<?php
// Navigation Menus
register_nav_menus (array(
'primary' => ('Primaty Menu')
));

Incidentally, you don't have "unexpected T_PAAMAYIM_NEKUDOTAYIM", you have the parser expecting one. ("PAAMAYIM NEKUDOTAYIM" is Hebrew for "double colon").

As Kirk Beard points out, you actually should've had two underscores where you had hyphens.

Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM)

If you trying to determine if constant exists, then try to use defined() or constant(), not isset().


From php.net:

Function defined():

Returns TRUE if the named constant given by name has been defined, FALSE otherwise.

Function constant():

Returns the value of the constant, or NULL if the constant is not defined.


Fixed function:

function ifScriptFolder() {
echo defined('SCRIPT_URL') ? "/" . constant('SCRIPT_URL') . "/" : "/"
}

UPD:

The defined() function is a better solution for this, because it will not emit E_WARNING if constant was not defined.

PHP expects T_PAAMAYIM_NEKUDOTAYIM?

It’s the double colon operator :: (see list of parser tokens).

Joomla Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

The scope resolution operator (::) can only be used on a class referenced using a variable from PHP 5.3 -- you're using 5.2.

You'd have to do JHtmlSidebar::addEntry or JSubMenuHelper::addEntry; you can't do $class::addEntry.

Unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_Separator

It looks like your new server is running PHP 5.3, while your old one was running an earlier version.

In PHP 5.3, namespace is a keyword, thanks to the new namespace feature.

Your existing Namespace class is going to need to be renamed. The parse error is occurring as the code tries to resolve Namespace::isTalk() into a namespace name. (The syntax for doing so would be something akin to namespace Foo; it becomes confused at seeing the :: resolution operator.)

Syntax error, unexpected ' ', expecting :: (T_PAAMAYIM_NEKUDOTAYIM)

It looks like you have an unmatched opening brace { here:

url("category/{$category->id")

I suspect this is being parsed by the Blade template system, and it is struggling to make sense of it. This is why the error comes out of the cached file, rather than your own.

This sort of error can be discovered by committing the view file to version control, and then snipping away parts of it until the error no longer happens. By a process of trial and error, you can find the section that raises the exception.



Related Topics



Leave a reply



Submit