Welcome Guest, Not a member yet? Register   Sign In
warning "missing argument"
#4

[eluser]Phil Sturgeon[/eluser]
By default whenever you create a function ALWAYS set the arguments a default value.

Code:
function doSomething($arg1 = NULL, $arg2="foo") { ... }

It can be = '', = 0, = FALSE, whatever. PHP does not require type casting like many other languages but it is not only good practise to do so whenever possible, but shuts up the CI warning messages ^_^

CI seems to be stricter than PHP which I like, it makes my code better!


Messages In This Thread
warning "missing argument" - by El Forum - 06-21-2007, 09:11 AM
warning "missing argument" - by El Forum - 06-21-2007, 09:27 AM
warning "missing argument" - by El Forum - 06-21-2007, 09:41 AM
warning "missing argument" - by El Forum - 06-21-2007, 05:08 PM
warning "missing argument" - by El Forum - 06-22-2007, 04:39 AM
warning "missing argument" - by El Forum - 06-22-2007, 09:09 AM
warning "missing argument" - by El Forum - 06-22-2007, 05:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB