« first day (4257 days earlier)      last day (917 days later) » 

05:53
morns
wow, such empty :(
 
3 hours later…
09:16
@Tiffany yeah I was trying to find the bug which was causing it, I was using steam wrapper to upload to some remote location and I was handling maximum timeout, by recalling the script so when I was recalling the script then the stream used to close, that's what I wanted to ask if when script dies does it calls fclose if any file is fopen
 
5 hours later…
14:03
'2' | '3' | '4' // '7'
can anyone tell why the result of above is '7' ? i never used | in php
14:21
bitwise or on those when converted to numbers
ThW
ThW
@Mwthreex 3 contains 2 (bitwise): 3v4l.org/sQrOr#v8.1.7
14:40
hello guys
can anyone tell me how to solve exporting data to csv file when the file has special cherecters ?
in my case it is hebrew charecters
I wrote a php code to export data to CSV file
but data exported that includes Hebrew characters are showing as gibberish
Here is my code
https://pastebin.com/D7e492Hv
And here is how it is showing after being exported
https://ibb.co/jzSpqmJ
15:36
@ac89live check encoding is Unicode
If the source data isn't encoded as Unicode, try to figure out what encoding it is, there are mb_ functions that can help but there are a couple of edge cases where they fail detection. Once you know the source encoding, re-encode to Unicode, then export to CSV, but make sure that when it's exported, it's exported as Unicode, and the CSV is encoded as Unicode
Make sure your database is encoded as UTF-8 as well
my database in indeed encoded as utf-8
i tried also the utf8_encode , but no luck ...
someone says here that we should use the fwrite instead on fputcsv
0
Q: PHP Cron Script - read from from CSV file and email (UTF-8?)

user2295798I am struggling with this issue for few days now, reading and trying whatever I came across with no solution found: Here is the bottom line of what I want to do: I have a members only system. when a member posts a message on the message board all others get notification by email. Simple. I use th...

but when i used the fwrite , it wrote nothign , empty output
 
1 hour later…
cmb
cmb
16:48
@ac89live Don't use utf8_encode() at all (cc @IMSoP ;)
Anyway, I think you need to choose UTF-8 when importing the CSV file.
17:20
> I would find it highly concerning if fn() => X and fn() => { return X; } had differences in capture semantics.
@NikiC did you mean that just in relation to the 'this' shenanigans, or more widely, so you'd be against requiring something like use(*) to trigger auto-capture for multi-line short closures?
use(*) is just extra typing for no good reason, IMO.
 
2 hours later…
19:15
Explicitness of intent is usually is a pretty good reason
although I'm #teamuse(...)
19:56
@MarkR just because saying doot-doot-doot is fun?
20:12
@Crell And using fn to imply "auto caputre" is not a good reason either IMHO
But is consistent with the language as it is today. What alternative is there that doesn't involve a lot more typing?
I don't see the issue with more typing
especially if you are going to use types for arguments/params you're typing way more than what you need
20:27
Avoiding unnecessary syntax to make the code easier to write, read, and maintain is the point.
Using fn and function for that is terrible I will bet my hand that at one point someone somewhere is going to decide to want a consistent function style and always use fn and then get confused
Or they have a by-ref use and complain that it's ugly they can't use fn and it should cater to that
@Danack Nah, it's just the de-facto syntax for "collect or work on an arbitrary number of things" such as arguments
I would also argue using use(*) is easiter to read and maintain than having fn and function being all over the place
We already have fn.
Which can only be used in an extremely limited scope
And got introduced because of the whole parser and syntax ambiguity issue
and I did not vote on that RFC
as it was before my time
20:48
@Crell as I said on list, I don't think anyone thinks of "fn" as being a particularly important keyword right now; they talk about "arrow functions", and if asked to read it out would probably pronounce "fn" as "function" and not think about the difference
so saying "fn already means that" is... stretching the truth, IMO
we should probably have made fn a synonym of function straight away, because that's all it was ever supposed to mean
That would be rather confusing with one being auto capturing and the other not.
no, I'm saying instead of that distinction
function() => $x as auto-capturing, function() { return $x; } as not
it honestly never occurred to me before this RFC that "fn" meant anything other than "function, but when you can't be bothered to type all the letters"
I feel I'vre got nothing to say as @IMSoP is already saying everything I think
I think you should be careful what you wish for with the => as auto capturing because there's a not entirely unreasonable chance that at some point the tide will turn for short functions.
Then again I think most of those usages were probably more related to getters and setters
21:03
there generally isn't a scope to capture when you declare a function in PHP
you can technically declare a function inside another function, but it's not generally particularly useful
Fair point
that said, short methods that auto-capture properties might actually be more interesting than just "you don't have to type return any more"
Well, I already tried to make single-line functions shorter and that got soundly rejected. :-)
@ArnaudLeBlanc btw, pinging you into the discussion.
yes, because you were just removing the word "return"; I'm suggesting we could do more than that
class Foo {
    private $bar;
    function setBar($newBar) => $bar = $newBar;
    function getBar() => $bar;
}
I'm not totally sold on it, but it feels more significant a feature than skipping one keyword
With Iliya working on accessors, that could be an interesting intersection. I'm not sure if a good one or bad one, TBH.
Using => would be a good intersection. Skipping the $this->... I dunno, PHP is very consistent about always needing $this->
21:16
it's very consistent about functions starting with an empty scope, too, but you're dead set on changing that
As far as making fn and function identical, then we need some way to flip auto-capture on and off that is consistent with both the existing syntaxes. And... I don't know how we do that.
Named functions, yes. Closures already have capturing.
(Since you implied it on the list, in hindsight I think it would have been better had we skipped manual capture entirely. My recollection is a lot of people concerned about the mess that is Javascript, but in practice I think by-value capture resolves 90% of those issues anyway.)
@Crell why does it need to be consistent with both syntaxes? leave arrow functions alone, and add use(...) to full closures; job done
Because ergonomically we want the language to be predictable? We could debate what qualifies as predictable, no doubt, but the implications of certain syntax usages should be "oh, yeah, that's what I'd expect it to do" or "ah, that makes sense now that I see it". Not "well, that's weird, but... whatever."
(Yes, those are all subjective, but hopefully we can agree on that as a heuristic goal.)
maybe I'm influenced by experiencing the discussion leading up to fn() => $x; if we'd stuck with () ~> $x or () ==> $x or \() => $x, I don't think we'd be having the same discussion
Perhaps. It would change the status quo we're comparing against. But we can't go back and change that now.
21:31
I think it's fine for the => on its own to mean "here is an expression, which will be turned into a closure by adding return and use as appropriate"
the fn is just noise to keep the parser happy
22:26
/me watching DS9
HOUSE OF QUARK?!?! bahahahah
That's a fun one.
Did you know that if 3 Quarks from alternative timelines meet they form a Hadron Bartender?
Is he a Charm Quark or a Strange Quark?
I think hes got a strange charm... for a ferengi.
Quark teaching the Klingon High Council "how to spreadsheets"
22:49
Klingons may be great warriors, but spreadsheets are an area where they don't excel.

« first day (4257 days earlier)      last day (917 days later) »