-
Notifications
You must be signed in to change notification settings - Fork 14
Distinguish number between int and float #19
Comments
Hi, thanks for noticing! I was not sure how good it would be when you pass Though later I also faces a need to somehow differ float from int. As I'm currently doing some wild changes on php-v8 so I will cover this issue in one of commits. |
FTR, psx-v8/composer.json: if you do mean to require php-v8, it requires PHP >= 7.0, so I'd suggest to specify |
Thx for the info and the fix. Regarding the |
Hi, thx for the fix! Do you have roughly any time plan for a first stable version or are there plans for any huge BC breaks. I think the current API looks really great. |
0.1.2 was just released and it has numerous BC breaks, though it's less likely that you'll be affected, see release notice for details. There will be more upcoming BC-breaking changes in forseable future, not specific details at this time, but I plan to perform some API simplification and performance optimization. |
Hi, I have the case where I define javascript code which defines a
number
and on the PHP side I have to differentiate whether the value is an int or float. At the moment all defined numbers are float. I have looked a bit in the source and the check whether to return an integer or float from a number is already implemented (php_v8_value.cc:268
) but commented. Do you have plans to activate this detection? Otherwise I have to perform this check on the PHP side with something likestrpos('.', $value) === false ? (int) $value : $value
which I think is not the best solution.The text was updated successfully, but these errors were encountered: