syntax error, unexpected T_STRING
Results 1 to 7 of 7

Thread: syntax error, unexpected T_STRING

  1. #1
    Junior Member
    Join Date
    Dec 2014
    Posts
    2

    syntax error, unexpected T_STRING

    Hi I am very new to php and have been trying to build a CMS hich until know has been going OK this section of code it giving me a syntax error, unexpected T_STRING. this problem is coming at the line with Fetch implementations from cache. I as hoping that someone maybe able to point me in the right direction with it as i keep drewing a blank

    PHP Code:
    if ($reset) {
        
    $implementations = array();
        
    cache_set('module_implements', array(), 'cache_bootstrap');
        
    mackay_static_reset('module_hook_info');
        
    mackay_static_reset('mackay_alter');
        
    cache_clear_all('hook_info''cache_bootstrap');
        return;
      }

       
    Fetch implementations from cache.
      if (empty(
    $implementations)) {
       
    $implementations cache_get('module_implements''cache_bootstrap');
        if (
    $implementations === FALSE) {
          
    $implementations = array();
        }
        else {
          
    $implementations $implementations->data;
        } 
    I thank you all for your time

    Alex, Newby

  2. #2
    Senior Member
    Join Date
    Apr 2003
    Location
    Silver Lake
    Posts
    4,933
    the text "Fetch implementations from cache." is not valid PHP syntax and is causing an error. Looks like this was intended as a comment so you need to mark it with a suitable comment indicator.

    If you were using a decent code editor, you probably would have gotten some kind of indicator to let you know which line of your code has the error. The error message you received ("unexpected T_STRING") should also have a line number.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  3. #3
    Junior Member
    Join Date
    Dec 2014
    Posts
    2
    sneakyimp thank you for your time you where so wright and about it being a comment i feel such a plonker. you mention about a decent editor what would you recommend as I have dreamweaver notepad + but the one i use the most is phpDesigner for any of the php i'm doing I am on a windows machine using WAMP as my test server.

    once again thank you for your time

  4. #4
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,986
    I used PHPDesigner for awhile and quite liked it, but at least at that time it did not (easily) support multi-line searches, so I looked around, and eventually ended up using Komodo Edit for the last 3 years or so. But some of the guys I work with swear by Sublime, but those are just a few of the many good choices out there.
    Last edited by NogDog; 12-18-2014 at 02:24 PM.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because hes a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  5. #5
    Senior Member
    Join Date
    Mar 2009
    Posts
    819
    +1 for Komodo Edit

    A coworker loves Sublime Text 2. I have also heard a lot of fanfare for PhpStorm, though PhpStorm is paid software and not free.
    Declare variables, not war.

  6. #6
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,986
    PS: I'm thinking of looking at PHP Storm, as it supposedly has XDebug built in. It's not free, but not too terribly pricey (especially if I get work to buy it ).
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because hes a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  7. #7
    Senior Member
    Join Date
    Mar 2009
    Posts
    819
    I've considered paying for Komodo IDE, but I am really put off by the subscription model. At least the PhpStorm model includes a 1-year subscription.

    Or maybe I am just spoiled.
    Declare variables, not war.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

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