« first day (2747 days earlier)      last day (2215 days later) » 

12:00 PM
> The PHP language uses a classical inheritance model. This means you start with a single generalized root class that provides a base implementation. You extend the root class to create more specialized classes that inherit their immediate parent's implementation.
> The classical inheritance model works well most of the time. However, what do we do if two unrelated PHP classes need to exhibit similar behavior? For example, a PHP class RetailStore and another PHP class Car are very different classes and don't share a common parent in their inheritance hierarchies. However, both classes should be geocodable into latitude and longitude coordinates for display on a map.
> Traits were created for exactly this purpose. They enable modular implementations that can be injected into otherwise unrelated classes. Traits also encourage code reuse.
.... that's what he says leading up to it... then there's more but I've spammed chat enough
 
@Wes yes, traits are not like interfaces at all. They do kind of resemble parent class. But they will not overwrite the class's own methods. But if you have the same class with multiple traits, which all have a similar method, then you have an option to rename then inside the class. Like TraitAFoo, TraitBFoo or TraitCFoo etc.
@JayIsTooCommon Its still available in the playground
 
You know? I know there's a lot of hate and flack about it, but making changes to WordPress themes as well as getting and setting post data programmatically is extremely simple and straightforward
 
@Tiffany I would say that's a different responsibility
 
Anonymous
@MadaraUchiha the same could be said about dropping a toaster in the bath.
 
I'll take a screenshot of the next section and delete it later, he goes into further reasoning
 
12:05 PM
@JayIsTooCommon How so?
 
@MadaraUchiha That's the reason it's so popular
 
Anonymous
Simple, straight forward and just as fun as using Wordpress
 
Rather, I can see the benefit of making changes to WordPress themes and CRUDing posts, not much so in the case of dropping a toaster into the bath.
 
@PeeHaa I'm imagining it's more than what your average WordPress user needs
 
12:06 PM
@MadaraUchiha Depends on who the user is
I see the user as the web agencies trying to write a quick website for a client
 
@PeeHaa weren't you working on an unfucked version of wordpress at one point?
 
@PeeHaa Yes, those
 
Anonymous
@Tiffany Hard to comment without an example of what the 'geocode' code would entail.
 
@PaulCrovella yeah I was. Deleted a ton of shit but gave up
@Tiffany That's not what dry means
 
@JayIsTooCommon that's the next page
 
Anonymous
12:08 PM
screeny
 
Anonymous
pls
 
DRY means that for every concept in your application there should be one and only one abstraction (class, cluster of functions, whatever) to represent it.
 
Never duplicate code is imo missing the point of dry
 
@JayIsTooCommon imgur.com/a/Otdi58X
 
@Tiffany Where are you taking these from? A book?
 
12:09 PM
How soon can I drop #PHP 7.2 support? Should I wait for 7.3 alpha?
 
Oh it's a wikipedia reference
 
@MadaraUchiha yeah, Modern PHP
 
Makes sense :P
 
mindlessly adhering to DRY is a great way to make the wrong abstractions
 
Damn Wes, now they know
 
12:10 PM
A few years back I used to use traits like this. gist.github.com/mega6382/e64ed30710048e7902dbc977b50cde80 //cc @Wes
 
@MadaraUchiha amazon.com/Modern-PHP-Features-Good-Practices/dp/1491905018 same dude that made PHP The Right Way
 
Served me well
 
@infinite_scream, the void
@NoraReed's true feelings. used to post less but then people apparently decided fascism was a great fucking idea
142k tweets, 41.2k followers, following 1 users
 
to work I go!
 
12:11 PM
@Ocramius I thought it would be better than creating a base controller. :P
 
Anonymous
seems to be using DRY a bit too literal.
 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHH‌​HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
 
@PaulCrovella Or not understanding DRY. It's about not duplicating knowledge, rather than lines of codes. That's the mistake the author made there.
 
Wes
say trait three times in the mirror and @Ocramius appears
13
 
12:12 PM
3 mins ago, by Madara Uchiha
DRY means that for every concept in your application there should be one and only one abstraction (class, cluster of functions, whatever) to represent it.
 
Anonymous
> It's good practice to never duplicate the same code in multiple locations
 
Anonymous
wrong.
 
@Ocramius Yeah, I know, sorry.
 
Although I like your way of putting it too
 
@mega6382 is ok, I don't wanna look back at my 2011 code anyway
 
12:13 PM
The concept that beginners don't usually understand right off the bat is what "knowledge" means
 
@Wes Tried it, didn't work, ITS A SCAM! My mirror broke -.-
 
Wes
:B
 
@Wes Anyway, please share with me the url to the article, once you are done. <3
 
Wes
it's going to take quite a while
 
What like, a week or a month?
 
12:21 PM
@mega6382 6-8 weeks
 
Since when does 0 validate as null in PHP?
 
It doesn't
 
since ==, i guess?
 
It all "validates" as falsy
 
But I don't think so.
 
12:25 PM
in array_search, strict turned off, searching for NULL value results into 0 being stripped off
 
That's why you use strict
@MikeM. for your "amusement" php.net/manual/en/types.comparisons.php
 
@PeeHaa Thank you, might had to look at that page instead.
haha
 
Do yourself a favor and always (where possible) use strict comparisons (and strict types for that matter)
 
@PeeHaa I most likely do but I was just messing around with the array_search trying a few things.
And then noticed unsetting a index returned from array search with needle: NULL also returns a 0; so just tried to figure it out, without I've looked at the amusement page
 
The problem with php is that it is a shitty language
4
dealwithit.mp4
 
12:32 PM
LoL...
#NotMyWords...
 
The problem with php is that it is a shitty language
 
Anonymous
#represent
 
@PeeHaa and mistresses.
 
:D
 
12:35 PM
I actually like PHP alot, only that last sentence was a lie and why the fuck would anyone want to use it?
<3
 
A fix for their fix
 
Anonymous
a bad few years for drupal
 
@MadaraUchiha Yes and JS is so good. And JS programmers are very good too. Just look at the question part of this stackoverflow.com/questions/18412129/…
//sarcasm
 
@mega6382 JS has come a long way, and has an even longer way to go imho, but this is totally Microsoft's fault (there's a package, by Microsoft, called npm-windows-upgrade)
 
The real answer to that question would be to use bash for windows
 
12:40 PM
All tooling on Windows save for Visual Studio related shite is utter crap
That includes most things PHP as well
Also Git, npm, Java, etc
 
especially ruby though
 
Anonymous
the real answer would be to use a sane OS
 
Is there any saner OS for desktops as windows?
 
Although Ruby is a plague by itself, it is especially bad on windows.
 
12:43 PM
@mega6382 That's one of the reasons I started the mailgrab project
 
Anonymous
@PeeHaa use a laptop you god damn animal.
 
@PeeHaa All software is finicky and insane
 
@JayIsTooCommon I am on a laptop :P
 
And there are things that Windows does much better than Linux or macOS
(For example, async I/O)
 
Does it?
 
12:44 PM
But tooling wise and DX wise? Nope, nope, nope, not doing that.
@PeeHaa It does, in linux it's basically an event loop
As opposed to actual OS threads
 
@MadaraUchiha what do you mean by dx?
 
@mega6382 Developer Experience
The dev equivalent to UX
I didn't make that up
 
oh, yeah. You are right about hat though.
That is why I usually have a ubuntu vm running.
 
@JayIsTooCommon Ew
 
Anonymous
how else are you going to code in Starbucks?
 
12:47 PM
@mega6382 I don't have a very good experience with developing in a VM
 
@JayIsTooCommon like this i.pinimg.com/originals/a3/4a/55/…
 
order drinks in the name of all the symbols and keep all the empty cups
 
I'd rather have Ubuntu as the host, and a Windows VM if I need to run IE or whatever.
 
Anonymous
^
 
Why would you need to run IE??????!@!!!!
 
12:48 PM
5 hours ago, by DaveRandom
your opinion is wrong!!!!11one
I already told you
 
@mega6382 Because I work for a living
You know, provide services in exchange for currency?
 
