Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can find all php tokens here:</p> <p><a href="http://php.net/manual/en/tokens.php" rel="nofollow">http://php.net/manual/en/tokens.php</a></p> <p>There's 2 things about the marked line:</p> <ol> <li><p>PHP is a scripted language with a VERY complicated syntax in reality. It might look simple, but in comparison to C or the like it's very complicated, and only because there where so many small (and many times incoherent) changes made over the years, and some things can't be changed anymore without breaking backwards compatibility. One of those things is handling of parantheses - PHP does not handle these in a mathematical way, but treat them specially depending on context. This means you should get rid of them in the marked line (there is no need for them in the first place either way)</p></li> <li><p>"Invisible" (i.e. UTF8) whitespaces - these are source for many "strange" problems, especially if you develop on a mac (press alt + space). Easiest way to fix them: Retype the line. And DON'T try copy &amp; pasting it, because you will copy the whitespace as well.</p></li> </ol> <p>Also I would change the line to</p> <p>if (! $type) $type = $data['type'];</p> <p>I hope you know which values evaluate falsy in php, because it's not only NULL (you can find a list here: <a href="http://php.net/manual/en/language.types.boolean.php" rel="nofollow">http://php.net/manual/en/language.types.boolean.php</a> )</p> <p>On a sidenote: PHP was developed as a simple way to write templates, so maybe you might want to have a look at some <em>compiled</em> programming languages if you want to build complex logic (C for example, which is <em>by far</em> simpler than PHP, and I've been doing PHP for more than 6 years now)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload