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. 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'); ?> 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. 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 Link to comment https://forums.phpfreaks.com/topic/124846-solved-function/#findComment-644967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.