[SR-Users] $null + 0 is not int
jh at tutpro.com
Sun Dec 1 12:29:05 CET 2019
I added 0 to $null in order to get int. If I had added "0" the result should be string. So this looks like a bug to me. If I add 0, result can't be string.
On December 1, 2019 6:08:01 PM GMT+09:00, Daniel-Constantin Mierla <miconda at gmail.com> wrote:
>Probably is string, that's the default value type of PVs, as they
>originated from xlog, where the output was a string to be printed.
>"" + 0 should be "0"
>On 01.12.19 02:35, Juha Heinanen wrote:
>> Why is it that $null + 0 is 0 but not int? What is it?
>> -- Juha
>> $avp(test) = $null + 0;
>> if (is_int("$avp(test)"))
>> INFO(test $avp(test) IS int);
>> INFO(test $avp(test) IS NOT int);
>> Dec 1 02:46:01 salmon /usr/bin/sip-proxy: INFO: test 0 IS NOT
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
More information about the sr-users