« first day (3423 days earlier)      last day (1510 days later) » 

1:30 AM
@Girgias You should write it. I'm already talking to Máté for the podcast :-þ
 
1:41 AM
@Derick remember my short tag RFC how poorly written that was. :D It's gonna be more of the same garbage writing :D
 
God damn I love being fucking right.
I don't care about being banned, I just had to say it
 
2:08 AM
The "empty" function is not recognized as a callable. ・ *General Issues ・ #79320
 
2:22 AM
Hello there, I have a quick question. Why can't I echo objects in php.
 
Because it's a complex data structure
 
But then you can output array
Does the spec something about that
 
2:40 AM
If you echo and array you the useless string "Array"
Look at the documentation casting (/type juggling) to string page
 
 
5 hours later…
7:19 AM
@user31782 You can, but only those which have a __toString() method.
 
 
2 hours later…
9:08 AM
can not find required memcached.h with InnoDB Memcached Plugin(libmemcached.so) ・ mysqlnd_memcache ・ #79321
 
 
3 hours later…
11:45 AM
0
Q: Can Anyone Help Me To Understand This array_chunk Working?

Guaravwhy J is working like 0,2,4,1,3 instead of 0,1,2,3,4 anyone can help ? $data1 = ["Monday","08:00","10:00","15:00","16:00","Tuesday","08:00","10:00","18:00","21:00","Monday","11:00","12:00","17:00","20:00","Tuesday","10:00","13:00","17:00","20:00","Monday","06:00","07:00","16:00","18:00"]; $data...

 
12:10 PM
@Guarav Better question for you: why do you have two loops?
What are you trying to achieve there?
Are you trying to find the intersection?
 
Happy Leap Day
 
Hurrar for obscure calendar edge cases!
 
:D
 
buffer overflow
 
12:25 PM
Can I close this bugs.php.net/bug.php?id=69593 as it seems to be fix as of 7.1.25 (or at least @cmb test cases doesn't segfautl anymore)
 
I'm remarkably pleased my calendar applet works today considering I made it myself
 
cmb
@Girgias yes; might basically just be a duplicate of bugs.php.net/bug.php?id=69373
 
Cheers will do :)
 
cmb
12:52 PM
ta
 
1:43 PM
Anybody has a list of bug reports about the decimal seperator thing?
Currently got this, but seems pretty short :| gist.github.com/Girgias/b4d8a2e0b5d260fdc031159b7ed94555
 
2:23 PM
@MarkR you don't have a unit test for it? :P
 
bahaha, you're funny.
(no)
 
cmb
@Girgias if the behavior has been reported as bug, those tickets likely have been closed as bogus, or maybe as duplicates, which makes them harder to find. One example: bugs.php.net/55160 (I particularly like "PHP's shitty float to string cast")
 
lol @ 2013
 
2:56 PM
@cmb yeah I know that's why I'm asking if people have examples of them :D
 
cmb
@MarkR bugs.php.net/39305 is from 2006
 
Oh cmonnnnnnnnn :|
That's just depressing.
 
Yeah
Anyway if people have ideas on what to add to it/improve it leave a comment on the gist
 
Just the big red box at the top of the setlocale box should be enough to bin it
On the other hand, as I've just spent the better part of the month changing all my date / time representations from global state (default timzone) to a DI'd locale, I understand the pain it may bring, but the whole thing seems ridiculous and needs to die.
 
3:45 PM
how does one quantify knowledge into "years of experience" with a language?
 
now() - year you wrote a line of code in it
disregarding of how much you actually used it
 
if I went by that, I should be applying for senior positions, but I don't have the knowledge expected of a senior position
 
by what standard?
 
design patterns, algorithms
what makes it difficult is that I juggled multiple, ongoing projects in my last job, most of which didn't require programming
or the programming was minor
 
so you have soft skills actually talking to people about requirements and such?
 
3:57 PM
 
My written soft skills are decent, I think. I did some devops, worked with sharepoint, communicated with third-party vendors...I guess that falls under soft skills
I worked a lot with administrative systems (i.e. setting them up) with some front-end/back-end work
 
