• 0

Dreamweaver lying about a syntax error


Question

Hi all,

I just wondered if someone knows how to disable a specific syntax error from appearing in Dreamweaver CS5.5, or otherwise how to 'upgrade' Dreamweaver's PHP syntax checker. My problem is:

  Quote
http://php.net/manua....comparison.php

The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.

Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.

post-176093-0-08206400-1325605014_thumb.

Running Help > Update shows that DW is up-to-date.

Thanks for any help :)

19 answers to this question

Recommended Posts

  • 0

Not too sure what you mean when you say 'cast to boolean', but thanks for the 2nd tip. Changed lines 16 & 17:

$admin = ($_SESSION['status'] == 3 ? true : false);
$loggedin = (count($_SESSION) ? true : false);

$admin = ($_SESSION['status'] == 3);
$loggedin = (count($_SESSION));

Never thought of doing that before, so cheers! :)

  • 0
  On 03/01/2012 at 15:56, AnthonySterling said:

You're using PHP 5.3 specific code, does Dreamweaver (or your version of) support this?

Evidently not, hence why I need to upgrade it to :p

Edit: Sorry, I should've said which version of Dreamweaver I'm using in the OP, but it's CS5.5. Edited to reflect.

  • 0

I think you'll have to use the dynamic code hinting feature in dreamweaver to get it to attempt to support 5.3 but to be honest when i started with PHP i soon wrote off Dreamweaver as an IDE and php support is very limited. I personally use Netbeans now, it is free and has much better support for PHP and has a tonne of features.

  • 0

To be honest with you, I used to whole-heartedly agree about DW being a horrible IDE for writing PHP, but it seems to have come a long way since the Adobe buyout, and I'm actually very impressed with CS5.5

Code hinting however is not the solution... all code hinting is, is this:

post-176093-0-04326700-1325607224.png

Edit: Actually it looks like CS5.5 adds support for PHP 5.3 for code hinting at least, so I don't know why not for syntax checking: click. Putting expr2 in the middle of the ternary makes the syntax error go away, but I don't wanna have to write "old-code".

  • 0

@giantpotato, I see what you're trying to say, but the boolean is expr1, thus my code of:

$uid = ($_SESSION['uid'] ?: false);

is correct.

@Anthony, I just took a look at the new features of PHP 5.3, and tried out Nowdoc - it validates syntactically correct:

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

Seems like it's a DW bug :(

  • 0

Just noticed jump label support was added into PHP 5.3 ( :|), and that also validates correctly:

goto a;

Also just tried a namespace, and that validates correctly too:

namespace foo;
  class Cat { 
    static function says() {echo 'meoow';}  }

So I guess it must be a bug!

  • 0

Both come back as invalid... with and without trailing semicolon.

Also, seems like Bugbase is only for AIR & Flash bugs, so reporting here instead.

Edit: Reported! Guess there's nothing more I can do, so I'll just have to put up with a ton of red markers all over my code :p

This topic is now closed to further replies.
  • Posts

    • just in time for it to be replaced with something that makes everyone unhappy! - The Microsoft way
    • Is this written by AI? The article contradicts itself and doesn't even line up with the title.
    • Pale Moon 33.7.2 by Razvan Serea Pale Moon is an Open Source, Goanna-based web browser available for Microsoft Windows, Linux and Android, focusing on efficiency and ease of use. Make sure to get the most out of your browser! Pale Moon offers you a browsing experience in a browser completely built from its own, independently developed source that has been forked off from Firefox/Mozilla code, with carefully selected features and optimizations to improve the browsers speed, resource use, stability and user experience, while offering full customization and a growing collection of extensions and themes to make the browser truly your own. Features: Optimized for modern processors Based on proprietary optimized layout engine (Goanna) Safe: forked from mature Mozilla code and regularly updated Secure: Additional security features and security-aware development Supported by our user community, and fully non-profit Familiar, efficient, fully customizable interface Support for full themes: total freedom over any elements design Support for easily-created lightweight themes (skins) Smooth and speedy page drawing and script processing Increased stability: experience fewer browser crashes Support for many Firefox extensions Support for a growing number of Pale Moon exclusive extensions Extensive and growing support for HTML5 and CSS3 Many customization and configuration options Pale Moon 33.7.2 release notes: Addressed PWN2OWN-2025-1 (out of bounds read or write in promise) DiD Addressed PWN2OWN-2025-2 (out of bounds read or write when using the ExtractLinearSum optimization) DiD Fixed potential unexpected behavior in embedded protobuf code. DiD Fixed an issue with potentially uninitialized contrast values when enhanced device contrast values can not be read from the O.S. DiD Fixed potential sanitization issues with devtools' "Copy as curl" feature. It should be noted that we do not currently offer cross-platform "curl" features, so this is another DiD for this release. Download: Pale Moon (64-bit) | Portable 64-bit | ~40.0 MB (Freeware) Download: Pale Moon (32-bit) | Portable 32-bit Links: Pale Moon Homepage | Add-ons | Themes | Extensions | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Another disappointing rumor: iPhone 17 won't get a ProMotion display by Hamid Ganji With the iPad Pro in 2017, Apple introduced a new type of display technology for its devices, dubbed ProMotion. The ProMotion feature enables a variable refresh rate, ranging from 24Hz to 120Hz, and it has a critical role in enhancing display sharpness and responsiveness. With the iPhone 13 Pro and iPhone 13 Pro Max in 2021, the ProMotion feature landed on iPhones, but it has stuck with the Pro variants since then, leaving the standard and Plus versions with a regular Super Retina display. While customers expected to get a ProMotion display on the vanilla iPhone 17, and even some rumors hinted at this possibility, the latest leaks suggest ProMotion remains with the Pro iPhone variants for another generation. According to Chinese leaker Fixed Focus Digital on Weibo, Apple has decided to keep the ProMotion feature exclusive to iPhone 17 Pro and Pro Max, and the rest of the lineup would launch with a “normal 120hz screen”. This Chinese leaker has conflicting reports about Apple’s future products. For now, we should take this claim with a pinch of salt and wait for more confirmation from the Apple supply chain insiders. In September last year, analyst Ross Young said the entire 17 lineup would get the ProMotion feature and the Always-on display (via 9to5mac). Young is also a credible source for Apple-related news, but too many conflicting rumors around upcoming iPhones make us question every claim. The only thing that seems certain so far is that Apple will increase the screen refresh rate on the iPhone 17 and 17 Air to 120Hz, which is a significant increase from the current 60Hz on the iPhone 16 base and Plus variants. Also, by boosting the iPhone 17 and 17 Air refresh rate to 120Hz, Apple is more likely to retain the ProMotion feature for the Pro models in the lineup to differentiate devices better from a marketing standpoint.
    • The article clearly states multiple times that he will DONATE his wealth. There's no mention of any loan, but haters gonna hate. He doesn't need to do this, you know? He could just give all that money to his kids and call it a day.
  • Recent Achievements

    • Week One Done
      Jim Dugan earned a badge
      Week One Done
    • Week One Done
      Adam Todd earned a badge
      Week One Done
    • Contributor
      Ed B went up a rank
      Contributor
    • One Month Later
      moporcho earned a badge
      One Month Later
    • One Month Later
      Parotel earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      211
    2. 2
      snowy owl
      156
    3. 3
      ATLien_0
      134
    4. 4
      Xenon
      119
    5. 5
      +FloatingFatMan
      113
  • Tell a friend

    Love Neowin? Tell a friend!