Reply to Re: Passing session variables across pages

Your name:

Reply:


Posted by Jerry Stuckle on 05/02/07 14:54

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> Yes, but I'm not sure why the isset would give you a warning.
>
> I think isset($array['key']) issues a *notice* under PHP 5 when the key
> doesn't exist in the array. (And returns FALSE.)
>
> I suppose internally PHP finds the key in the array *before* it calls the
> isset() function, so the E_NOTICE is raised before isset() is called.
>

Hmm, that sounds dumb. The whole purpose of isset is to see if the
variable (in this case an array element) exists, isn't it?

I just tried the following quick program to see what happened:

<?php
printf("0x%x\n", ini_get('error_reporting'));
$a = array();
if (isset($a['x']))
echo "true\n";
else
echo "false\n";
$a['x'] = 5;
if (isset($a['x']))
echo "true\n";
else
echo "false\n";
?>


Results were:
0x17ff
false
true

E_NOTICE is 0x0008, so it is on. And note I did not get a notice. This
is on PHP 5.2.1.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация