Showing posts with label weird error messages. Show all posts
Showing posts with label weird error messages. Show all posts

Thursday, October 7, 2010

T_PAAMAYIM_NEKUDOTAYIM error message in PHP

I had a trivial task a while ago - to call static method when class name defined dynamically via variable. There were no any need to instantiate class instance to do a simple check if provided class is suitable to work with the current data. So I decided to create a static method that will process a simple check before class instance will be even instantiated.

foreach ($dirDataDrivers as $driverClass) {
    if (true === $driverClass::check($dirPath)) { // ERROR LINE!!!
        // do staff...
    }
}

But my code felt into error message: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM.