开发者

AMFPHP overiding default function arguments?

开发者 https://www.devze.com 2023-01-11 04:55 出处:网络
I\'ve got this odd problem. If I make a call on that function through amfphp service browser and give it a valid ID and leave the $num_images field blank amfphp will actually pass a blank string as t

I've got this odd problem.

If I make a call on that function through amfphp service browser and give it a valid ID and leave the $num_images field blank amfphp will actually pass a blank string as the argument.

// if i c开发者_高级运维all this function width just an ID
function getWorkers($id, $num_images = 100) {
    ...
    // num_images will be set as ''
}

I can easily override using a check:

function getWorkers($id, $num_images = 100) {
    if($num_images=='') $num_images = 100;
    ...
    // num_images will now be really set as 100
}

Anyone experiencing the same with amfphp?


That's odd, I never got that from AMFPHP. If you don't have the latest version try updating your installation of AMFPHP. Also make sure Flash doesn't somehow pass an empty variable as the second variable.

(Copied from the comment.)

0

精彩评论

暂无评论...
验证码 换一张
取 消