For Programmers: Free Programming Magazines  


Home > Archive > PHP Mirrors > February 2007 > #40416 [Opn->Bgs]: Note posting









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #40416 [Opn->Bgs]: Note posting
bjori@php.net

2007-02-11, 7:00 pm

ID: 40416
Updated by: bjori@php.net
Reported By: danielcottrell at operamail dot com
-Status: Open
+Status: Bogus
Bug Type: Website problem
Operating System: xp pro
PHP Version: Irrelevant
New Comment:

This is a bug in PHP4.4.0 which is caused by the syntax
error in your example.

There is no known workaround in user-space so we can't fix
it => marking bogus


Previous Comments:
------------------------------------------------------------------------

[2007-02-10 23:54:53] danielcottrell at operamail dot com

The mirror was us2.php.net. Try using the info posted as part of my
original bug submission.

------------------------------------------------------------------------

[2007-02-10 14:08:19] bjori@php.net

Can't reproduce.

Which mirror did you use?

------------------------------------------------------------------------

[2007-02-09 16:07:03] danielcottrell at operamail dot com

Description:
------------
When previewing notes that you add to the docummentation they don't
recognise new lines/paragraphs.

Reproduce code:
---------------
Just to confirm, USING UNSET CAN DESTROY AN ENTIRE ARRAY. I couldn't
find reference to this anywhere so I decided to write this.

The difference between using unset and using $myarray=array(); to unset
is that obviously the array will just be overwritten and will still
exist.

<?php

$myarray=array("Hello","World");

echo $myarray[0].$myarray[1];

unset($myarray);
//$myarray=array();

echo $myarray[0].$myarray[1];

echo $myarray;
?>

Output with unset is:
<?
HelloWorld

Notice: Undefined offset: 0 in C:\webpages\dainsider\myarray.php on
line 10

Notice: Undefined offset: 1 in C:\webpages\dainsider\myarray.php on
line 10


Output with $myarray=array(); is:
?>

<?
HelloWorld

Notice: Undefined offset: 0 in C:\webpages\dainsider\myarray.php on
line 10

Notice: Undefined offset: 1 in C:\webpages\dainsider\myarray.php on
line 10

Array
?>

Expected result:
----------------
Proper newlines and paragraphs, essentially a more accurate preview.

Actual result:
--------------
Just to confirm, USING UNSET CAN DESTROY AN ENTIRE ARRAY. I couldn't
find reference to this anywhere so I decided to write this. The
difference between using unset and using $myarray=array(); to unset is
that obviously the array will just be overwritten and will still exist.
<?php $myarray=array("Hello","World"); echo $myarray[0].$myarray[1];
unset($myarray); //$myarray=array(); echo $myarray[0].$myarray[1]; echo
$myarray; ?> Output with unset is: <? HelloWorld Notice: Undefined
offset: 0 in C:\webpages\dainsider\myarray.php on line 10 Notice:
Undefined offset: 1 in C:\webpages\dainsider\myarray.php on line 10
Output with $myarray=array(); is: ?> <? HelloWorld Notice: Undefined
offset: 0 in C:\webpages\dainsider\myarray.php on line 10 Notice:
Undefined offset: 1 in C:\webpages\dainsider\myarray.php on line 10
Array ?>


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=40416&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com