« first day (2586 days earlier)      last day (2362 days later) » 

12:09 AM
mornins o/
 
12:42 AM
Hey guys - I know php and i'm working on learning more advanced topics.
Can anyone help me with a Guzzle / Etsy project?
I'm running into problems with Guzzle and oauth
and it's killing me
 
Wes
1:01 AM
@LeviMorrison \o
 
1:21 AM
@Wes \o
 
Wes
hey, i'm working on that thing again. when i started it i thought it would be like a couple months work lol. there are a million things to consider @LeviMorrison
for instance now i'm wondering on whether i should disallow $map->putall($map); since it forces me to write really crappy code
i have been already strict on this. for instance i explicitly disallow modifying the collections concurrently... like during iterations.
foreach($a as $b => $c){ $a->remove($b); } is not allowed
i have $a->map() and $a->filter() for that
similarly
 
@Wes How do you disallow this?
 
Wes
foreach($list as $c){
    $list->append($c);
}
also this is disallowed
@LeviMorrison are you familiar with "modCount" in java ?
 
I was against methods like addall, putalll, etc if you can remember that far back ^_^ I still am against it.
@Wes No. I am aware Java does a best-effort to disallow concurrent modifications but am not familiar with how it achieves it.
 
Wes
class MyIterator{
function __construct($map){
   $this->expectVersion = $map->version;
}
function current(){
    assert($this->expectVersion === $map->version);
    return ...;
}
class MyMap{
    function put(){
        $this->version++;
        // ....
    }
}
basically every mutator increments the version
 
1:33 AM
Ah, nice and simple.
 
Wes
indeed
i used to make it with observers and it was a complete mess. this is way way simpler
 
I mean, i'd be worried about the fact that $map->version can be modified by anyone :D
I know this is partly why you want to have granular permissions ^_^
 
Wes
it should be function getVersion(), in read-only
afaik that's pretty common in many languages
 
@Wes Designing collection like libraries is fine but having designed many at this point I think it's pointless to publish any more work until we have generics.
 
Wes
it's used for everything, like for caching
generics are something but there is so much more to do
it's literally taking me months to write just a few classes
i totally underestimated how hard this is
 
1:39 AM
It's hard, yeah.
Even languages with many talented authors like Swift have undergone major core-library changes in every version.
 
Wes
regarding setAll, putAll etc. i agreed with you until i realized these methods are not trivial. if it was just foreach(...) $a->add() then i wouldn't have them. but again there is not just that
 
2:13 AM
@Wes You can "optimize" it a little bit but beyond that, yes, they are just adding in a loop.
 
Wes
well not just that, there are many other things. for example "add all" in the multiset type must make sure that the sum of all elements does not exceed PHP_INT_MAX. also setall could do preallocation for array based data structures, e.g.
function addAll($items){ if($items instanceof Collection){ $this->ensureCapacity($items->count); } /* ... */ }
 
@Wes Those are just optimizations, as I said before.
 
Wes
foreach($list as $c){
$list->append($c);
}
this is disallowed, so not just an optimization having $list->concat($list)
 
How come sudo doesn't honor root's .bashrc? Super annoying. Anyone know any workarounds?
 
2:35 AM
@Wes You wrote code to specifically concatenate a list with itself?
 
Wes
you mean if i ever needed that?
probably... maybe strings
 
I'm saying $list->concat($list) has code specifically designed to permit concatenating an object with itself?
 
Wes
not yet, but i might do that
 
By the way, in many languages appends do not invalidate iterators. Thus, no issue.
 
Wes
right now it just errors. concurrentaccesserror
that it's not always possible... must work polymorphically. so i could actually special case it
 
2:41 AM
I really want to implement generics in PHP. I really, really shouldn't. If I'm honest with myself I do not have the time for it.
 
 
1 hour later…
3:57 AM
Hmm. I added an implements list to traits and it breaks tests, but I'm not sure why. Somehow that AST being present, even if empty, breaks stuff. Definitely should not happen.
For some reason the trait doesn't get registered...
> Fatal error: Trait 'T2' not found
 
Wes
4:13 AM
i gave up with traits :B
 
Someone on Reddit had what I think is a good idea: start by adding generics to traits, and only traits.
 
Wes
meh.
 
5:16 AM
moin
 
Wes
\o
 
morning
 
@JoeWatkins I'm trying to implement generic traits at the moment. So far so good. There's a part I haven't gotten to yet that I'd like to pick your brain about. Let's say I have a trait:
trait Foo<T> {
    function get(): T {}
}
Since traits don't use the interface list I've stored the generic type parameters in the interface slots.
When I get to apply the generic type parameters at runtime:
class Bar {
    use Foo<int>;
}
 
5:33 AM
oooh
 
I'm not exactly sure how I ought to go about applying the type parameter.
It seems that perhaps during compilation I ought to store pointers to usages or something so I don't have traverse over any code.
 
you won't have to traverse code
 
trait Foo<T> {
    function get(): T {
        return new T();
    }
}
 
let me find code
 
How else would I replace T in new T()?
I've got the AST and grammar worked out for declaration but not for use Foo<int> so I'll work on that while I wait for your feedback.
 
5:38 AM
presumably we can have a rule in the compiler that the return from a template function must be constant ?
so then you just modify the constant when implementing the function in the target class (you copy opcodes/zend_function at that point)
 
Hmm... I don't think that would be sufficient.
Although for a proof-of-concept I can probably just replace the signature.
Probably plenty of details to work out there for now.
 
well it's the same thing you'll be doing to arginfo
 
I may have misunderstood your earlier comment.
I thought you meant the return statements must be constant expressions.
 
actually that idea sucks ... would only work for that specific case ...
 
The plan is to basically make a copy of the method entry and replace the type names in the copy.
 
5:42 AM
yeah, at some point you are copying the entry anyway to implement the trait
 
That doesn't do anything for replacing the new T() part though.
 
let me think about this ...
 
I'm off to bed soon; I'll share a branch with you so you can see what I've done so far.
 
I like though, that's the first useful trait I've ever seen ...
@LeviMorrison I will definitely make time to look at that
 
And remember this is exploratory/experimental stuff so it's not necessarily done The Right Way.
 
5:43 AM
I've never done anything the right way in my my life
have you come up with a name for this ?
imo don't call it "generics", if you call it that, you will be met with a chorus of "let's have all of generics or none of it" ... I think it stands on it's own, I like "templates" ....
 
Hi guys
Does anybody here who knows about SAML?
 
@JoeWatkins Not sure. It's definitely more akin to templates than generics.
Alright, off to bed. Looking forward to your ideas!
 
PHAR install error – #75520
 
6:09 AM
posted on November 14, 2017

New Cyanide and Happiness Comic

 
6:58 AM
o/
 
\o
@FlorianMargaine congrats!
 
o/
 
7:14 AM
\o
 
7:26 AM
its always a party in here...
 
Paste #899456
I sql query why between is not working
I have give those code snippet here
Please help me
 
@RAJMOHAN use prepared statements.
 
Ok man just a sec
 
thats alot
 
7:49 AM
@FlorianMargaine congratz :)
morning
 
Wes
\o
 
o/
 
i have come to the realization that all anyone does in this chat is congratulates @FlorianMargaine
 
that's a rather quick observation
 
and it's not true. we also talk about whisky, do wave runs and admire rdlowrey
 
7:55 AM
we shall form a cult... the cult of FlorianMargaine... "may congratulations be upon you".
 
don't be silly
 
/me needs to implement a message queue
and no coffee in office :-(
 
just use an existing one
 
really does
Your office is lame
My office have a starbucks machine... i am positive i could trade it for a car.
oh and its free
 
Where do you work
I am applying as code fixer like you
 
8:01 AM
@MoonEater916 does it have coffee flavored coffee?
 
Who drinks coffee flavored coffee. Isnt coffee supposed to taste like orange juice
 
the things an engineering marvel with advances displays using tap water....
 
morning o/
 
@Akshay you sinner... you didn't not praise @FlorianMargaine
 
8:04 AM
our two wmf coffee machines in the office run on windows, tap water and milk coolers
 
lol...
keep editing..
ull get it
XD
 
:)
 
we order the beans from tchibo but it still didn't arrive :-(
 
wait...
does $dateTwelveHoursAgo = strtotime("-12 hours"); actually work?
 
no I think its like this
You first have to get the current time in a variable
$dateTwelveHoursAgo = strtotime($time . ' -12 hours');
think it is something like that
 
8:16 AM
@MoonEater916 yes, it does eval.in/899478
@Tomm no, you dont
learn your relative formats
 
I said I think
I tried helping him
didnt know he did not test his code already
 
unserialize() >3x slower – #75521
 
8:37 AM
@Ekin Ah right, coffee beans. I thought you meant like vegetable beans.
 
@Ekin You actually buy, roast and blend yourself?
@Patrick /declares interest
 
@IROEGBU unlikely given they buy them from tchibo
 
@IROEGBU we get roasted whole beans, usually the brazil mild or guatemala grande
/me is back to checking beanstalkd and rabbitmq
 
I use M&B... makes my boss sleep and gets my colleague high
 
@Ekin it's not actually beans and rabbits.
 
8:50 AM
awake and aware :p
 
@Levi regarding your thoughts on generics, we may, internally, wrap our callable into a Closure wrapper having the expected types. Thus, passing a callable to function(callable(float): string $cb) will do the usual variance checks if applicable, and then effectively set $cb = function (float $arg1, ...$argn): string use ($cb) { return $cb($arg1, ...$argn); } in order to guarantee that values we pass in will be of the correct type (e.g. casting from int to float is done), and also return type
Obviously we also may go further and determine the return type of the actual callable, given the restricted set of input types (according to the functions callable() argument parameters) and compare it with the expected return type for superb compile time type inferring … (may be interesting for cases where there's only one possible value for the parameter)
 
that's so typical of @bwoebi… we are discussing coffee and he waltzes in without saying mrningin to anyone and then changes the topic to actual php development
 
Psht what is this some sort of PHP room? -_-
 
Wes
2 days ago, by SaitamaSama
21 hours ago, by Wes
Oct 25 at 14:18, by Wes
Oct 20 at 9:16, by Animesh Sahu
Bye all this isn't a php chat
 
Dec 16 '13 at 19:08, by nathanjosiah
This chat room is a waste of time.
 
Wes
9:02 AM
Aug 1 at 5:57, by Sagar Naliyapara
@ChiragDaxini everyone here are just egoistic, have knowledge but not for sharing and those are active in this room are just doing their personal team stuff in this group
 
hello
 
mornin
 
@JavaFan is it me you are looking for?
 
Hello for all
 
9:05 AM
@IROEGBU noted. should be ready in a few days
 
> I'm self-taught and it took me a long time to learn how to write good code. I learned from many different resources, mostly from non-PHP books. I am writing this book so that you don't have to go through the same trouble as me.
 
@Patrick Should jump on the badnwagon, call it PHP 8
 
that should totally read "I learned everything from room 11 and my book is just a collection of all the code snippets I found there"
10
 
@kelunik what are the things possible on kelunik.com everything I typed either doesn't exist or is suspended
 
Don't forget to sneak Friday link in there :P
 
9:07 AM
Or burn it on a CD and attach to book... Like those old books
 
@Gordon not too far off actually :D
 
we know and are looking forward to our royalties
 
@Gordon That's not a topic change, just a quick intermission
 
@Patrick You currently editing an end or beginning chapter?
 
@Fabor the last 3. just got done with the intro
I guess I could send it out to you guys already
and then deliver the rest in a few days
 
9:09 AM
@Gordon Or just: how to write (too) clever code
 
1st page: just kidding, just use laravel
 
@Patrick Don't say "use laravel" in this room! People hate it in here ...
 
Who says we hate it... We use laravel dilute our cake
 
@Patrick I was thinking the same :P
Send away ✈
 
9:14 AM
@Fabor will do so after work. @IROEGBU @wes can you send me your email addresses (to firstname@lastname.ch)?
 
/me goes and registers lastname.ch
 
Wes
i think i've sent it already... literally to lastname.ch ahah i was probably drunk
 
:D
 
Wes
was that correct
 
9:16 AM
didn't see it
yes
 
Wes
okay
 
morninrnings o/
 
Hey guys what are some good methods of securing my sessions?
 
Anonymous
moiutigjk
 
Wes
9:33 AM
@Patrick sent the mail. starts with netmo, i have a scary skull as avatar :B
 
@Wes, The edge lord
 
Anonymous
!!wotd
 
pneumatic of or relating to air, gases, or wind.
 
Example: @PeeHaa's bum was very pneumatic today
 
moin
 
9:40 AM
I thought pneumatic meant hollow, as in pneumatic bones of birds
 
@IROEGBU shouldn't you use "to dilute" in this case?
 
@Shafizadeh Yes... I should add "to"
But, technically I don't want to dilute cake, I want to wash it down
 
@Patrick Can we have a shoutout to @PeeHaa's mom in there?
And @Lusitanian's mom - he's not getting away with it either
 
@Wes got it
 
@Jimbo Where has he been? Haven't seen him around for a while.
 
9:48 AM
@IROEGBU he has a gf now… we are not good enough for him anymore
 
@IROEGBU Hit douple tab.
 
/me tries rebecca first
and it doesn't work
 
morning
Jimbo still pops in from time to time
 
I'm here every day ;)
 
AHH
I mean hi
 
9:55 AM
It's @Lusitanian I was asking about
 
@pmmaga bugs.php.net/bug.php?id=63380
 
@Sean You can edit/remove your comment when there is a typo ...
 
@Shafizadeh Yeah I know, it was more for effect.
 
Can you please rephrase "it was more for effect" ?
 
!!dad
 
10:07 AM
I knew I shouldn’t have had the seafood I’m feeling a little eel
 
@Shafizadeh "to make it more dramatic"
 
PPAP was pretty big over here. Did it reach you guys?
 
I heard it from Gordon here iirc
 
that's exactly what I want people to realize when I am long gone…
 
@IROEGBU That one is indeed broken, but the cool thing is that the stack trace links actually work.
 
10:16 AM
Response for a valid JSON string but missing a required param? 422?
 
400 bad request
 
What would a 422 example be then?
 
I guess 422 would work, too
 
I'd settle for 400 and a better response than a bland "Dun goofed" tbf
 
192
Q: 400 vs 422 response to POST of data

David SI'm trying to figure out what the correct status code to return on different scenarios with a "rest-like" API that I'm working on. Let's say I have a ending point that allows POST'ing purchases in JSON format. It looks like this: { "account_number": 45645511 "upc": "00490000486" "p...

I'd argue that 422 is specific to WebDAV and hence not applicable outside that scope
 
10:26 AM
@IROEGBU ah ok thx
 
Yeah, for now I doubt it matters too much. Not going to split hairs over it. Not in my control anyway.
 
@IROEGBU "fixed", shows the wrong hours and minutes now. :P
13 installs left for amphp/amp to reach 100k. \o/
4
 
I wonder who the biggest people using it are.
 
Jeeves?
 
@IROEGBU By far not.
 
13 installs left for amphp/amp to reach 100k. \o/
 
Fixing bugs on live (job sweet job)
 
Anonymous
!!wotd
 
pneumatic of or relating to air, gases, or wind.
 
Anonymous
@kelunik How many of that is between you and bwoebi ? :p
 
10:39 AM
I don't have many installs. :P
 
@AlmaDo Always where a fireman hat when fixing bugs on live
 
6
5
 
Anonymous
4
 
Anonymous
3
 
no, still 5
 
Anonymous
10:47 AM
what are we counting?
 
2
 
Anonymous
oh, installs
 
installs left :P
1
\o/
 
Anonymous
 
@Ekin Fucked it up and deleted the tweet. :P
 
10:52 AM
Snekins
 
oh :P how did I do that
 
@JayIsTooCommon Just wrote a script 15 minutes ago. :P
(function() {
    'use strict';

    var installs = parseInt(document.querySelector('.package-installs dd:first-of-type').textContent.replace(" ", ""));

    console.log("Current installs: " + installs);

    if (installs < 100000) {
        window.setTimeout(function () {
            window.location = window.location;
        }, 10000);
    }
})();
 
Doesn't use AMP 0/10
We reached it yet?
 
We have just reached 100.000 installs of amphp/amp, maybe we can reach 1.000 stars on @github on the same day? \o/
4
 
10:54 AM
dat dot though
 
heh
 
Seems like Twitter lost the attached image now. :-(
 
3 stars to go
 
2
 
10:56 AM
lol
 
1 :P
 
3 messages moved to Trash
 
Pretty easy to work out your star/install ratio soon.
 
Wes
@kelunik i was the 1000th star!
(sorry for not starring before :P)
 
@Wes Seen it, but you should really have starred it before. :P
 
11:02 AM
!!rfcs
 
Anonymous
I starred it too
 
Anonymous
with my alt account
 
Wes
:D
 
11:05 AM
Now I don't see the exact star count anymore on the dashboard. :-(
 
Anonymous
I'm ashamed to call myself a php dev, as I don't understand any of the libraries in github.com/amphp and what they do
 
I think part of the point was so you don't have to. The underlying stuff that is.
Go read @kelunik blogs.
 
The general jist of it is that kelunik managed to hunt down and kill wizards, uploading their consciousness into git repos. The repos are therefore made entirely of magic, and do amazing things.
 
@samayo it's not really php specific, so just be ashamed of calling yourself a dev
 
11:20 AM
oh nice gifs
 
@samayo no need to be ashamed… async is for hipsters only anyways
 
@Gordon what's "async" and what does "hipsters" mean?
 
Read the link @Wes posted for Async (Asynchronous)
!!urban hipster
 
[ hipster ] Hipsters are a subculture of men and women typically in their 20's and 30's that value independent thinking, counter-culture, progressive politics, an appreciation of art and indie-rock, creativity, intelligence, and witty banter. The greatest concentrations of hipsters can be found living in the Williamsburg, Wicker Park, and Mission District neighborhoods of major cosmopolitan centers such as New York, Chicago, and San Francisco respectively.…
 
@Shafizadeh it means callback hell and glitterbeards
 
11:24 AM
I see, thx
 
Anonymous
@Wes Yeah, I read that. I know what async is or how to use amp ... I just don't understand the core, how the whole thing works, ip, tcp ....
 
@samayo That's why they build it, so you don't have to :P
 
Does anyone have any naming suggestions for a namespace that holds app specific types, that isn't quite 'heavy' enough to be called a 'model'. For example I'm creating a type to hold key-value pairs for variables that need to be mailmerged into an email.
I'd prefer to not just dump them all into the root namespace of the project.....
 
@Gordon nop
 
@Danack Email\Variables?
 
Wes
11:26 AM
@Danack Tools, Misc :B
 
@Gordon and rubber boots and sparkle party? (kindof border line nsfw, and kind of weird).
 
Wes
Mauricio also
 
Email\PlaceHolders ?
 
Wes
nice manly name.
 
@Danack Do you really need an all-encompassing namespace? Wouldn't it be better if that would be closer to your email logic anyway? And all the others close to their usage?
 
11:27 AM
@Danack app\types\HashMap :P
 
Don't do drugs.
 
@FlorianMargaine email isn't a top level concept - it's abstracted more along the lines of messages that can get processed in various ways
/cc @pmmaga
So although in this case it happens the message is being sent via email - that's just an implementation detail.
(kindof)
 
@Danack value objects?
 
> Datatypes
 
but I would just put them in the same namespace where they are used
 
11:30 AM
installing winrar
 
7zip is free
Sweet. @Patrick's book arrived, I'll get this torrented for you guys.
 
/this kills the frog.
 
this xkcd plugin is broken
 
3 messages moved to Trash
 
> In the next / follow up blog post
But, @PeeHaa doesn't do follow ups -_-
 
11:42 AM
 
LOL!
 
ok, xkcd plugin… you are forgiven… it seems to be from somewhere else
 
they surprisingly make decent money
 
12:03 PM
@Fabor Please lemme know whenever it's done! :p
 
12:59 PM
eveeningts o/
 
Ugh, I think I've accidentally started suppressing undefined property messages in phpstorm
 
1:59 PM
@IROEGBU I am terrible sorry :(
Mornigs
 

« first day (2586 days earlier)      last day (2362 days later) »