0

how to add a default argument for the below code

<?php function expo($n, $e) { return $n ^ $e; } ?>

21st Sep 2017, 7:36 AM
Srikanth iyer
Srikanth iyer - avatar
10 odpowiedzi
+ 1
Have you tried turning it off and on again?
21st Sep 2017, 7:42 AM
autoritah
21st Sep 2017, 8:09 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
function expo($n= 5, $e=8)
21st Sep 2017, 7:39 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
then what would be the expected output
21st Sep 2017, 7:41 AM
Srikanth iyer
Srikanth iyer - avatar
0
I am not getting output could you just explain what and how to add a default arguments in php in programs
21st Sep 2017, 7:45 AM
Srikanth iyer
Srikanth iyer - avatar
0
do you know what "^" bitwise operator doing?
21st Sep 2017, 7:54 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
maybe this code helps: function expo ($n=2, $m=3){ return $n**$m; }
21st Sep 2017, 8:00 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
dude yaroslav in your code why have you written echo sum(7,3) you could have written echo sum(2,1) itself right I dint understand that part
21st Sep 2017, 10:28 AM
Srikanth iyer
Srikanth iyer - avatar
0
2 and 1 are default values if u try emply sum( );
21st Sep 2017, 10:30 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
0
oh okay thanks
21st Sep 2017, 10:32 AM
Srikanth iyer
Srikanth iyer - avatar