On 23 May 2012, at 15:14, Tedd Sperling wrote:
Hi gang:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
A rule of thumb is no more than 50 lines per
function, most much less. Back in the day when we didn't have nifty
gui screens and an 24 line terminals (yay green on black!), if
On 29 May 2012, at 14:38, Tedd Sperling wrote:
On May 29, 2012, at 7:17 AM, Stuart Dallas wrote:
It's a theory, yes, and for many people it may be valid, but it's not for
me. The resolution of your screen; the size of your font; the colour scheme
you use. These should not be a factor in
On May 29, 2012, at 10:20 AM, Stuart Dallas wrote:
-snip-
Besides, truth is subjective, but then so is everything, including that
assertion.
-Stuart
You reply was longer than my monitor was high so I can't give an immediate
reply -- I have to scroll. :-)
However, with that said, you
The art of software development is in taking a problem, breaking it up in to
bite-size chunks, and putting those chunks together to form a practical
solution. Anyone who considers themselves a better programmer because their
functions are large due to their ability to handle large functions
On May 29, 2012, at 5:06 PM, Paul M Foster wrote:
I think a lot of coders try to be kewler than the next 18 guys who are
gonna have to look at the code, so they use a lot of compression
techniques to reduce LOC.
That's not kewl to me.
Plus, they're lazy. I'd rather see everything
with
On Tue, May 29, 2012 at 11:56:47AM -0400, Tedd Sperling wrote:
On May 29, 2012, at 10:20 AM, Stuart Dallas wrote:
-snip- Besides, truth is subjective, but then so is everything,
including that assertion.
-Stuart
You reply was longer than my monitor was high so I can't give an
On 12-05-29 07:17 AM, Stuart Dallas wrote:
I wasn't going to respond to this thread because I think it's a largely
ridiculous topic, but some of the responses have scared me. Sir Cummings
(hopefully) sarcastic response about using a 5px font size demonstrated
how daft it is to base function
On May 24, 2012, at 5:01 PM, Ashley Sheridan wrote:
On Thu, 2012-05-24 at 15:48 -0500, tamouse mailing lists wrote:
On May 23, 2012 9:14 AM, Tedd Sperling t...@sperling.com
wrote:
H
Yes, I think that is *exactly* the criterion-- not a mystery or an emergent
thing, really, was a pretty
On Wed, May 23, 2012 at 10:14 PM, shiplu shiplu@gmail.com wrote:
On Thu, May 24, 2012 at 1:56 AM, Matijn Woudt tijn...@gmail.com wrote:
I agree that large switch block are not always easy and useful to split,
however, writing too much code inside a switch block isn't considered good
My monitor can also display about 55 lines of code, my functions are, on
average, just a few lines of code though -- a maximum of about 20, with an
average of around 5 or so.
This is because the rule of thumb I follow is that a function should do
one
thing, and should be named well. The
Steven Staples sstap...@mnsi.net writes:
My monitor can also display about 55 lines of code, my functions are, on
average, just a few lines of code though -- a maximum of about 20, with an
average of around 5 or so.
This is because the rule of thumb I follow is that a function should do
On May 23, 2012, at 3:49 PM, Ashley Sheridan wrote:
I'm of the same mind. Generally I'll split a function if I'm reusing more
than a couple of lines of code. I only split a large function if it's
actually doing several things, if it happens to need 200 lines to perform one
'step' then
On May 24, 2012, at 8:37 AM, Steven Staples wrote:
Tedd,
I think the length of code depends on a few different factors, what if you
have your docblocks, and comment lines, as well as your bracing style?
Where do you consider your function to start?
It starts where it starts. It doesn't make
On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling t...@sperling.com wrote:
Hi gang:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
A rule of thumb is no more than 50 lines per
function, most much less. Back in the day when we didn't have nifty
gui screens and an 24 line
On May 23, 2012, at 11:49 AM, shiplu wrote:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
When number of lines becomes the criteria of function size? Wouldn't it
depends on the task the function is doing?
You missed the point.
Of course, the difficulty of the task of a specific
On 12-05-23 12:15 PM, Tedd Sperling wrote:
On May 23, 2012, at 11:49 AM, shiplu wrote:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
When number of lines becomes the criteria of function size? Wouldn't it depends
on the task the function is doing?
You missed the point.
Of
On Wed, May 23, 2012 at 5:49 PM, shiplu shiplu@gmail.com wrote:
On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling t...@sperling.com wrote:
Hi gang:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
A rule of thumb is no more than 50 lines per
function, most much less. Back in
On May 23, 2012, at 12:21 PM, Robert Cummings wrote:
On 12-05-23 12:15 PM, Tedd Sperling wrote:
What I was talking about was that what we can grasp in one view, we can
understand better. If the code lies outside of our view, then we understand
it less. I can support this claim with numerous
On Wed, 2012-05-23 at 20:59 +0200, Matijn Woudt wrote:
On Wed, May 23, 2012 at 5:49 PM, shiplu shiplu@gmail.com wrote:
On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling t...@sperling.com wrote:
Hi gang:
On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote:
A rule of thumb is
On Wed, May 23, 2012 at 9:49 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
**
On Wed, 2012-05-23 at 20:59 +0200, Matijn Woudt wrote:
On Wed, May 23, 2012 at 5:49 PM, shiplu shiplu@gmail.com wrote:
On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling t...@sperling.com wrote:
Hi gang:
On Thu, May 24, 2012 at 1:56 AM, Matijn Woudt tijn...@gmail.com wrote:
I agree that large switch block are not always easy and useful to split,
however, writing too much code inside a switch block isn't considered good
practice too IMO. Though, it is unavoidable in some cases I think. I do
I use a lot of switches but they are always small in size because they look
mostly like this:
switch($action) {
case 'hello':
$someObject-executeAction();
break;
case 'world':
$someOtherObject-executeOtherAction();
break;
default:
$this-anotherAction();
break;
}
Tedd Sperling t...@sperling.com writes:
It would be an interesting survey to ask programmers to review their code and
provide the average number of lines in their functions AND how many lines of
code their monitor's can display. In other words, look at your editor; count
the
number of lines
On Fri, May 4, 2012 at 4:29 AM, Dan Joseph dmjos...@gmail.com wrote:
Are these inside classes or anything? If they're just functions, they
should work fine together, example of 2 working functions together:
?php
hellotwo();
function helloone()
{
echo hi 1;
}
function
On Thu, May 3, 2012 at 9:12 PM, Ron Piggott
ron.pigg...@actsministries.org wrote:
I need to access a FUNCTION I programmed within a different FUNCTION. Are
these able to be passed like a variable? Or are they able to become like a
$_SESSION variable in nature? How am I able to do this?
I
But the OP says function is defined inside a different function. Your
theories to a solution don't fit that problem.
tamouse mailing lists tamouse.li...@gmail.com wrote in message
news:cahuc_t-416_-lpcn3mo8qqxwrh4pnq5fmwouhwpdk+hmkgh...@mail.gmail.com...
On Thu, May 3, 2012 at 9:12 PM, Ron
On Fri, May 4, 2012 at 9:18 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
But the OP says function is defined inside a different function. Your
theories to a solution don't fit that problem.
[snip]
But the OP says function is defined inside a different function. Your
theories to a
On Thu, May 3, 2012 at 9:12 PM, Ron Piggott
ron.pigg...@actsministries.org wrote:
I need to access a FUNCTION I programmed within a different FUNCTION. Are
these able to be passed like a variable? Or are they able to become like a
$_SESSION variable in nature? How am I able to do this?
I
On Thu, May 3, 2012 at 10:12 PM, Ron Piggott ron.pigg...@actsministries.org
wrote:
I need to access a FUNCTION I programmed within a different FUNCTION. Are
these able to be passed like a variable? Or are they able to become like a
$_SESSION variable in nature? How am I able to do this?
On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
Actually, this works for me:
$days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
But again, I don't see why I have to use next month to find the
On Mon, 2012-03-12 at 15:53 -0400, Tedd Sperling wrote:
On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
Actually, this works for me:
$days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
On Sat, 2012-03-10 at 20:38 -0500, Tedd Sperling wrote:
On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
function getAmountOfDaysInAMonth($month, $year) {
$days = array(31, (($year%4==0 and ($year%100 0 or $year%400==0)) ? 29
: 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
I still don't see what's wrong with
date(t);
--
Thanks,
Ash
Ash:
It's just too damn simple -- we need to make things complicated. :-)
Actually, this works for me:
$days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
I still don't see what's wrong with
date(t);
--
Thanks,
Ash
Ash:
It's just too damn simple -- we need to make things complicated. :-)
Actually, this
On 09-03-2012 14:11, Daniel Brown wrote:
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Browndanbr...@php.net wrote:
On Thu, Mar 8, 2012 at 21:23, Tedd Sperlingtedd.sperl...@gmail.com wrote:
This starts getting a bit
On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
On 09-03-2012 14:11, Daniel Brown wrote:
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Browndanbr...@php.net wrote:
On Thu, Mar 8, 2012 at
On 10 March 2012 19:06, Matijn Woudt tijn...@gmail.com wrote:
On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
On 09-03-2012 14:11, Daniel Brown wrote:
(To the list, as well. First day with my new fingers,
apparently)
On Fri, Mar 9, 2012
I'm just a bit baffled why this isn't a standard library function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Sat, Mar 10, 2012 at 9:47 PM, tamouse mailing lists
tamouse.li...@gmail.com wrote:
I'm just a bit baffled why this isn't a standard library function.
Good question, but I think the problem here is that there are tons of
these small functions, and you got to make a choice on what to
implement
On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
function getAmountOfDaysInAMonth($month, $year) {
$days = array(31, (($year%4==0 and ($year%100 0 or $year%400==0)) ? 29 :
28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
return $days[$month+1];
}
I like that -- here's a small
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
Sent: 08 March 2012 23:15
To: PHP-General List
[previous discussion snipped]
Mike:
Very well put.
You say:
Huh? The 0th day of next month *is* the last day of the current
month,
which gives you
Ford, Mike wrote:
Side-point: I find it interesting that getdate() has all sorts of
neat descriptions for the current month (such as, what weekday a
numbered day is), but lacks how many days are in the month. Doesn't
that seem odd?
Now that's a decent point: I can see where you're coming
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Brown danbr...@php.net wrote:
On Thu, Mar 8, 2012 at 21:23, Tedd Sperling tedd.sperl...@gmail.com wrote:
This starts getting a bit off-topic from your original email, but
knowing
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
But why does anyone have to use the next month to figure out how
many days there are are in this month? Do you see my point?
Actually, no. To figure this out, somewhere along the line you've
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
But why does anyone have to use the next month to figure out how
many days there are are in this month? Do you see my
On Mar 9, 2012, at 11:17 AM, Charles wrote:
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
But why does anyone have to use the next month to figure out how
many
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling tedd.sperl...@gmail.com wrote:
On Mar 9, 2012, at 11:17 AM, Charles wrote:
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling
On Sat, Mar 10, 2012 at 12:52 AM, Charles peac...@gmail.com wrote:
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
On Mar 9, 2012, at 11:17 AM, Charles wrote:
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
On Mar 9, 2012, at
Charles peac...@gmail.com wrote:
On Sat, Mar 10, 2012 at 12:52 AM, Charles peac...@gmail.com wrote:
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
tedd.sperl...@gmail.com wrote:
On Mar 9, 2012, at 11:17 AM, Charles wrote:
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
On Sat, Mar 10, 2012 at 12:57 AM, Charles peac...@gmail.com wrote:
On Sat, Mar 10, 2012 at 12:52 AM, Charles peac...@gmail.com wrote:
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
On Mar 9, 2012, at 11:17 AM, Charles wrote:
On Fri, Mar 9, 2012 at 10:58 PM,
On Mar 9, 2012, at 12:52 PM, Charles wrote:
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling tedd.sperl...@gmail.com
wrote:
Well no, I don't need to know the first day of next month to know the last
day of this month. That's like saying I need to know who is going to stand
at the 'end of
On Mar 7, 2012, at 4:28 PM, Daniel Brown wrote:
On Wed, Mar 7, 2012 at 15:03, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
I am using the getdate(mktime()) functions to get month data (i.e., name of
month, first weekday, last day, number of days).
To get the number of days for
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last day of the
previous month.
Huh? The 0th
On Mar 8, 2012 6:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a
On 03/08/2012 04:44 PM, Jim Lucas wrote:
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-Original Message-
From: Tedd Sperling
On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
On Mar 8, 2012 6:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the current month (such as, what weekday a numbered day
is), but lacks how many
On Fri, Mar 9, 2012 at 9:23 AM, Tedd Sperling tedd.sperl...@gmail.com wrote:
On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
On Mar 8, 2012 6:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the
Tedd,
This area was always a little grey to me.
I have used -1 to obtain the previous months for some time now.
0 always indicated the beginning index of the current month but the
explanation never seemed to fit the bill.
Having worked extensively in time manipulation in many of the
On Wed, Mar 7, 2012 at 15:03, Tedd Sperling tedd.sperl...@gmail.com wrote:
Hi gang:
I am using the getdate(mktime()) functions to get month data (i.e., name of
month, first weekday, last day, number of days).
To get the number of days for a specific month, I use:
// $current_month is the
To get the number of days for a specific month, I use:
// $current_month is the month under question
$next_month = $current_month + 1;
I use this
$next_month = $current_month + 1;
$next_month_1= mktime(0, 0, 0, $next_month, 1, date(Y) );
$current_month_1= mktime(0, 0, 0,
Hi, All
To bring a work-around into this discussion I myself would not see it
as a good way to do it like that - even if the documentation provides
some information around that.
Here's what I have done in all new projects I worked with time-calculation:
@Tedd: Lets pick up your first example and
On Thu, Mar 8, 2012 at 7:01 AM, Simon Schick
simonsimc...@googlemail.com wrote:
$date = new DateTime($year . '-' . $current_month . '-1');
$date-add( new DateInterval( 'P1M' ) ); // Add a period of 1 month to
the date-instance (haven't tried that with the 30th of Jan ... would
be kind-of
-Original Message-
From: Florian Müller [mailto:florip...@hotmail.com]
Sent: 03 February 2012 14:36
Hi guys,
I was wondering some time ago, why the links which are shown on
error or warning (E_WARNING etc.) show relative links to an usually
non-existing file.
Because you
On Fri, Feb 3, 2012 at 4:35 PM, Ford, Mike m.f...@leedsmet.ac.uk wrote:
-Original Message-
From: Florian Müller [mailto:florip...@hotmail.com]
Sent: 03 February 2012 14:36
Hi guys,
I was wondering some time ago, why the links which are shown on
error or warning (E_WARNING etc.)
On Mon, Jul 19, 2010 at 2:22 PM, Shelley myphpl...@gmail.com wrote:
Hi all,
The problem is imagettfbbox().
jpgraph uses it to create truetype font images.
I have a phpinfo() script.
The command line output:
php i.php | grep Free
FreeType Support = enabled
FreeType Linkage = with
On 19 July 2010 10:04, Nilesh Govindarajan li...@itech7.com wrote:
On Mon, Jul 19, 2010 at 2:22 PM, Shelley myphpl...@gmail.com wrote:
Hi all,
The problem is imagettfbbox().
jpgraph uses it to create truetype font images.
I have a phpinfo() script.
The command line output:
php i.php |
On 21 June 2010 00:45, Rick Pasotto r...@niof.net wrote:
Within a class function I have defined another function for use with the
usort() function. How do I reference it?
When it's not part of a class usort($arr,cmp) works fine but when it's
within a class function I get this error:
PHP
On Sun, Jun 20, 2010 at 08:47:53PM -0400, Brandon Rampersad wrote:
$this-usort();
self::usort();
On Sun, Jun 20, 2010 at 7:45 PM, Rick Pasotto r...@niof.net wrote:
Within a class function I have defined another function for use with the
usort() function. How do I reference it?
When
At 4:51 AM +0200 5/13/10, Michelle Konzack wrote:
Hello,
while reading RFC3490 (plus 3454/3491/3492) and before I am ongoing to
reinvent the wheel here the question:
Does someone HAVE or know a function/class which
does the IDN conversion toASCII and toUNICODE?
Note: The C
On Tue, 2009-11-24 at 23:27 -0800, Allen McCabe wrote:
If I were to loop through my inputs, I could just exclude any
problematic names, eg.:
foreach ($_POST as $var = $val)
{
if ($var != filter.x || $var != filter.y)
{
$var = $val;
}
}
Like that?
On Tue, Nov 24, 2009
On Nov 25, 2009, at 4:32 AM, Ashley Sheridan wrote:
On Tue, 2009-11-24 at 23:27 -0800, Allen McCabe wrote:
If I were to loop through my inputs, I could just exclude any
problematic names, eg.:
foreach ($_POST as $var = $val)
{
if ($var != filter.x || $var != filter.y)
{
$var =
On Mon, 2009-11-23 at 21:53 -0800, Allen McCabe wrote:
Okay, suddenly I got it to filter the results, but I still can't figure out
where this part of the query is coming from, at the end of the query string
in the URL, I have this filter.x=0filter.y=0.
No where in my form do I have a field
On Tue, 2009-11-24 at 02:11 -0800, Allen McCabe wrote:
I am! Will these extra query variables cause any problems or should I
use standard submit inputs?
Thanks Ashley!
On Tue, Nov 24, 2009 at 1:10 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Mon,
Likely your query failed due to an error.
Try adding an or die(mysql_error()) to the end of your mysql_query
statement to see what that error maybe
Bastien
Sent from my iPod
On Nov 23, 2009, at 7:22 PM, Allen McCabe allenmcc...@gmail.com wrote:
Hi, thanks for reading, I hope you can
On Nov 23, 2009, at 6:22 PM, Allen McCabe wrote:
Hi, thanks for reading, I hope you can help:
In my main file for an orders page I have the following code:
if (isset($_GET['filterby']))
{
$resultOrders = adminFilterQuery();
$numberOfOrders = mysql_num_rows($resultOrders);
}
else
Okay, suddenly I got it to filter the results, but I still can't figure out
where this part of the query is coming from, at the end of the query string
in the URL, I have this filter.x=0filter.y=0.
No where in my form do I have a field named filter.x or filter.y. I DO
however, have 3 forms (I
Hi,
I've sent this mail a few days ago, but as this list have a very high
traffic maybe my mail disappear from you inbox.
Any help would be appreciated.
Thanks in advance,
Gabriel.
On Sun, Oct 11, 2009 at 4:42 PM, Gabriel Hahmann
gabriel.hahm...@gmail.com wrote:
Hi,
I'm new to the list and
2009/7/6 Lupus Michaelis mickael+...@lupusmic.org:
Hi,
I would like to know if I am alone to be shoked by this :
== 8 ==
function foo( $bar = null)
{
}
foo() ; // runs
foo(null) ; // raise an error
== 8 ==
Why the default value to null for a reference is allowed ? Is it a bug, a
Stuart a écrit :
You appear to be using the definition of null that comes from the
world of C.
I didn't. The point is I'm allowed to set a default value to null for
a referenced parameter (what I can do in C for a pointer, so I knew it).
I'm happy PHP raises an error on foo(null) ;
2009/7/6 Lupus Michaelis mickael+...@lupusmic.org:
Stuart a écrit :
You appear to be using the definition of null that comes from the
world of C.
I didn't. The point is I'm allowed to set a default value to null for a
referenced parameter (what I can do in C for a pointer, so I knew it).
Stuart a écrit :
The whole point of default arguments is for it to use that argument if
none is passed.
It is not the point too.
What makes you think not passing an argument to that function should
raise an error?
Maybe because in my example, the provided value is not a valuable
value
2009/7/6 Lupus Michaelis mickael+...@lupusmic.org:
I'm happy PHP raises an error on foo(null) ;
I'm in trouble when foo() doesn't.
The actual question is : why PHP doesn't raise an error ?
This functionality (default values for passed-by-reference parameters)
was added in PHP5.
The
2009/7/6 Lupus Michaelis mickael+...@lupusmic.org:
David Otton a écrit :
So there's some serious impedance mismatch going on there to make both
features to work together. Just think of the default value as
something I can overwrite, eg:
Thanks for this smart explanation. It shines my day.
David Otton a écrit :
So there's some serious impedance mismatch going on there to make both
features to work together. Just think of the default value as
something I can overwrite, eg:
Thanks for this smart explanation. It shines my day.
--
Mickaël Wolff aka Lupus Michaelis
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
{
// code here displays the form
}
The function is used to both display an
Thodoris wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
{
// code here displays the form
}
The function is used
On Wed, 2009-02-18 at 10:21 -0600, Shawn McKenzie wrote:
Thodoris wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote:
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name'
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
On Tue, Feb 17, 2009 at 3:29 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote:
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
I've had a bit of a problem with a function I'm using for a form.
On Tue, 2009-02-17 at 15:19 -0500, Andrew Ballard wrote:
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name'
On Tue, 2009-02-17 at 15:21 -0500, Andrew Ballard wrote:
On Tue, Feb 17, 2009 at 3:29 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote:
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
I've had
What about:
function addEvent($values='')
{
!is_array($values) $values = Array('name' = '', 'venue' = '',
'description' ='',
'errors' = Array());
//rest of the code
}
It's nice and sort.
2009/2/17 Ashley Sheridan a...@ashleysheridan.co.uk:
On Tue, 2009-02-17 at 15:21 -0500, Andrew Ballard
On Tue, 2009-02-17 at 20:35 +, Lewis Wright wrote:
What about:
function addEvent($values='')
{
!is_array($values) $values = Array('name' = '', 'venue' = '',
'description' ='',
'errors' = Array());
//rest of the code
}
It's nice and sort.
2009/2/17 Ashley Sheridan
Andrew Ballard wrote:
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' =
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
I've had a bit of a problem with a function I'm using for a form.
Essentially, the function looks like this:
function addEvent($values = Array('name' = '', 'venue' = '',
'description' = '', 'errors' = Array()))
1 - 100 of 521 matches
Mail list logo