Skip to content
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

Merged
merged 14 commits into from
Oct 21, 2024

Conversation

kamil-tekiela
Copy link
Member

No description provided.

language/variables.xml Outdated Show resolved Hide resolved
@kamil-tekiela kamil-tekiela requested review from cmb69 and Girgias October 8, 2024 11:49
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads better to me, but maybe @jimwins or @Crell want to chime in

Suggested change
PHP provides a number of predefined variables to all scripts. The
PHP provides some predefined variables to all scripts. The

Copy link
Member

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 Show resolved Hide resolved
language/variables.xml Outdated Show resolved Hide resolved
Comment on lines 320 to 325
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;.
Copy link
Member

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. :)

@@ -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
Copy link
Member

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).

Comment on lines 227 to 232
in that they are automatically global - i.e., automatically
in that they are automatically global, i.e., automatically
Copy link
Member

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."

Comment on lines 264 to 265
The global scope spans <function>include</function>d and
<function>require</function>d files as well.
Copy link
Member

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.

Copy link
Member Author

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

language/variables.xml Outdated Show resolved Hide resolved
language/variables.xml Show resolved Hide resolved
language/variables.xml Show resolved Hide resolved
@Girgias Girgias merged commit d6baeae into php:master Oct 21, 2024
2 checks passed
@Girgias
Copy link
Member

Girgias commented Oct 21, 2024

Thank you!

@kamil-tekiela kamil-tekiela deleted the language-variables-2 branch October 21, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants