reference/var/functions/unset.xml
9f30ccc6aa0dabe411c52305202fe85209ddc06b
...
...
@@ -11,7 +11,7 @@
11
11
<methodsynopsis>
12
12
<type>void</type><methodname>unset</methodname>
13
13
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
14
-
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
14
+
<methodparam rep="repeat"><type>mixed</type><parameter>vars</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
<function>unset</function> destroys the specified variables.
...
...
@@ -165,10 +165,10 @@ Before unset: 3, after unset: 23
165
165
</listitem>
166
166
</varlistentry>
167
167
<varlistentry>
168
-
<term><parameter>...</parameter></term>
168
+
<term><parameter>vars</parameter></term>
169
169
<listitem>
170
170
<para>
171
-
Another variable ...
171
+
Further variables.
172
172
</para>
173
173
</listitem>
174
174
</varlistentry>
...
...
@@ -206,10 +206,12 @@ unset($foo1, $foo2, $foo3);
206
206
<example>
207
207
<title>Using <literal>(unset)</literal> casting</title>
208
208
<para>
209
-
<literal>(unset)</literal> casting is often confused with the
209
+
<link linkend="language.types.null.casting"><literal>(unset)</literal></link>
210
+
casting is often confused with the
210
211
<function>unset</function> function. <literal>(unset)</literal>
211
212
casting serves only as a <literal>NULL</literal>-type cast, for
212
213
completeness. It does not alter the variable it's casting.
214
+
The (unset) cast is deprecated as of PHP 7.2.0, removed as of 8.0.0.
213
215
</para>
214
216
<programlisting role="php">
215
217
<![CDATA[
...
...
@@ -237,13 +239,20 @@ string(6) "Felipe"
237
239
&note.language-construct;
238
240
<note>
239
241
<para>
240
-
It is possible to unset even object properties visible in current context.
242
+
It is possible to unset object properties visible in the current context.
243
+
</para>
244
+
<para>
245
+
If declared,
246
+
<link linkend="object.get">__get()</link>
247
+
is called when accessing an unset property, and
248
+
<link linkend="object.set">__set()</link>
249
+
is called when setting an unset property.
241
250
</para>
242
251
</note>
243
252
<note>
244
253
<para>
245
254
It is not possible to unset <literal>$this</literal> inside an object
246
-
method since PHP 5.
255
+
method.
247
256
</para>
248
257
</note>
249
258
<note>
...
...
@@ -263,6 +272,7 @@ string(6) "Felipe"
263
272
<member><function>empty</function></member>
264
273
<member><link linkend="object.unset">__unset()</link></member>
265
274
<member><function>array_splice</function></member>
275
+
<member><link linkend="language.types.null.casting">(unset) casting</link></member>
266
276
</simplelist>
267
277
</para>
268
278
</refsect1>
269
279