This profile is from a federated server and may be incomplete. Browse more on the original instance.
dseguy, 8 days ago to php French #PHP question of the day : when you know that 2*2 = 4 2^2 = 4 (too) 2.5^2.5 = 9.8821176880262.. Where is this 6 coming from ? #phptip #phptrick
#PHP question of the day : when you know that 2*2 = 4 2^2 = 4 (too) 2.5^2.5 = 9.8821176880262..
Where is this 6 coming from ?
#phptip #phptrick
dseguy, 2 days ago French @arnan This starts with floats, but ends with integer.
@arnan This starts with floats, but ends with integer.
dseguy, 2 days ago French @derickr The first print shows 4, the second one says 6.
@derickr The first print shows 4, the second one says 6.
dseguy, 2 days ago French @JerryWham The first print shows 4, the second one shows 6.
@JerryWham The first print shows 4, the second one shows 6.
dseguy, 1 month ago to php French #PHP doesn't allow float as index in arrays. It is possible to use them as such by casting them to string. Later, type juggling will allow adding to another float, seamlessly. #phptip #phptrick https://php-tips.readthedocs.io/en/latest/tips/store_float_as_index.html
#PHP doesn't allow float as index in arrays.
It is possible to use them as such by casting them to string. Later, type juggling will allow adding to another float, seamlessly.
https://php-tips.readthedocs.io/en/latest/tips/store_float_as_index.html
dseguy, 29 days ago French @mitelg mea culpa, it was seamless in the case I was working on. With a finite float, it works. With calculated float, there are possible hidden decimals : https://3v4l.org/dJ0mP; It will loose precision with the default #PHP 'precision' (the directive), but not with higher levels (due to truncation).
@mitelg mea culpa, it was seamless in the case I was working on.
With a finite float, it works.
With calculated float, there are possible hidden decimals : https://3v4l.org/dJ0mP;
It will loose precision with the default #PHP 'precision' (the directive), but not with higher levels (due to truncation).
nixCraft, 1 month ago to random PHP was originally an abbreviation of Personal Home Page 🤔 did you know that?
PHP was originally an abbreviation of Personal Home Page 🤔 did you know that?
dseguy, 1 month ago @nixCraft Indeed. It also means a lot of other things, funny or downright serious. https://www.exakat.io/en/what-does-php-mean/
@nixCraft Indeed. It also means a lot of other things, funny or downright serious.
https://www.exakat.io/en/what-does-php-mean/
dseguy, 2 months ago to php French I finally found an occurrence of this beauty : $this->$this It still looks like a typo in the original code, but with the help of #PHP __toString, it works. Also, strict_types doesn't help here. https://php-tips.readthedocs.io/en/latest/tips/this_this.html and more tips! #phptip #phptrick
I finally found an occurrence of this beauty :
$this->$this
It still looks like a typo in the original code, but with the help of #PHP __toString, it works. Also, strict_types doesn't help here.
https://php-tips.readthedocs.io/en/latest/tips/this_this.html and more tips!
dseguy, 2 months ago @Crell I knew that trick for a while now, but I only found it in actual code yesterday. One less to find in the wild, still waiting for a few of them to appear. "If there is a mean, there is a will."
@Crell I knew that trick for a while now, but I only found it in actual code yesterday.
One less to find in the wild, still waiting for a few of them to appear.
"If there is a mean, there is a will."
dseguy, 2 months ago @ocramius 'that was not a question' (tm)
@ocramius 'that was not a question' (tm)
dseguy, 1 month ago @NanoSector it took me a few years to find one in the wild. You can relax.
@NanoSector it took me a few years to find one in the wild. You can relax.
dseguy, 1 month ago @asgrim @ocramius This was not a question!
@asgrim @ocramius This was not a question!
dseguy, 1 month ago French @pollita Coming from you, I take it as a compliment. Thanks 😎
@pollita Coming from you, I take it as a compliment. Thanks 😎
dseguy, 1 month ago French @wez Touché.
@wez Touché.
dseguy, 1 month ago @edorian Always a pleasure. As long as I don't find this in your code, of course. 😂
@edorian Always a pleasure.
As long as I don't find this in your code, of course. 😂
dseguy, 1 month ago French @heiglandreas 😂 :elephpant:
@heiglandreas 😂 :elephpant:
dseguy, 2 months ago to php French it is possible to call a method 'as', because relaxed keywords #PHP methods it is possible to import a method from a trait, and alias it to itself. It is possible to write 'as as as ' in #PHP and make sense. #phptip #phptrick https://php-tips.readthedocs.io/en/latest/tips/as-as-as.html
it is possible to call a method 'as', because relaxed keywords #PHP methods
it is possible to import a method from a trait, and alias it to itself.
It is possible to write 'as as as ' in #PHP and make sense.
https://php-tips.readthedocs.io/en/latest/tips/as-as-as.html
dseguy, 2 months ago @gmazzap 😂 😂 I just love it when using actual #PHP syntax to spell out a human readable message.
@gmazzap 😂 😂 I just love it when using actual #PHP syntax to spell out a human readable message.
dseguy, 2 months ago French @alessandrolai 😮 Aliased constructor...!! I might have overlooked that one.
@alessandrolai 😮 Aliased constructor...!! I might have overlooked that one.