Jason Pruim schreef:
>
> On Oct 15, 2008, at 7:18 AM, Nathan Rixham wrote:
>
>> Jason Pruim wrote:
>>> I probably should have mentioned that this was in a function to do
>>> the heavy lifting for authentication :) I just didn't paste the whole
>>> function since 90% of it worked just fine :)
>>>
On Oct 15, 2008, at 7:18 AM, Nathan Rixham wrote:
Jason Pruim wrote:
I probably should have mentioned that this was in a function to do
the heavy lifting for authentication :) I just didn't paste the
whole function since 90% of it worked just fine :)
Now I just need to get better and separ
Jason Pruim wrote:
I probably should have mentioned that this was in a function to do the
heavy lifting for authentication :) I just didn't paste the whole
function since 90% of it worked just fine :)
Now I just need to get better and separating presentation and code :)
very smiley today
On Oct 14, 2008, at 7:24 PM, Jochem Maas wrote:
Colin Guthrie schreef:
Jochem Maas wrote:
Jason Pruim schreef:
if(isset($_SESSION['userInfo']['loggedin']) &&
$_SESSION['userInfo']['loggedin'] == TRUE) {
Or, seeing as I'm a stickler for compact code:
me too, I also like to be able to chan
Jochem Maas wrote:
Colin Guthrie schreef:
if(!empty($_SESSION['userInfo']['loggedin'])) {
if (Sess::userLoggedIn()) { /* ... :-) */ }
Well, yes, that's how I do it in my apps too, but in internally in that
function you may want to use the empty() call :)
I agree that when checking for
Colin Guthrie schreef:
> Jochem Maas wrote:
>> Jason Pruim schreef:
>>> Good morning everyone!
>>>
>>> I think I might be having a "to early in the morning/not enough
>>> caffeine" moment... But I am down to 1 error on my timecard application
>>> that I would like to clean up. It's a small undefine
Ok, so empty is faster. I appreciate the time you guys took to bench the thing.
But I'm still gonna use array_key_exists.
If you like it or not.
Using it a couple of times in my scripts will slow them down a few nanoseconds.
That's plain evil mwhahaha.
//A yeti
--
PHP General Mailing List (http:
On Oct 14, 2008, at 11:05 AM, Wolf wrote:
Does the ! reverse the empty in this case? such as !empty = not
empty?
You definitely have to go walk the plank now... You have to go back
and
re-write code and make it more compact now, right? tsk, tsk. I
thought
we taught you better then
> Does the ! reverse the empty in this case? such as !empty = not empty?
You definitely have to go walk the plank now... You have to go back and
re-write code and make it more compact now, right? tsk, tsk. I thought
we taught you better then that.
! is the NOT operator in many languages.
So
On Tue, Oct 14, 2008 at 10:29 AM, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> Andrew Ballard wrote:
>>
>> I've heard that a lot, but I just don't see it. I'm sure some of you
>> can come up with better tests than this, but here is what I used:
>
> ...
>>
>> Based on these results, I'd hardly use the
Andrew Ballard wrote:
I've heard that a lot, but I just don't see it. I'm sure some of you
can come up with better tests than this, but here is what I used:
...
Based on these results, I'd hardly use the "language construct versus
function call" optimization argument to make my decision. I'm n
Yeti wrote:
Personally, I very rarely see the point in using array_key_exists... It's a
function call and has overhead where as isset() and empty() are language
constructs and (I would hope) are much more efficient (although I've not done
any benchmarks)
# i don't know what's wrong with this
On Tue, Oct 14, 2008 at 8:52 AM, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> Yeti wrote:
>>
>> You might also want to try array_key_exists
>>
>> if (array_key_exists('loggedin', $_SESSION['userInfo'])) {
>> // do something with $_SESSION['userInfo']['loggedin']
>> }
>
> You'd first need to check tha
> Personally, I very rarely see the point in using array_key_exists... It's a
> function call and has overhead where as isset() and empty() are language
> constructs and (I would hope) are much more efficient (although I've not done
> any benchmarks)
# i don't know what's wrong with this ..
$f
Peter Ford wrote:
You can probably short-circuit some of that - for example if
$_SESSION['userInfo']['loggedIn'] is only ever set to TRUE (and is not set
otherwise) then you might find that
if (isset($_SESSION['userInfo']['loggedin'])) {
As I mentioned elsewhere on this thread, !empty(..) is a
Jason Pruim wrote:
Or, seeing as I'm a stickler for compact code:
if(!empty($_SESSION['userInfo']['loggedin'])) {
empty() is like isset() but tests for all sorts of "empty" cases ('',
false, null and 0 are all considered, "empty").
Hey Colin,
Does the ! reverse the empty in this case? such
Yeti wrote:
You might also want to try array_key_exists
if (array_key_exists('loggedin', $_SESSION['userInfo'])) {
// do something with $_SESSION['userInfo']['loggedin']
}
You'd first need to check that the key 'userInfo' existed in the
$_SESSION array too.
Personally, I very rarely see the
Jason Pruim wrote:
> Good morning everyone!
>
> I think I might be having a "to early in the morning/not enough
> caffeine" moment... But I am down to 1 error on my timecard application
> that I would like to clean up. It's a small undefined index error, and
> the program works jsut fine the way i
On Oct 14, 2008, at 8:38 AM, Colin Guthrie wrote:
Jochem Maas wrote:
Jason Pruim schreef:
Good morning everyone!
I think I might be having a "to early in the morning/not enough
caffeine" moment... But I am down to 1 error on my timecard
application
that I would like to clean up. It's a sma
Jochem Maas wrote:
Jason Pruim schreef:
Good morning everyone!
I think I might be having a "to early in the morning/not enough
caffeine" moment... But I am down to 1 error on my timecard application
that I would like to clean up. It's a small undefined index error, and
the program works jsut fi
20 matches
Mail list logo