@Tiffany just saying, it sounds to me a little that you are underestimating yourself. especially algorithms is needed for a lot of things, and design patterns are something frameworks ease you into
 
I'm wondering if I should keep the "enclosure" argument for my CSV extension
Seems not to make a lot of sense if the point of it is to be RFC 4180 compliant
 
@beberlei impostor syndrome :/
thanks for the answers though, it is appreciated :)
 
Imposter syndrome is an essential qualification for senior positions.
If you don't have it yet, you've not learnt enough to know how little you know xD
 
4:04 PM
knowing that you cant ever know everything can be debilitating
 
I'm a senior engineer, and an architect of a product which brings in millions of dollars, and I still feel sick to the pit of my stomach when I show someone else my code or hit on something I don't know
 
@MarkR you've seen my code :S
 
It's a good start :-) like I mentioned at the time, you need to focus on learning how to map real world scenarios into logical constructs which you can then turn into code.
That will only come from actually doing it.
 
Is there a point to ZEND_MODULE_INFO_D second argument [(ZEND_MODULE_INFO_FUNC_ARGS)]? is it for Zend extensions and not PHP extensions?
 
4:20 PM
@NikiC I think 7am my time is 3pm your time; which day next week works best for you?
 
4:33 PM
Just to be sure there is no "inverse" function to str-getcsv() right? php.net/manual/en/function.str-getcsv.php
 
@Girgias Don't think so, buy you can fputcsv() into a php://memory resource, then read that back
 
Cheers
Another reason for a new CSV extension :')
 
thats also my pattern
 
5:18 PM
So I've updated my CSV extension to have a more consistent function naming: https://gitlab.com/Girgias/csv-php-extension
Also got a draft RFC to add it to core: https://gitlab.com/Girgias/csv-php-extension/-/blob/master/rfc.md

Reviews and comments would be great :)
 
I'll give it a proofread
 
How does it handle newlines?
 
It handles them just fine :)
 
"Include a new extension into PHP which handles the conversion between
arrays and strings for CSV rows following RFC 4180."
The portion from "following" on wards may be written as "which follows RFC 4180" or "that follows RFC 4180" to indicate that the extension _will_ follow RFC 4180
forgot I can't format, oh well
 
It's fine :p A PR is also welcomed :p (but I'll edit it myself will be quicker)
 
5:23 PM
not sure I have a gitlab account
 
Don't worry about it
@MarkR I'll add some test cases just to be sure (I though I wrote some with new lines)
 
Hmmm I didn't realise the standard included escaping with %
or am I reading this RFC 4180wrong
 
You escape by surrounding the field with " (or the chosen enclosure)
 
Would \n still appear in the output stream in that case?
 
You escape in 4 situations, if there is a LINE FEED, CARRIAGE RETURN, the delimiter, or " (/the enclosure) in the field
It should yeah
 
5:27 PM
In that case, I would suggest that you may wish to add something that parses an entire string into multiple rows, where it can keep track internally, otherwise explode("\n", $input) would ... well... explode, no?
 
That's on the list yeah
Still working on it tbh
 
Groovy.
 
… writing PHP … just wrote that cursed line … $target = &$$target;
 
Why... would you even, what?
 
Can we please have Windows builds for PHP 7.2+ ? ・ rrd ・ #79322
 
5:40 PM
Oh, a specific PECL package. I was thinking "eh?"
 
@Girgias PR submitted
 
@bwoebi try something as $GLOBALS["target"] = &$$target; :D
 
@Tiffany merged :)
 
\o/
 
@Tpojka Haven't used $GLOBALS yet with variable variables
 
5:49 PM
Me neither but seems right with that current code. :D
 
And I'm not going to unless I have very good reason…
 
And try to wrap all together into eval. :P
 
@Tpojka nah, I prefer writing files (well, cache, if not exists) and including them, plays better with opcache
 
2.0.6 not built for 7.4, see logs ・ lua ・ #79323
 
6:05 PM
Morning
 
6:31 PM
Do you guys (A) use (instantiate) the same object classes in different routes/controllers, OR (B) always write a new object class per controller so you can manage it separately - even though it'd be entirely dupe?
 
Depends on the kind. Middleware can do A, but usually my controllers are set-up + tear-down so I can do things like assign properties to them, so B
Maybe I missread what you mean though, why would you have two controllers which are exact duplicates?
 
same, need clarification
 
the 2 controllers serve a different route and purpose but use the same data in some places
 
my gut is that you are not using/misusing DI
 
so e.g. basic user data (name, address) is used in a few places but for different functionality
this is Symfony so autowire and DI everywhere (not sure if "misuse" tho..)
 
6:36 PM
@James so like are you saying that you would have the same logic to fetch that data in two different controller classes?
full disclosure: I have never, not once, ever, come up with/used/even seen a data access layer that I am completely satisfied with, especially on the web. I don't think such a thing actually exists.
 
yes. same service class calls same repo class, curl to API (etc) to get same user data; Two controllers DI same service class, get same data... therefore using the same factory/object class would "work" fine, just not sure if some voilation
 
in a way that's the point of the factory/data accessor
it should be basically just one duplicate line of code in the controllers though?
i.e. $this->userRepo->fetch($uid) or whatever
 
yeah
seems ok, if one diverges (eg additional properties/data) then I'd create a new one at that point?
 
yeh you can't really eliminate that :-P sounds like you don't really have a problem (in my highly non-authoritative opinion)
 
I read a lot and (seemingly knowledge) people say never reuse objects like that. I dont see a valid reason not to. meh gonna do it. thanks :)
 
6:41 PM
@James I mean really the whole point of "good" DI is to avoid hiding your dependencies, so don't start bundling accessors for different entity types into a single monolith or something, but other than that it sounds fine to me from that description
 
any changes people (devs) should be checking what uses the object/factory first anyway to see if there's a conflict between usages
 
again, given this constraint:
4 mins ago, by DaveRandom
full disclosure: I have never, not once, ever, come up with/used/even seen a data access layer that I am completely satisfied with, especially on the web. I don't think such a thing actually exists.
:-P
 
mine is perfect :P
(disclaimer: imo..)
 
@James well yeh, but also unit tests should catch stuff like that
*properly written unit tests
 
in theory..we have a ticket for that..one day :D
 
6:43 PM
@James I 100% guarantee you will hate it in 6 months or less :-P
that's been my experience, anyway
 
not looking forward to it given we have a ton of code. but I guess the extra work pays off
 
@James that's the answer to the only real sticking point you've mentioned, i.e.
3 mins ago, by James
any changes people (devs) should be checking what uses the object/factory first anyway to see if there's a conflict between usages
people can go a but mad with testing but it really does have value, I promise :-P
 
:)
 
@James you don't have to do it overnight. Start by doing 10 minutes a day. You can write at least 5 tests a day, in a month you'll have 100
/me cooks
 
well we only have 40 controllers, not a huge site atm
 
6:49 PM
MIME type of MP3s over 50MB is incorrect ・ Filesystem function related ・ #79325
 
7:14 PM
@DaveRandom what'd you make?
 
@James start with the easy wins as well, is the other thing I would say. So back-end stuff (i.e. that deals exclusively with abstract data rather than interacting with messy web request data) which performs simple deterministic operations. Testing an existing codebase will inevitably lead to you discovering stuff that needs rewriting, and it's (imho) much better to start that process in a place which will have the smallest possible impact on the codebase as a whole
Also #protip: if you're finding it hard to write a test for a piece of code, the code needs changing
and (possibly counter intuitively) you want to keep the code coverage for any given single test as low as possible. I've spoken to many people who've fallen into the trap of a "bigger is better" mentality, but the more LoC a test visits, the less useful it becomes (because the more potential causes there are for a failure)
@Tiffany just cheese and ham toasties w/ carrot and cucumber sticks, dinner for The Boy
I have to go out in a bit so not eating til later as it will just introduce lethargy
 
8:06 PM
@AsyncBot @cmb you have admin on bugsnet, right? Either I am blind or the fileinfo ext is missing from the package list dropdown
can't find it by greping "finfo", "fileinfo", "magic" or "mime" anyway
 
8:21 PM
Have you been an RM for a PHP release, @DaveRandom? :P
 
 
2 hours later…
cmb
10:10 PM
@DaveRandom I'm moderator on bugsnet, but these categories need to be added to the database I believe, and I don't have access to it. There are quite some categories missing for a long time; fileinfo is one of them.
 
@cmb aye @DaveRandom
We just need to get proper tagging fwiw though
 
cmb
@Girgias RFC 4180 is informational, and insufficient (doesn't mention anything about character encoding, for instance)
 
@cmb I know that, still the closest we have to something "standard"
 
cmb
@Girgias str_getcsv() is mostly nonsense; drives people to split by line and then use it; doesn't work for linebreaks in fields
 
On a totally unrelated note I made a thing soundcloud.com/user-93315143/just-alone
 
10:13 PM
@cmb Yeah I saw your editor note on the first note :')
 
cc @StatikStasis ^^
 
cmb
@Girgias ACK. But IMHO follow Postel's law.
 
@cmb do you want it to trim whitespaces around the field? Or accept \n as an EOL new line?
The EOL one shouldn't be too hard, the trimming a bit more annoying
Still I feel I should drop the support for using a custom enclosure, as I don't see it why people would use it
 
cmb
@PeeHaa fully agree; current state is suboptimal: missing categories, misleading categories ("Filter related" is mostly use wrong), selecting is hard
 
Super tempted to push my partial rewrite, but stuff might break :P
 
cmb
10:25 PM
@Girgias custom enclosure might be interesting for non ASCII compatible character encodings (e.g. UTF-16); also some spreadsheet apps allow to choose it
 
Fair enough, I've already implemented it so no need to get rid of it then
 
cmb
well, clean up early has its advantages as well :)
@PeeHaa a broken bugsnet might give time for other stuff ;)
 
I like that line of reasoning :D
 
@cmb I think to support UTF-16 there would need to be a way to pass the EOL sequence
 
cmb
Ah indeed! Not sure if supporting non ASCII compatible encodings is really necessary, though.
 
10:35 PM
Tbf that would be the least complicated bit to add :p but that can always wait a bit
I'll add in the Open Issues section in the RFC draft
 
10:46 PM
I was playing about a bit more with exposing the function table as constants and returning a closure, but as nice as it feels, I'm not sure how thrilled I feel about having two independent symbol tables that have to be fully aware of each other
 
Maybe when we get to the point of merging them together? :p
 
Aye.
 
cmb
@Girgias, I forgot the perhaps most important float->string conversion issue: bugs.php.net/79317; to solve it, SCCP would have to be (partially) disabled/removed. Certainly not desireable.
 
SCCP meaning?
 
cmb
In computer science, sparse conditional constant propagation is an optimization frequently applied in compilers after conversion to static single assignment form (SSA). It simultaneously removes some kinds of dead code and propagates constants throughout a program. Moreover, it can find more constant values, and thus more opportunities for improvement, than separately applying dead code elimination and constant propagation in any order or any number of repetitions.The algorithm operates by performing abstract interpretation of the code in SSA form. During abstract interpretation, it typically...
 
10:53 PM
Huh, indeed ...
Deprecating setlocale just seems easier at that point u.u
 
The only alternative to that would be some kind of per-thread storage and then acquiring a mutex before any formatting, changing the process locale, doing the work, setting it back to whatever it was before, and then releasing the lock.... all of which sounds extremely bug prone and way too much effort vs deleting setlocale
 
Apparently Hack implemented that c.f. the thread from 5 years ago where Dan raised the question about deprecating setlocale: externals.io/message/85638
 
cmb
I don't think that removing setlocale() is necessary (and unlikely to be accepted anyway); wouldn't making float -> string conversions locale independent (mostly) suffice?
 
Meaning that OpCache could interfere with the float -> string conversion? I'm having a hard time grasping as I didn't look into it yet (and @MátéKocsis already made a PR for this)
 
