0

I am writing some script which will utilize cURL, was interested whether I needed to explicitly set various options or whether they are set by default, and thus pulled up http://php.net/manual/en/function.curl-setopt.php. Often the manually will explicitly state that a given option's default value is true or false, and while curl_setopt() does so for many of them, it doesn't do so for others.

It appears that the manual communicates the default value by typing it in bold, but as I have never read that the manual uses this convention, I went off searching for it and was surprised to find that either there is no instructions on how to use the manual or that they are incredible hard to find.

Does the PHP manual indicate default Boolean values by using bold font. Is there any documentation which describes this and other conventions used by the manual?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
user1032531
  • 24,767
  • 68
  • 217
  • 387
  • 1
    By using __bold uppercase font__ manual indicates PHP constants. – u_mulder Feb 26 '18 at 19:32
  • http://doc.php.net/tutorial/ tells how to create the documentation – aynber Feb 26 '18 at 19:33
  • @aynber I would have expected to be there, and specifically in http://doc.php.net/tutorial/style.php or http://doc.php.net/tutorial/faq.php, but it isn't. The closest I could find is `the tag is used to signify the default value ` in the FAQ. – user1032531 Feb 26 '18 at 19:38
  • @u_mulder I don't think bold uppercase font is reserved only for constants. The manually uses **TRUE** and FALSE, and TRUE and **FALSE**. – user1032531 Feb 26 '18 at 19:42
  • @user1032531 PHP programmers are expected to recognize those built-in names, so they shouldn't be confused by the inconsistent typography. – Barmar Feb 26 '18 at 20:23
  • The tags you have been using are not appropriate for this question. ("documentation", specifically, although "conventions" and "manual" are useless meta-tags) Please take the [tour], review [what are tags and how should I use them?](//stackoverflow.com/help/tagging) and [edit] your post. Remember to at least read the mouseover on the tags you are using when asking a question. Thank you! – Mogsdad Feb 27 '18 at 19:27
  • @Mogsdad Yes, I did read the tag, but wasn't sure about the intent. And, really I was asking about meta data about the documentation. – user1032531 Feb 27 '18 at 20:26

1 Answers1

0

The title of the middle column in the option list is Set value to. This means you're supposed to assume that the value specified in that column is not the default, and it's telling you what value you need to provide explicitly to cause the behavior described in the description of the option.

In some cases the default is dependent on other options or the PHP environment. This will be mentioned in description or the Notes column.

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • Thanks Barmar, I also looked at phpinfo's output for default values for my configuration, but not much provided for cURL. Maybe some cURL specific command provides? Do you know what the meaning of "the tag is used to signify the default value" in the FAQ? – user1032531 Feb 27 '18 at 10:36
  • phpinfo just shows the values of php.ini configuration options. The defaults for most of the curl parameters are hard-coded, not configurable options. The FAQ about `` is talking about optional function parameters. – Barmar Feb 27 '18 at 15:56