Ok PHP fags wtf is this

ok PHP fags wtf is this

var_dump([1...1]);

output:
array(1) {
[0]=>
string(4) "10.1"
}

Attached: php.png (318x159, 3K)

dude just turn off your brain lmao

This is what happens in the background:
[1...1]
[1 .. .1]
[1 .. 0.1]
["1" .. "0.1"]
["10.1"]

I don't know how any sane developer could defend this behaviour. Or use this language at all.

but user dont you know
the whole internet is powered by two greatest cancers ever , javascript and php
still, javascript is billion times worse than php

Still in disbelief that we're in this timeline.

What's the problem?

I don't see what you think the problem with this is. What do you expect the output of this to be?

OP is a JS tranny and acts like his shitty language of choice is somehow better

no i am not , i am unironically php developer

syntax error, desu

I expected "1.01" first, thinking the decimal separator would have higher precedency in parsing than the string concatenation operator. Also giant warnings that these syntax is fucking ambigous.

By the way if you check OP's code the syntax highlighter also on the same mindset there.

ok Python fags wtf is this
>>> print(1 -- 1)
2

$ python3
>>> round(1.5)
2
>>> round(2.5)
2

Yeah, but in what situation you would type something like that? I can't imagine just randomly inserting [1...1] somewhere in the code. There are many reasons to criticise PHP language but the fact that some random character sequence behaves weirdly is not something I would put on the top of that list.

1 - (-1) = 1 + 1 you retard

This is the default rounding you use in financial application, what's the issue? Rounding .5 up sometimes leads to unwanted behaviour.

Foating point is cheating, it's fucked everywhere. IEEE 754 is defective by design.

In floating point, 2.5 is actually like 2.4999999999912536478826384826284

Actually, that's because Python's round() rounds half to even by default. See e.g. non-IEEE 754 example:
>>> import decimal
>>> d = decimal.Decimal
>>> d('1.5').quantize(d('1'))
Decimal('2')
>>> d('2.5').quantize(d('1'))
Decimal('2')
>>> d('2.5').quantize(d('1'), decimal.ROUND_HALF_UP)
Decimal('3')

why are anti-python gays hijacking my thread

>Also giant warnings that these syntax is fucking ambigous.
Do you have warnings set to a suitable level to receive them?

no? 2.5 = 5 / 2
It should literally be 5 * 2^-1 or 2.5

it sucks that 1-- != 0 in python

1-- is invalid syntax in python because there's no postfix operators

PHP parses from right to left, so what you get from the dual usage of "." as decimal and concatenation is as stated.
0.1 concatenated to nothing concatenated to 1 to make 10.1

/thread, finally.