Anonymous
@mega6382 when you work, you'll understand C:
 
[citation needed]
 
@Ocramius this question might be related to some weird shit happening for my project - but what's the correct way to reset doctrine between unit tests, to make sure that entities created in one test, aren't cached or otherwise affecting other tests?
 
Public service announcement - Google DNS (8.8.8.8 - 8.8.4.4) is currently having issues resolving to AWS Route 53. Don’t be surprised if you use Google DNS on your router and have trouble accessing some popular sites. #Route53 #DNS #GoogleDNS
 
12:49 PM
@MadaraUchiha sounds kinky
 
10 points to whomever gets that reference :P
 
@Danack I spin up a full EntityManager per-test
 
Anonymous
yo tony o/
 
but otherwise a simple EntityManager#clear() works
 
ty.
 
12:49 PM
@JayIsTooCommon I do work, but I am on the backend. So, I don't give a shit about IE support. //cc @MadaraUchiha
 
@mega6382 Must be nice
I'm seriously thinking of aiming strictly at backend for my next job
2
 
nngggggrrrrmmm
 
Anonymous
heh, backend.
 
stahp
 
@DaveRandom HAMMERTIME!
 
12:51 PM
god damn it
 
So that nosy clients and project managers can't tell me "could you move this 2px up?" or "Why does this thing I haven't told you to do isn't happening?"
 
@DaveRandom What is up with you?
are you ok?
 
we don't have time for that
 
Anonymous
lol
 
@MadaraUchiha Yeah, I remember, when I used to work on the frontend, that happened a lot. And now I hate CSS and html with passion.
 
Anonymous
12:53 PM
@DaveRandom don't you ever stahp at me mr.
 
@mega6382 I love CSS and HTML, and JavaScript
You can do some pretty amazing things with it
I just hate being the technician
 
you can also ignore it ...
 
@JayIsTooCommon whatever, I do what I want
 
@MadaraUchiha I like JavaScript too, but the cross browser shit, that comes with HTML and CSS is just so ridiculous.
 
12:54 PM
@mega6382 When was the last time you seriously tried FE?
Those things are mostly a thing of the past.
 
can't unhear cartman
 
Anonymous
^^
 
@MadaraUchiha srsly
 
Anonymous
hahahaha
 
@DaveRandom Unless you account for IE10 and lower, or Safari 9 and lower, everything's pretty consistent and nice
 
Anonymous
12:55 PM
nah, he ain't talking about browsers
 
:D
 
We use async/await in production with TypeScript and it's working perfectly.
 
@MadaraUchiha Sure, now it's a huge node_modules directory, about 13 compilers, transpires and pilespilers, 512MB of compiled JavaScript, all to show a welcome page
 
Plus transpilers tbh. Nobody writes vanilla JS anymore...
 
Sure, a build step is now more required than before
 
12:56 PM
@MadaraUchiha Like a couple of years back. I do make a little tweaks now and then, but nothing full fledge for a long time.
 
@MadaraUchiha This instantly reminded me of the red light district... "Provide services in exchange for currency"
 
But most serious projects had a build step regardless
After all, you still had to do bundling and minifying
And the tools today are much MUCH more mature, well documented, and nicer to use then what we used to have
thinks back to the RequireJS bundler and shivers
 
Anonymous
you suck @MadaraUchiha
 
:D
Should have waited until it was scrolled up more
 
:P
 
1:04 PM
I just deleted 942 lines of commented out, never used code...
 
@Ocramius You kinda don't need a transpiler for node
But then again, that's not FE
 
@MadaraUchiha until node runs TS natively, yes you do :P
why would I write ES6 when I can use a language with proper types?
 
@Ocramius Says the guy who uses PHP daily?
As for why: Because sometimes it's not worth the added complexity of setting TypeScript up, although admittedly, it's relatively small.
 
@MadaraUchiha true, but to my defense I'm paid quite well for that (that's my only defense tho)
 
@Ocramius How well does it cover the psychiatrist costs?
 
1:07 PM
@MadaraUchiha It's on the house ^^
 
