coding standards

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297477 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mark Wiesemann 2010-04-04 20:03:29 +00:00
parent f86f89b517
commit 3c5e32fa72
5 changed files with 18 additions and 23 deletions

View file

@ -52,10 +52,10 @@
<programlisting role="php">
<![CDATA[
<?php
if(is_float(27.25)) {
echo "is float\n";
}else {
echo "is not float\n";
if (is_float(27.25)) {
echo "is float\n";
} else {
echo "is not float\n";
}
var_dump(is_float('abc'));
var_dump(is_float(23));

View file

@ -54,9 +54,9 @@
<![CDATA[
<?php
if (is_int(23)) {
echo "is integer\n";
echo "is integer\n";
} else {
echo "is not an integer\n";
echo "is not an integer\n";
}
var_dump(is_int(23));
var_dump(is_int("23"));

View file

@ -55,7 +55,7 @@
<programlisting role="php">
<![CDATA[
<?php
$tests = Array(
$tests = array(
"42",
1337,
"1e4",
@ -64,14 +64,10 @@ $tests = Array(
9.1
);
foreach($tests as $element)
{
if(is_numeric($element))
{
foreach ($tests as $element) {
if (is_numeric($element)) {
echo "'{$element}' is numeric", PHP_EOL;
}
else
{
} else {
echo "'{$element}' is NOT numeric", PHP_EOL;
}
}

View file

@ -53,20 +53,19 @@
// array from our object
function get_students($obj)
{
if(!is_object($obj))
{
return(false);
if (!is_object($obj)) {
return false;
}
return($obj->students);
return $obj->students;
}
// Declare a new class instance and fill up
// some values
$obj = new stdClass;
$obj->students = Array('Kalle', 'Ross', 'Felipe');
$obj = new stdClass();
$obj->students = array('Kalle', 'Ross', 'Felipe');
var_dump(get_students(NULL));
var_dump(get_students(null));
var_dump(get_students($obj));
?>
]]>

View file

@ -46,9 +46,9 @@
<![CDATA[
<?php
if (is_string("23")) {
echo "is string\n";
echo "is string\n";
} else {
echo "is not an string\n";
echo "is not an string\n";
}
var_dump(is_string('abc'));
var_dump(is_string("23"));