|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-10 14:08 UTC] bjori@php.net
[2007-02-10 23:54 UTC] danielcottrell at operamail dot com
[2007-02-11 17:31 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jun 18 01:00:02 2026 UTC |
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 ?>