git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@304888 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Peter Cowburn 2010-10-25 19:41:39 +00:00
parent a912865116
commit 422eb63281
4 changed files with 17 additions and 21 deletions

View file

@ -463,9 +463,8 @@ $format = '%e':
// Check for Windows and only attempt to replace
// the %e modifiers if they exists in the format
if(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && strpos($format, '%e') !== false)
{
$format = str_replace('%e', '%#d', $format);
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && strpos($format, '%e') !== false) {
$format = str_replace('%e', '%#d', $format);
}
echo strftime($format);

View file

@ -55,12 +55,12 @@
<?php
function title($title, $name)
{
return sprintf("%s. %s\r\n", $title, $name);
return sprintf("%s. %s\r\n", $title, $name);
}
$function = new ReflectionFunction('title');
echo $function->invokeArgs(Array('Dr', 'Phil'));
echo $function->invokeArgs(array('Dr', 'Phil'));
?>
]]>
</programlisting>
@ -78,23 +78,21 @@ Dr. Phil
<programlisting role="php">
<![CDATA[
<?php
function get_false_conditions(Array $conditions, Array &$false_conditions)
function get_false_conditions(array $conditions, array &$false_conditions)
{
foreach($conditions as $condition)
{
if(!$condition)
{
$false_conditions[] = $condition;
}
}
foreach ($conditions as $condition) {
if (!$condition) {
$false_conditions[] = $condition;
}
}
}
$function_ref = new ReflectionFunction('get_false_conditions');
$function_ref = new ReflectionFunction('get_false_conditions');
$conditions = Array(true, false, -1, 0, 1);
$false_conditions = Array();
$conditions = array(true, false, -1, 0, 1);
$false_conditions = array();
$function_ref->invokeArgs(Array($conditions, &$false_conditions));
$function_ref->invokeArgs(array($conditions, &$false_conditions));
var_dump($false_conditions);
?>

View file

@ -41,7 +41,7 @@
<?php
function title($title, $name)
{
return sprintf("%s. %s\r\n", $title, $name);
return sprintf("%s. %s\r\n", $title, $name);
}
echo new ReflectionFunction('title');

View file

@ -118,9 +118,8 @@ $key = ftok($tmp, 'a');
// Attach the SHM resource, notice the cast afterwards
$id = shm_attach($key);
if($id === false)
{
die('Unable to create the shared memory segment');
if ($id === false) {
die('Unable to create the shared memory segment');
}
// Cast to integer, since prior to PHP 5.3.0 the resource id