Skip to content

Instantly share code, notes, and snippets.

Created February 20, 2013 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save anonymous/4996553 to your computer and use it in GitHub Desktop.
Save anonymous/4996553 to your computer and use it in GitHub Desktop.
<?php if (function_exists('contact_detail')) {
$chair = contact_detail('chair'),
$address = contact_detail('address')
}
?>
@tomjn
Copy link

tomjn commented Feb 20, 2013

line 2 has a comma at the end not a semicolon, line 3 lacks a semi-colon, the statement is thus incomplete, and will cause a fatal syntax error when it reaches the closing brace on line 4.

Also line 1 has both the opening tags and the if statement, line 4 is mis-indented, and line 5s closing php tag isn't aligned with the opening tag.

WP Coding standards would say you're also missing blank space between your function args and your parameters, and inside your if statement

@NickToye
Copy link

What is wrong with line 1?

@NickToye
Copy link

I can fix the indentations. :)

@NickToye
Copy link

Its actually indented correctly on my machine, it just copied across weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment