473,508 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: shortcut for isset()?

Thomas Locke wrote:
Thomas Locke wrote:
....>
And here's the link I meant to post:

http://dk.php.net/manual/en/book.filter.php
Thanks! That will be fun to read.

--
Fui et vidi experiri.
=DSM=
Aug 25 '08 #1
3 1966
This is my "shortcut"...

a = (isset(a{0}) ? a : b;

My *very* unscientific testes show that this is somewhat faster
than...

a = (isset(a) ? a : b;

It just looks for the first character, or first elements of an array
opposed to the entire variable.

Walter

Aug 26 '08 #2
On 26 Aug, 06:48, phpWalter <otrWal...@torres.wswrote:
This is my "shortcut"...

* a = (isset(a{0}) ? a : b;

My *very* unscientific testes show that this is somewhat faster
than...

* a = (isset(a) ? a : b;

It just looks for the first character, or first elements of an array
opposed to the entire variable.

Walter
I'm not surpised it's faster since

a = (isset(a) ? a : b;

won't work!

Aug 26 '08 #3
..oO(phpWalter)
>This is my "shortcut"...

a = (isset(a{0}) ? a : b;
This is no PHP. And what are the curly braces doing there?
>My *very* unscientific testes show that this is somewhat faster
than...

a = (isset(a) ? a : b;

It just looks for the first character, or first elements of an array
opposed to the entire variable.
I really doubt that there's a difference in performance, at least not
one that matters at all.

Micha
Aug 26 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
2840
by: aa | last post by:
Thought this question might be out of this NG's scope, there are always knowledgable people who might hava an answer. A hyperlink to a shortcut to a file returnes an empty screen, and the source...
4
8831
by: Salad | last post by:
A97. If you set a forms properties to ShortcutMenu = No, the entire form is disabled from displaying a shortcut menu. If you set the property to Yes, all controls have a shortcut menu. I have...
0
3524
by: cefrancke | last post by:
I recently discovered, that if you set the startup options for "security", you will have alot of work do to get Access back to "normal". If you disable the built-in menus/toolbars you'll have to...
0
2745
by: Marcel | last post by:
Hi, the application I am writing has a MainMenu and a DataGrid (UltraGrid). Now I have to edit the text of each cell in this grid. So far so good. All works fine in editmode but if I press a...
4
4383
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
3
2142
by: TC | last post by:
I've written an application using VB.NET 2003 and packaged it with a deployment project. When I use the setup program to install the application, however, it doesn't work. More specifically, the...
7
31208
by: GrandpaB | last post by:
I would appreciate assistance learning how to create a Desktop shortcut in my setup project. In the left pane of the Setup/File System window I right-clicked User's Desktop. From the contex...
9
9682
by: wouter | last post by:
hey hi..... I wanna make a switch wich does this: if pagid is set do A, if catid is set do B, if projectid is set do C, else do D. So i was thinking something like this:
7
1354
by: Lo'oris | last post by:
$name=$_GET; if (!$name) $name="value"; i can't figure out how to shorten this thing. Is there some kind of operator i don't know about?
0
226
by: Michael Fesser | last post by:
..oO(Daniel Molina Wegener) They have side effects or don't work properly. If the variable or element you want to check doesn't exist, then * the first and fourth will create it and set it...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.