language/predefined/variables/httpresponseheader.xml
a6d209f4ff71ccba3f1255902827f5df3e092ff9
...
...
@@ -1,7 +1,7 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3

4
-
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+
<refentry role="variable" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
5
<refnamediv>
6
6
<refname>$http_response_header</refname>
7
7
<refpurpose>HTTP response headers</refpurpose>
...
...
@@ -29,10 +29,10 @@
29
29
<?php
30
30
function get_contents() {
31
31
file_get_contents("http://example.com");
32
-
var_dump($http_response_header);
32
+
var_dump($http_response_header); // variable is populated in the local scope
33
33
}
34
34
get_contents();
35
-
var_dump($http_response_header);
35
+
var_dump($http_response_header); // a call to get_contents() does not populate the variable outside the function scope
36
36
?>
37
37
]]>
38
38
</programlisting>
...
...
@@ -59,6 +59,8 @@ array(9) {
59
59
[8]=>
60
60
string(38) "Content-Type: text/html; charset=UTF-8"
61
61
}
62
+

63
+
Warning: Undefined variable $http_response_header
62
64
NULL
63
65
]]>
64
66
</screen>
...
...
@@ -66,7 +68,7 @@ NULL
66
68
</para>
67
69
</refsect1>
68
70
69
-
</phpdoc:varentry>
71
+
</refentry>
70
72
71
73
<!-- Keep this comment at the end of the file
72
74
Local variables:
73
75