@MadaraUchiha that's paid by the insurance. Insurance is ~370 EUR/month
 
The two things I'm mostly missing from PHP by this point is real functions as first class objects, and replacing all of the quasi-types (callable, iterable, array, etc) with actual interfaces
 
GADTs
 
Generics and stuff are nice to haves for sure, but they aren't as crucial to me as those
 
or even just ADTs
 
1:10 PM
!!urban gadt
 
whatchoo talkin bout willis
 
@Ocramius wuzzat?
 
In computer programming, especially functional programming and type theory, an algebraic data type is a kind of composite type, i.e., a type formed by combining other types. Two common classes of algebraic types are product types (i.e., tuples and records) and sum types, also called tagged or disjoint unions or variant types. The values of a product type typically contain several values, called fields. All values of that type have the same combination of field types. The set of all possible values of a product type is the set-theoretic product, i.e., the Cartesian product, of the sets of all possible...
 
Wes
algebraic types
didn't you vote against unions @Ocramius
no, nvm
 
1:13 PM
@Ocramius So... nominal types as opposed to structural types?
 
An ADT is sort-of a union type, yes, but you can't type against the union in the signature, you type against the ADT
@MadaraUchiha not sure what that definition is, but I suppose so, yes
 
A type that's only defined as a type, and doesn't necessarily represents a class or an interface
Similar to how TypeScript works
 
Ah, yes, yes indeed.
 
Yeah, I like that approach
But I think that's a bit further away from PHP's... mindset.
The reason it's like that with TypeScript is because the typesystem is designed to be completely decoupled from the runtime
So types are a concept exclusive to TypeScript that does not exist (at least, not in the way it does in TypeScript) in the JavaScript runtime
With PHP where you have control over both the parser and the runtime, I suspect you don't need this concept as much
brb
 
1:30 PM
I really don't want runtime types tbh
I'm indeed using the wrong language, that's probably just the full story
 
Spent the entire day looking into a bug. The problem was a space in the email address, that was stored in the DB.
 
It's a blessing and a curse
 
Any idea are welcomed :)

https://github.com/rectorphp/rector/issues/424
 
@GabrielCaruso interesting project
 
Wes
@Ocramius i always wondered what's the overhead of checking the type at runtime
especially considering that func call overhead is so important in php
 
1:38 PM
@Wes checking the types is not really the problem. The fact is that types can be squashed into 0-overhead data structures if they are handled at compile time
A lot of constant prropagation can also be applied when things are type-jailed
 
Wes
that does happen already i think
especially with opcache
 
3 messages moved to Trash
 
1:52 PM
@Wes Yo mama's so fat she would have passed Pluto's planet assessment
 
hahaha
 
wow. insulting an italian mama? you must have a death wish.
 
Wes
:B
 
1:55 PM
@Gordon Thanks :)
 
Wes
 
:D BeanFactory.
 
Wes
mmm beans
 
No more coffee for you.
 
1:57 PM
Looks like they messed some threading up in there or something?
While in destruction... something else is happening
 
But why didn't it crash the app, though?
 
Error handler at the end logged it to the wrong place
 
@Gordon BossWorkManagerUtils was real. I give up.
 
2:12 PM
@PaulCrovella it's @Jimbo's new job title
 
@Wes Their website makes me feel light headed if I scroll down....
 
@JoeWatkins one more question about removing resources - if I'm gonna provide in additional struct the zend_object and *void pointer whis should be a global solution right? I mean should it be a struct defined per extension like in autoload or should it be a struct somwhere in zend_types.h with some helper macrcos which will be used in extensions?
I dunno which is more optimal, providing a struct with specified pointer or generic one with *void pointer.
 
2:39 PM
I've been working diligently to create my own RBAC system- I cannot express how happy I was to get this result on the screen a moment ago. i.imgur.com/0h8E9Bn.png
 
@DaveRandom do you happen to know how to find out in which mode apachectl operates, e.g. sysv init mode or passthrough?
 
no, nor am I entirely sure what that even means :-P
 
@DaveRandom When acting in SysV init mode, apachectl takes simple, one-word commands. When in passthrough mode, it's just a wrapper around httpd
And trying to pass arguments to apachectl when its in sysv init mode will produce warnings
 
are they different binaries/scripts?
 
no
 
2:45 PM
what determines what "mode" it's in then?
 
@DaveRandom that's what I am asking :D
 
:-P
tbh this is outside my wheelhouse by virtue of being apache
I don't really touch apache any more
so I've forgotten most of the stuff I knew about how to administer it
 
fair enough
 
it's not an unpleasant sensation
 
tell me about it… I wrote a parser for httpd configs :)
 
2:50 PM
wouldn't it be simpler to just employ someone to read them?
 
totally. doesn't work with on-prem installations though
we'd have to ship an intern for each on-prem customer
 
3:05 PM
hmpf
> The apachectl script can operate in two modes. First, it can act as a simple front-end to the httpd command that simply sets any necessary environment variables and then invokes httpd , passing through any command line arguments. Second, apachectl can act as a SysV init script, taking simple one-word arguments like start, stop, …
but it doesnt say how to set the modes
 
@Gordon apachectl seems to be a simple bash script, so you can probably figure it out by reading it. I think what they mean is that it will use whatever mode needed for that specific command. so start acts as sysv while configtest uses the wrapped httpd?
 
@Gordon I am not sure, but I believe it runs in both modes at the same time.
 
@pmmaga that would imply I can pass either single commands or multiple args and it should just work, right? But what I am seeing is that it complains when I try to pass multiple args
 
@Gordon what command are you trying? mind sharing, so I can try too and make sure?
 
3:16 PM
@Gordon whatever you are doing, would it not be simpler to just bypass it and invoke httpd directly?
 
Wes
im dead
 
@Wes finally a good reason to believe!
 
> in general, httpd should not be invoked directly, but rather should be invoked via apachectl
 
@DaveRandom that's the fallback I am currently implementing. But then you have to make sure to set all the env vars apachectl might set properly
 
Anonymous
@Wes omnipotent
 
3:18 PM
> in general, httpd should not be invoked directly, but rather you should just install nginx instead
7
 
:P
 
:P
 
@mega6382 apachectl -M -DFOREGROUND or apachectl -V
it will reply with Passing arguments to httpd via apachectl is no longer supported
but only when its in sysv init mode
 
Both these worked just fine for me.
 
@Tiffany yes, just google for the area you're interested in. any competent one should turn up in the search results. Also ask people. Even if you're not going to go to any meetups, people who organise them will probably know of some competent ones.
 
3:20 PM
@mega6382 because it's in passthrough mode :)
 
Also, apachectl start works fine too.
 
weird.
 
The only thing to watch out for with recruitment agents is that while most of them are good, a number of them will try to pressure you to take the first job that is even remotely appropriate. You should make plain to them that you're only going to take a job, even if one is offered, if it provides better long term prospects than your current place.
 
@Danack alright, thanks. Also going to try applying at @Dereleased's old employer since they have a couple of jobs that fit my skill set. Just need to spend some time tonight cleaning my resume, and doing all of that other crap. x_x
I hate looking for jobs
 
@Gordon I write "apachectl configtest" and I get "Syntax OK". So, there must be something wrong with your installation. Or you have older version probably.
Btw this is my version "Server version: Apache/2.2.34 (Unix)"
 
Wes
3:23 PM
i think i got this inheritance thing wrong
 
@Danack noted.
@Wes new opinion on traits?
 
Wes
no, phpdoc inheritance
 
@mega6382 it's a recent 2.4
apparently the apachectl has this:
if [ "x$2" != "x" ] ; then
    echo Passing arguments to httpd using apachectl is no longer supported.
    echo You can only start/stop/restart httpd using this script.
    echo If you want to pass extra arguments to httpd, edit the
    echo /etc/sysconfig/httpd config file.
fi
hmm, could be red hat specific
 
@Gordon There is no such code in mine. I can share mine with you, if you want?
 
3:28 PM
@Gordon hmmm.. perhaps. in the source it looks like those would actually pass-through svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/support/…
(assuming I'm looking at the right branch :P)
 
@Tiffany Sorry to say this, but cats are stupid. :P <3
 
I'm blaming Peehaa again
 
for what?
 
!!noworky
 
3:32 PM
true story
 
@mega6382 depends on the cat. One of my cats is kind of dumb, but he's a lovable oaf, almost non-stop purring. My other cat, she can be too smart for her own good, but she's only friendly to me. Though, of course, cats have smooth brains, so their capacity for intelligence is limited.
 
Anonymous
Jun 14 '17 at 10:33, by JayIsTooCommon
May 19 at 10:55, by JayIsTooCommon
Just get a dog already.
 
Did you know crows are one of the smarter animals? They are known to have intelligence close to a seven year old child.
@JayIsTooCommon dogs are stinky, and I have to walk them and pick up their poop.
 
@Tiffany They're reasonably crease-ey: en.wikipedia.org/wiki/Cat_intelligence#/media/…
 
Anonymous
blocked.
 
3:43 PM
@Tiffany I've seen an impressive documentary on that
 
@Gordon I watched some video about a crow "giving gifts" to a human it liked youtube.com/watch?v=HWXe7Js6GnI
basically random baubles it stole
@JayIsTooCommon <3
 
3:58 PM
@Gordon that explains your version. :) why are they doing that though? sounds slightly weird to completely cut it off like that.
 
@pmmaga unfortunately there is no history that would explain it
but anyways… I have implemented a workaround that's good enough
thanks everyone for figuring out
 
4:12 PM
crash on any little error when opcache enabled,build with Intel C Compiler – #76260
 
Wes
@kelunik i'm not sure of what i'm doing anymore. if i have a summary in
A::foo() and B::foo()
class C extends A implements B{ /* no override of summary */ }
what summary should it show for foo() here?
i was showing them both but perhaps i should show the one in the interface
 
@Wes I'd say A.
 
Wes
summary = phpdoc summary
 
Oh wait, does A implement B too?
 
Wes
it's irrelevant, because phpdoc is inherited
it could, or it could not implement B
i think i'm going to show them both and call it a day
 
4:23 PM
ok, my line of thought here would be that A overrides B.
 
@Wes One after the other? That will likely result in duplication. Maybe tabbed?
 
Wes
if summaries are identical then only one is shown
 
What's this for anyway, I'm curious now.
Anything with PHPDoc makes me curious. :)
 
Wes
just a phpdocumentor kind of thingy
 
You could also see how others did it. :)
 
Wes
4:27 PM
i'm not particularly happy with what others did, or i wouldn't be doing this :D
 
That explains that.
 
Wes
but tbh apigen is good enough
 
Wes
E_NEEDS_GENERICS @tereško
class Y implements A {
    public function check(B $param) {
        assert($param instanceof X);
        return $param->get();
    }
}
 
@Wes Generics won't help there.
 
4:34 PM
or go back to phpdoc typhint :(
 
@tereško You're accepting only a subset of the possible types in Y, which is why it fails.
 
Wes
:42251902 ?
interface A<BT> where BT : B {
    public function check(BT $param);
}

class Y implements A<X> {
    public function check(X $param) {
        return $param->get();
    }
}
 
@Wes Y still only accepts a subset of what A mandates
 
@Wes Y won't pass any A type declaration, because it still accepts less types than the interface specifies.
 
Wes
who said he wants to pass type declarations
also, interface A<in BT>
....... :B
 
4:52 PM
spidermanwat.gif
 
5:11 PM
Morning \o
Er afternoon
 
5:23 PM
evenin
 
@jeeves should I troll the fuck out of google support, at the risk of getting banninated?
 
cleverbot is off
!!should @Danack troll the fuck out of google support, at the risk of getting banninated or not
 
@‌Danack should troll the fuck out of google support, at the risk of getting banninated.
 
@Danack there you have it ^
 
5:42 PM
 
hahaha
 
oh, this one shows it more clearly - twitter.com/MrDanack/status/988835466182094848
 

« first day (2747 days earlier)      last day (2215 days later) »