-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Language variables section variable scope #3852
Conversation
language/predefined/variables.xml
Outdated
@@ -7,7 +7,7 @@ | |||
<partintro> | |||
|
|||
<para> | |||
PHP provides a large number of predefined variables to all scripts. The | |||
PHP provides a number of predefined variables to all scripts. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rewrite this: "PHP provides predefined variables that represent [external variables], built-in environment variables, and other information about the execution environment such as the number and values of the arguments passed to the script in the CLI environment."
I don't think this intro needs to mention 'last error messages' because it's deprecated and 'last retrieved headers' is just not that interesting in most cases (and $http_response_header
should probably be deprecated, anyways).
language/variables.xml
Outdated
The <literal>global</literal> keyword is used to bring a variable | ||
from a global scope into a local scope. The keyword can be used with | ||
a list of variables or a single variable. A local variable will be created | ||
referencing the global variable of the same name. If the global | ||
variable does not exist, the variable will be created in global scope and | ||
assigned &null;. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of saying "import" we could say "bind" as this seems to be the more standard Comp. Sci. terminology. :)
language/predefined/variables.xml
Outdated
@@ -7,7 +7,7 @@ | |||
<partintro> | |||
|
|||
<para> | |||
PHP provides a large number of predefined variables to all scripts. The | |||
PHP provides a number of predefined variables to all scripts. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rewrite this: "PHP provides predefined variables that represent [external variables], built-in environment variables, and other information about the execution environment such as the number and values of the arguments passed to the script in the CLI environment."
I don't think this intro needs to mention 'last error messages' because it's deprecated and 'last retrieved headers' is just not that interesting in most cases (and $http_response_header
should probably be deprecated, anyways).
language/variables.xml
Outdated
in that they are automatically global - i.e., automatically | ||
in that they are automatically global, i.e., automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd simplify to "These arrays are automatically available in every scope."
language/variables.xml
Outdated
The global scope spans <function>include</function>d and | ||
<function>require</function>d files as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, files included by include
and require
inherit the scope from where they are included but any functions and classes end up in the global scope. There's a paragraph in the include
docs that puts it well, I think, maybe we copy that here or reference it.
Not wild about constructions like <function>include</function>d
, too, that might be awkward for translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Please check the new changes
Thank you! |
No description provided.