My understanding is that opcache is seeing an expression which can be condensed down into a single constant, but when it does it, it's using whatever locale it's in at the time, thus if it runs again with a different locale any knowledge of there ever being a float there in the first place has already been erased.
 
cmb
11:05 PM
^ That
 
I got that bit (kinda), but what I don't get is the end of the sentence "wouldn't making float -> string conversions locale independent (mostly) suffice", would that be sufficient for OpCache not to do that?
So if we cover all the cases where a float gets casted to a string the opcache issue is fixed as a byproduct?
 
cmb
yes, since it wouldn't matter anymore which locale is currently in use
 
The only alternative would be to introduce something like the HTTP Vary header and replace the one constant with an opcode to check a hashmap shoved in the cache slot where the key would be a certain set of parameters (locale in this case) and cache the result, but again it seems too much effort for not enough gain.
 
Ah okay gocha then
Weird unrelated question, how to I get a zval from a HashTable pointer?
 
Looking at the defines, I'd guess ZVAL_ARR(zval, ptr)
 
11:15 PM
I'm a dumbass
zval *tmp = ZVAL_ARR(&tmp, row);
Obviously that's not gonna work
 
11:27 PM
Capitalism is weird. I've just spent almost £3 on ebay to buy and ship a single 'S' keycap across the country because a 0.1mm piece of plastic broke on existing one.
 
@Girgias New extensions shouldn't be added to core immediately. Let it get some users, who then can ask for it first.
 
thanks @DaveRandom :)
 
Oh oh, I want a new CSV function o/
 
@Derick but but but the current ones are broken :(
 
@DaveRandom I do - email me.
@Girgias CSV is even harder than email to get right.
 
11:35 PM
I'm seeing that
 
and there is no way you get it right on the first try - so, would you really want your first implementation to be in PHP, where you can never change the behaviour until a major bump? (or preferably, not at all?)
 
ukrnslekop ・ *General Issues ・ #79326
 
that looks an awful lot like spam.... but I can't read russian
 
@Derick fair point
Still need to figure out how to get a PECL account and how that works
 
that's the easy bit
 
11:41 PM
oh no not another form
Does that get send to the list and need to be approved manually?
 
wonders how many different ways this one has to call you stupid
 
I can approve it
 
Oh sweet so I can just ping you?
 
I can approve most things...
 
I'll do it right away then
 
11:42 PM
You shouldn't, but you may
 
Derick is PHP god confirmed
 
there is a big step though: " I have already discussed the topic of maintaining and/or adding a PECL extension on the pecl-dev@lists.php.net mailing list, and we determined it's time for me to have a PECL account. "
 
> Saving it... OK
> Creating file /home/ubuntu/svn/doc-en/doc-base/entities/file-entities.ent... done
> Checking for if we should generate a simplified file... no
> Checking whether to save an invalid .manual.xml... no
> Loading and parsing manual.xml...
Do not run configure.php on a t2.micro EC2... [check]
 
@Sherif My evening sounds like a lot more fun.
 
Welp
 
11:45 PM
@Derick Well, it's not like I set the bar very high for you
 
sent it off without even being subscribed to that list
 
the bar was pretty good to be honest
 
I see what you did there
 
:-D
Beer in the bar, uisge beatha at home
 
@Sherif I've made a small patch to class properties docs a few weeks ago. Can you have a look at it? :-D
 
11:48 PM
@BogdanUngureanu Sure, just give me like 6 weeks to finish running configure
 
@BogdanUngureanu Where's the patch?
 
@BogdanUngureanu Yea, I mean where did you do it? It wasn't in edit.php.net was it?
 
Yeah, it was on edit.php.net
 
11:52 PM
and it was never seen again ^.^
 
@BogdanUngureanu It's down right now. So I can't do anything about it until it comes back up.
 
For a second I thought I did something wrong and didn't publish it. :D The UI is not that great
 
Yea, that's why I don't touch it.
I can barely work the toaster around here. They expect me to know how to do fancy programming stuff too!
bollocks!
 

« first day (3423 days earlier)      last day (1510 days later) »