Fix PHP syntax errors

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301119 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2010-07-09 11:28:40 +00:00
parent 257719873b
commit 58e026c057
23 changed files with 26 additions and 65 deletions

View file

@ -66,7 +66,7 @@ $running=null;
//execute the handles
do {
curl_multi_exec($mh,$running);
} while ($running > 0)
} while ($running > 0);
//close the handles
curl_multi_remove_handle($mh, $ch1);

View file

@ -51,7 +51,7 @@
<programlisting role="php">
<![CDATA[
<?php
function safe_feof($fp, &start = NULL) {
function safe_feof($fp, &$start = NULL) {
$start = microtime(true);
return feof($fp);

View file

@ -81,7 +81,7 @@
<?php
// ISO-8859-1 encoded string
echo idn_to_ascii(utf8_encode('täst.de')));
echo idn_to_ascii(utf8_encode('täst.de'));
// Cannot convert a domain name to ASCII that contains non-ASCII chars but already starts with "xn--"
$ascii = idn_to_ascii("xn--".chr(0xC3).chr(0xA4), $errorcode);

View file

@ -64,7 +64,7 @@ $mongo = new Mongo();
/* do stuff where the db connection may be lost */
/* guarantee a reconnection to the db server */
$mongo->close()
$mongo->close();
$mongo->connect();
?>

View file

@ -73,7 +73,7 @@ mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db
<![CDATA[
<?php
$mongo = new Mongo("mongodb://localhost", array("connect" => false);
$mongo = new Mongo("mongodb://localhost", array("connect" => false));
// throws a MongoException, as $mongo has not been fully initialized yet
$mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));

View file

@ -29,7 +29,8 @@
<?php
$profile = array("username" => "foobity",
"pic" => new MongoBinData(get_file_contents("gravatar.jpg"));
"pic" => new MongoBinData(get_file_contents("gravatar.jpg"))
);
$users->save($profile);

View file

@ -113,7 +113,7 @@
$a = array('x' => 1);
$collection->insert($a);
var_dump($a)
var_dump($a);
$b = array('x' => 1);
$ref = &$b;

View file

@ -221,7 +221,7 @@ array(3) {
<?php
$today = array('$gt' => new MongoDate(), '$lt' => new MongoDate(strtotime("+1 day")));
$people->update("birthday" => $today), array('$set' => array('gift' => $surprise), array("multiple" => true));
$people->update(array("birthday" => $today), array('$set' => array('gift' => $surprise)), array("multiple" => true));
?>
]]>

View file

@ -34,7 +34,7 @@
<![CDATA[
<?php
$cursor = $collection->find(array("x"=>1), array("y"))
$cursor = $collection->find(array("x"=>1), array("y"));
$cursor->sort(array("z" => 1))->limit(4)->skip(5);
var_dump($cursor->explain());

View file

@ -20,7 +20,7 @@
<?php
// save a date to the database
$collection->save(array("ts" => new MongoDate());
$collection->save(array("ts" => new MongoDate()));
$start = new MongoDate(strtotime("2010-01-15 00:00:00"));
$end = new MongoDate(strtotime("2010-01-30 00:00:00"));

View file

@ -34,7 +34,8 @@ $saltedHash = md5($nonce["nonce"]."${username}${hash}");
$result = $db->command(array("authenticate" => 1,
"user" => $username,
"nonce" => $nonce["nonce"],
"key" => $saltedHash);
"key" => $saltedHash
));
?>
]]>

View file

@ -103,7 +103,7 @@ $grid->storeFile("somefile.txt", array("metadata" => array("date" => new MongoDa
<?php
$grid = $db->getGridFS();
$grid->update(array("filename" => "foo"), $newObj)); // update on the files collection
$grid->update(array("filename" => "foo"), $newObj); // update on the files collection
?>
]]>
@ -183,7 +183,7 @@ $grid->storeFile($filename, array("whatever" => "metadata", "you" => "want"));
<![CDATA[
<?php
$grid->storeBytes($bytes, array("whatever" => "metadata", "you" => "want");
$grid->storeBytes($bytes, array("whatever" => "metadata", "you" => "want"));
?>
]]>

View file

@ -42,8 +42,8 @@ $collection->insert(array( "x" => "y" ));
$collection->insert(array( "x" => "y" ));
$cursor = $collection->find();
$r1 = cursor->next();
$r2 = cursor->next();
$r1 = $cursor->next();
$r2 = $cursor->next();
echo $r1["_id"] . "\n";
echo $r2["_id"] . "\n";

View file

@ -51,7 +51,7 @@
<?php
$collection->insert(array("task" => "dishes", "do by" => new MongoMaxKey));
$collection->insert(array("task" => "staff meeting", "do by" => new MongoDate(strtotime("+4 days")));
$collection->insert(array("task" => "staff meeting", "do by" => new MongoDate(strtotime("+4 days"))));
$cursor = $collection->find()->sort(array("do by" => 1));

View file

@ -51,7 +51,7 @@
<?php
$collection->insert(array("task" => "lunch", "do by" => new MongoMinKey));
$collection->insert(array("task" => "staff meeting", "do by" => new MongoDate(strtotime("+4 days")));
$collection->insert(array("task" => "staff meeting", "do by" => new MongoDate(strtotime("+4 days"))));
$cursor = $collection->find()->sort(array("do by" => 1));

View file

@ -66,7 +66,7 @@ $db = $connection->mybiglongdbnme;
<![CDATA[
<?php
$db = $connection->baz
$db = $connection->baz;
$collection = $db->foobar;
// or, more succinctly

View file

@ -78,11 +78,11 @@
// $scores will be saved as an array
$scores = array(98, 100, 73, 85);
$collection->insert(array("scores" => $scores);
$collection->insert(array("scores" => $scores));
// $scores will be saved as an object
$scores = array("quiz1" => 98, "midterm" => 100, "quiz2" => 73, "final" => 85);
$collection->insert(array("scores" => $scores);
$collection->insert(array("scores" => $scores));
?>
]]>

View file

@ -92,27 +92,6 @@
<para>&return.void;</para>
</refsect1>
<!--
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>
<function>mqseries_put1</function>
example
</title>
<programlisting role="php">
<![CDATA[
<?php
TODO:
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
-->
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -67,27 +67,6 @@
<para>&return.void;</para>
</refsect1>
<!--
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>
<function>mqseries_set</function>
example
</title>
<programlisting role="php">
<![CDATA[
<?php
TODO:
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
-->
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -84,7 +84,7 @@ oci_set_client_identifier($c, $un);
$s = oci_parse($c, 'select mydata from mytable');
oci_execute($s);
...
// ...
?>
]]>

View file

@ -151,7 +151,7 @@ unset($db);
$dsn = '4D:host=localhost;charset=UTF-8';
$user = 'test';
$pass = 'test';
 
// Connection to 4D server 4D
$db = new PDO($dsn, $user, $pass);

View file

@ -444,6 +444,7 @@ if (!$sxe) {
echo "\t", $error->message;
}
}
?>
]]>
</programlisting>
&example.outputs;

View file

@ -99,7 +99,7 @@
$bar = 'BAR';
var_dump(wincache_ucache_set('foo', $bar));
var_dump(wincache_ucache_get('foo'));
$bar1 = 'BAR1'
$bar1 = 'BAR1';
var_dump(wincache_ucache_set('foo', $bar1));
var_dump(wincache_ucache_get('foo'));
?>