Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions appendices/comparisons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@
</row>
<row>
<entry><literal>$x = null;</literal></entry>
<entry><type>NULL</type></entry>
<entry><type>null</type></entry>
<entry>&true;</entry>
<entry>&true;</entry>
<entry>&false;</entry>
<entry>&false;</entry>
</row>
<row>
<entry><literal>var $x;</literal></entry>
<entry><type>NULL</type></entry>
<entry><type>null</type></entry>
<entry>&true;</entry>
<entry>&true;</entry>
<entry>&false;</entry>
<entry>&false;</entry>
</row>
<row>
<entry><varname>$x</varname> is undefined</entry>
<entry><type>NULL</type></entry>
<entry><type>null</type></entry>
<entry>&true;</entry>
<entry>&true;</entry>
<entry>&false;</entry>
Expand Down
4 changes: 2 additions & 2 deletions appendices/filters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ class AES_CBC
}
public static function decryptFile($password, $aes_filename, $out_stream) {
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$hmac_raw = file_get_contents($aes_filename, false, NULL, 0, 32);
$hmac_salt = file_get_contents($aes_filename, false, NULL, 32, $iv_size);
$hmac_raw = file_get_contents($aes_filename, false, null, 0, 32);
$hmac_salt = file_get_contents($aes_filename, false, null, 32, $iv_size);
$hmac_calc = self::calculate_hmac_after_32bytes($password, $hmac_salt, $aes_filename);
$fc = fopen($aes_filename, "rb");
$fout = fopen($out_stream, 'wb');
Expand Down
4 changes: 2 additions & 2 deletions appendices/migration56/openssl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
<![CDATA[
<?php
$ctx = stream_context_create(['ssl' => [
'capture_session_meta' => TRUE
'capture_session_meta' => true
]]);

$html = file_get_contents('https://google.com/', FALSE, $ctx);
$html = file_get_contents('https://google.com/', false, $ctx);
$meta = stream_context_get_options($ctx)['ssl']['session_meta'];
var_dump($meta);
?>
Expand Down
2 changes: 1 addition & 1 deletion appendices/migration72/incompatible.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int(1)
<?php

var_dump(
count(null), // NULL is not countable
count(null), // null is not countable
count(1), // integers are not countable
count('abc'), // strings are not countable
count(new stdClass), // objects not implementing the Countable interface are not countable
Expand Down
2 changes: 1 addition & 1 deletion features/commandline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ if ($path["extension"] == "el") {
readfile($_SERVER["SCRIPT_FILENAME"]);
}
else {
return FALSE;
return false;
}
?>]]>
</programlisting>
Expand Down
8 changes: 4 additions & 4 deletions language/control-structures/include.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ include 'http://www.example.com/file.php?foo=1&bar=2';
</para>
<simpara>
Handling Returns: <literal>include</literal> returns
<literal>FALSE</literal> on failure and raises a warning. Successful
<literal>false</literal> on failure and raises a warning. Successful
includes, unless overridden by the included file, return
<literal>1</literal>. It is possible to execute a <function>return</function>
statement inside an included file in order to terminate processing in
Expand All @@ -203,13 +203,13 @@ include 'http://www.example.com/file.php?foo=1&bar=2';
<programlisting role="php">
<![CDATA[
<?php
// won't work, evaluated as include(('vars.php') == TRUE), i.e. include('1')
if (include('vars.php') == TRUE) {
// won't work, evaluated as include(('vars.php') == true), i.e. include('1')
if (include('vars.php') == true) {
echo 'OK';
}

// works
if ((include 'vars.php') == TRUE) {
if ((include 'vars.php') == true) {
echo 'OK';
}
?>
Expand Down
4 changes: 2 additions & 2 deletions language/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Making a cup of espresso.
<programlisting role="php">
<![CDATA[
<?php
function makecoffee($types = array("cappuccino"), $coffeeMaker = NULL)
function makecoffee($types = array("cappuccino"), $coffeeMaker = null)
{
$device = is_null($coffeeMaker) ? "hands" : $coffeeMaker;
return "Making a cup of ".join(", ", $types)." with $device.\n";
Expand Down Expand Up @@ -1273,7 +1273,7 @@ class Cart
public function getQuantity($product)
{
return isset($this->products[$product]) ? $this->products[$product] :
FALSE;
false;
}

public function getTotal($tax)
Expand Down
2 changes: 1 addition & 1 deletion language/namespaces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ $a = \Bar\FOO; // fatal error, undefined namespace constant Bar\FOO
<![CDATA[
<?php
namespace bar;
const NULL = 0; // fatal error;
const null = 0; // fatal error;
const true = 'stupid'; // also fatal error;
// etc.
?>
Expand Down
28 changes: 14 additions & 14 deletions language/oop5/object-comparison.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
function bool2str($bool)
{
if ($bool === false) {
return 'FALSE';
return 'false';
} else {
return 'TRUE';
return 'true';
}
}

Expand Down Expand Up @@ -75,22 +75,22 @@ compareObjects($o, $r);
<screen>
<![CDATA[
Two instances of the same class
o1 == o2 : TRUE
o1 != o2 : FALSE
o1 === o2 : FALSE
o1 !== o2 : TRUE
o1 == o2 : true
o1 != o2 : false
o1 === o2 : false
o1 !== o2 : true

Two references to the same instance
o1 == o2 : TRUE
o1 != o2 : FALSE
o1 === o2 : TRUE
o1 !== o2 : FALSE
o1 == o2 : true
o1 != o2 : false
o1 === o2 : true
o1 !== o2 : false

Instances of two different classes
o1 == o2 : FALSE
o1 != o2 : TRUE
o1 === o2 : FALSE
o1 !== o2 : TRUE
o1 == o2 : false
o1 != o2 : true
o1 === o2 : false
o1 !== o2 : true
]]>
</screen>
</example>
Expand Down
10 changes: 5 additions & 5 deletions language/operators/comparison.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ echo $a <=> $b, ' '; // 1
<![CDATA[
<?php
// Bool and null are compared as bool always
var_dump(1 == TRUE); // TRUE - same as (bool) 1 == TRUE
var_dump(0 == FALSE); // TRUE - same as (bool) 0 == FALSE
var_dump(100 < TRUE); // FALSE - same as (bool) 100 < TRUE
var_dump(-10 < FALSE);// FALSE - same as (bool) -10 < FALSE
var_dump(min(-100, -10, NULL, 10, 100)); // NULL - (bool) NULL < (bool) -100 is FALSE < TRUE
var_dump(1 == true); // true - same as (bool) 1 == true
var_dump(0 == false); // true - same as (bool) 0 == false
var_dump(100 < true); // false - same as (bool) 100 < true
var_dump(-10 < false);// false - same as (bool) -10 < false
var_dump(min(-100, -10, null, 10, 100)); // null - (bool) null < (bool) -100 is false < true
?>
]]>
</programlisting>
Expand Down
8 changes: 4 additions & 4 deletions language/operators/type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ bool(false)
<![CDATA[
<?php
$a = 1;
$b = NULL;
$b = null;
$c = fopen('/tmp/', 'r');
var_dump($a instanceof stdClass); // $a is an integer
var_dump($b instanceof stdClass); // $b is NULL
var_dump($b instanceof stdClass); // $b is null
var_dump($c instanceof stdClass); // $c is a resource
var_dump(FALSE instanceof stdClass);
var_dump(false instanceof stdClass);
?>
]]>
</programlisting>
Expand All @@ -201,7 +201,7 @@ PHP Fatal error: instanceof expects an object instance, constant given
<programlisting role="php">
<![CDATA[
<?php
var_dump(FALSE instanceof stdClass);
var_dump(false instanceof stdClass);
?>
]]>
</programlisting>
Expand Down
2 changes: 1 addition & 1 deletion language/predefined/generator/rewind.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $generator = generator();
$generator->rewind(); // I'm a generator!

// Nothing happens here; the generator is already rewound
$generator->rewind(); // No output (NULL)
$generator->rewind(); // No output (null)

// This rewinds the generator to the first yield expression,
// if it's not already there, and iterates over the generator
Expand Down
2 changes: 1 addition & 1 deletion language/predefined/weakreference.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ NULL
<entry>8.4.0</entry>
<entry>
The output of <methodname>WeakReference::__debugInfo</methodname> now includes
the referenced object, or <literal>NULL</literal> if the reference is no longer
the referenced object, or <type>null</type> if the reference is no longer
valid.
</entry>
</row>
Expand Down
6 changes: 3 additions & 3 deletions language/types/boolean.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<programlisting role="php">
<![CDATA[
<?php
$foo = True; // assign the value TRUE to $foo
$foo = true; // assign the value true to $foo
?>
]]>
</programlisting>
Expand All @@ -45,7 +45,7 @@ if ($action == "show_version") {
}

// this is not necessary...
if ($show_separators == TRUE) {
if ($show_separators == true) {
echo "<hr>\n";
}

Expand Down Expand Up @@ -106,7 +106,7 @@ if ($show_separators) {
</listitem>
<listitem>
<simpara>
the unit type <link linkend="language.types.null">NULL</link> (including
the unit type <type>null</type> (including
unset variables)
</simpara>
</listitem>
Expand Down
2 changes: 1 addition & 1 deletion language/types/integer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ echo (int) ( (0.1+0.7) * 10 ); // echoes 7!
</sect3>

<sect3 xml:id="language.types.integer.casting-from-null">
<title>From <type>NULL</type></title>
<title>From <type>null</type></title>

<simpara>
&null; is always converted to zero (<literal>0</literal>).
Expand Down
4 changes: 2 additions & 2 deletions language/types/null.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="language.types.null">
<title>NULL</title>
<title>null</title>

<para>
The <type>null</type> type is PHP's unit type, i.e. it has only one value:
Expand All @@ -25,7 +25,7 @@
<programlisting role="php">
<![CDATA[
<?php
$var = NULL;
$var = null;
?>
]]>
</programlisting>
Expand Down
6 changes: 3 additions & 3 deletions language/types/type-juggling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ var_dump($bar);
<member><literal>(string)</literal> - cast to <type>string</type></member>
<member><literal>(array)</literal> - cast to <type>array</type></member>
<member><literal>(object)</literal> - cast to <type>object</type></member>
<member><literal>(unset)</literal> - cast to <type>NULL</type></member>
<member><literal>(unset)</literal> - cast to <type>null</type></member>
</simplelist>

<note>
Expand All @@ -339,7 +339,7 @@ var_dump($bar);
<simpara>
The <literal>(unset)</literal> cast has been deprecated as of PHP 7.2.0.
Note that the <literal>(unset)</literal> cast is the same as assigning the
value <type>NULL</type> to the variable or call.
value <type>null</type> to the variable or call.
The <literal>(unset)</literal> cast is removed as of PHP 8.0.0.
</simpara>
</warning>
Expand Down Expand Up @@ -421,7 +421,7 @@ if ($fst === $str) {
<member><link linkend="language.types.array.casting">Converting to array</link></member>
<member><link linkend="language.types.object.casting">Converting to object</link></member>
<member><link linkend="language.types.resource.casting">Converting to resource</link></member>
<member><link linkend="language.types.null.casting">Converting to NULL</link></member>
<member><link linkend="language.types.null.casting">Converting to null</link></member>
<member><link linkend="types.comparisons">The type comparison tables</link></member>
</simplelist>
</para>
Expand Down
4 changes: 2 additions & 2 deletions reference/apcu/functions/apcu-add.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<methodsynopsis>
<type>array</type><methodname>apcu_add</methodname>
<methodparam><type>array</type><parameter>values</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>NULL</initializer></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>null</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Expand Down Expand Up @@ -86,7 +86,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns TRUE if something has effectively been added into the cache, FALSE otherwise.
Returns <type>true</type> if something has effectively been added into the cache, <type>false</type> otherwise.
Second syntax returns array with error keys.
</para>
</refsect1>
Expand Down
2 changes: 1 addition & 1 deletion reference/apcu/functions/apcu-store.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<methodsynopsis>
<type>array</type><methodname>apcu_store</methodname>
<methodparam><type>array</type><parameter>values</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>NULL</initializer></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>null</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
Expand Down
2 changes: 1 addition & 1 deletion reference/array/functions/array-key-first.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (!function_exists('array_key_first')) {
foreach($arr as $key => $unused) {
return $key;
}
return NULL;
return null;
}
}
?>
Expand Down
2 changes: 1 addition & 1 deletion reference/com/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
</term>
<listitem>
<simpara>
Either expression is NULL.
Either expression is <type>null</type>.
</simpara>
</listitem>
</varlistentry>
Expand Down
4 changes: 2 additions & 2 deletions reference/com/functions/variant-add.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<entry>Addition</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
<entry>Either expression is <type>null</type></entry>
<entry><type>null</type> is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
Expand Down
2 changes: 1 addition & 1 deletion reference/com/functions/variant-cmp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<row>
<entry><constant>VARCMP_NULL</constant></entry>
<entry>Either <parameter>left</parameter>,
<parameter>right</parameter> or both are &null;
<parameter>right</parameter> or both are <type>null</type>;
</entry>
</row>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions reference/com/functions/variant-div.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<entry>Division and a double is returned</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
<entry>Either expression is <type>null</type></entry>
<entry><type>null</type> is returned</entry>
</row>
<row>
<entry><parameter>right</parameter> is empty and
Expand Down
4 changes: 2 additions & 2 deletions reference/com/functions/variant-idiv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<entry>Division</entry>
</row>
<row>
<entry>Either expression is NULL</entry>
<entry>NULL is returned</entry>
<entry>Either expression is <type>null</type></entry>
<entry><type>null</type> is returned</entry>
</row>
<row>
<entry>Both expressions are empty</entry>
Expand Down
Loading
Loading