cheechm Posted September 18, 2008 Share Posted September 18, 2008 Why doesn't this work? function testing($value) { echo $value; } testing(0); Getting missing argument error. Tried; function testing($value = '') { echo $value; } testing(0); Doesn't work either. Quote Link to comment https://forums.phpfreaks.com/topic/124846-solved-function/ Share on other sites More sharing options...
F1Fan Posted September 18, 2008 Share Posted September 18, 2008 What happens when you try this: <?php function testing($value) { echo $value; } testing('0'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/124846-solved-function/#findComment-644959 Share on other sites More sharing options...
.josh Posted September 18, 2008 Share Posted September 18, 2008 because putting 0 is the same as putting false when you do it like that. If you were to do like this: $x = 0; testing($x); or testing('0'); those will work. Quote Link to comment https://forums.phpfreaks.com/topic/124846-solved-function/#findComment-644961 Share on other sites More sharing options...
cheechm Posted September 18, 2008 Author Share Posted September 18, 2008 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/124846-solved-function/#findComment-644967 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.