« first day (1720 days earlier)      last day (3225 days later) » 

9:02 AM
@FlorianMargaine So was I, but the bed didn't help..
 
@ircmaxell awesome
 
@FlorianMargaine Yeah same here. Swimming inbed
 
function foo($a) {
    mysql_query("select bar from baz where qux = $a");
}
foo(mysql_real_escape_string('foobar'));
@ircmaxell does this work? ^
 
hi @ziGi
 
> Fatal error: Call to a member function getAttribute() on null
So... not quite :)
 
9:14 AM
@NikiC lol
 
And what does this tell us? That I'm using a super old php version on windows
@ircmaxell ^-- Global scope doesn't work yet
 
9:40 AM
Hey guys, question re: laravel password validation. My password field !== confirm_password field, even though they are literally the same thing when I typed them. Interestingly, xdebug shows password_confirmation as literal dots. Here's an image:
 
@EchoLogic lol
 
Also, just to show you that they evaluate differently: i.imgur.com/hoEjcqM.png
 
@EchoLogic look at what your browser sends
 
@FlorianMargaine I know, this is probably the simplest mistake error, just frustrating as it was working before, lol. Will check
@FlorianMargaine Well, browser is sending them through as I typed the,
okay... it's working now. What the hell went wrong?
ohhh. I get it. When I copied+pasted the pwd to save time, did it copy across the literal characters? ahaha.
 
10:09 AM
grrr ....
need eyes of C (internals) programmers ... not for a potion, I'm stuck ...
ping me if you have a minute ...
 
Nice!
 
Mornin!
 
@Trowski A sherif said, the problem with that is that to cast something to another class, you usually need to have private access to the 'thing'
 
How to use $this in preg_replace_callback?
 
10:15 AM
Also, having it the 'ClassNameOrScalar::__cast' way round means that the 'common' object needs to know about all of the objects that are castable to it. e.g. Say we have a class that represents JSON, and we have 100 domain objects that need to be castable to JSON, you wouldn't want to have
function JSON::__cast($instance) {

    if ($instance instanceof foo) {
        $instance->fooMethod();
    }
    else if ($instance instanceof bar) {
        $instance->barMethod();
    }
    // 100 more cases here...
}
 
@VeeeneX context please (a gist or pastebin)
 
@VeeeneX probably with the array syntax of callables [$this, 'methodName']
 
@Danack I mean in instanted class inside method
 
my guess is preg_replace_callback('regex', function($m) use ($this) {}, $input);
 
You can't use this like this ^
 
10:17 AM
oh really?
 
@HamZa you don't need to bind $this...if you're inside a class, and use $this inside an anonymous function, it will be bound automatically.
 
K TIL
 
you can use it, you just don't need to declare it.
 
mohaa
that's not really a backdoor ...
 
This doesn't seem to work $return = preg_replace_callback('/(\:\#(\S+))/', [$this, 'get'], $return);
 
10:20 AM
@Danack Nope, you can't: 3v4l.org/gvYt5
 
you don't need the use @kelunik
 
@JoeWatkins I know that, was just a response to @Danack that you cannot even use it if you try.
 
this works $return = preg_replace_callback('/(\:\#(\S+))/', [&$this, 'get'], $return);
 
@Danack I'm talking about use in form of use (...) of course...
 
10:25 AM
I didn't say that people should do that?
7 mins ago, by Danack
@HamZa you don't need to bind $this...if you're inside a class, and use $this inside an anonymous function, it will be bound automatically.
 
I just made the addition, that it's not even allowed.
Sorry for not being clear, that "nope" was wrong there. ^^
 
@JoeWatkins It isn't, but it's nice that the data survives either way
 
yep.....actually general rule of life, if you can change "no" or "but not" into "and also", your life will be filled with more positive waves man....
 
@Danack I'm not sure I like this... but I don't like js way either. I like python's way for this tbh.
I actually prefer CLOS way... but for other reasons
(namely, the specialization feature)
 
10:37 AM
@Danack c2.com/cgi/wiki?MultiMethods if you're interested
 
This page is just so full of wrong I want to delete it altogether php.net/security.hiding
 
@Sherif lolwtf
 
Why on earth would anyone put that under security I will never know.
 
Yeah just delete that one
 
@NikiC thx for the PR
 
10:48 AM
@Sherif wow. So ... why not delete it?
 
@FlorianMargaine That's the thing I don't like about lisp - it allows you to write what is terrible code, in a way that makes you feel clever while you're writing it. This does the same thing (I belive) and wouldn't be acceptable in any sane codebase - 3v4l.org/m47IK
 
@NikiC I honestly can't think of a single good reason so I figured I'd defer to my peers :)
Thanks for reassuring me I'm not insane.
 
@Ocramius Trying to reduce an issue with multiple typehints on a param
@Ocramius btw, you may want to stop using array_map for applying the checkers, because on PHP 5 it throws warnings (not sure exactly when this happens)
Which kinda sucks esp. if you let phpunit convert warnings to exceptions
In php 7 that's fixed, but well
 
@FlorianMargaine aside from global scope isasue, yes. In general at least.
 
11:16 AM
@NikiC yes, saw that
not sure if it's a good reason to not array_map, but I'll look into making error messages nicer for 2.x
 
@Ocramius Embeddables are awesomesauce, but how do I make them work with a Sf form type?
 
Please vote for this PhpStorm issue, lingering for almost three years already =/
 
11:46 AM
Hi room 11.
 
12:04 PM
Hey @echo
 
posted on July 02, 2015 by kbironneau

/* by p0k3 */

 
never seen this room so quiet...all at the beach? :P
 
@Simone it's so hot I want to stay in bed ~_~
@PeeHaa do you have an air conditioner or air cooler? I was thinking of buying an air cooler, all sold out ~_~
 
@HamZa Instead I'm in office without ac :(
 
12:14 PM
0
Q: Silex SecurityServiceProvider is storing AnonymousToken on HHVM when trying to authenticate

Silent EchoI'm using Silex framework on HHVM and running into some issues when trying to implement a SecurityServiceProvider for login. When trying to perform a login action (with a correct username & password), I'm redirected to the login page instead of the / page. This is because of the following access...

HHVM specific issues are the worst issues.
 
does anyone know how to use a Doctrine Embeddable within a Symfony FormType?
 
@Danack except it's not that magic
@Danack the multimethods are not specifically tied up with an object
they're just functions
and you can specialize them
so the specialized function will be called first, and it can call the less specialized one with (call-next-method)
 
@FlorianMargaine Check this out ;-)
 
@Ja͢ck woohoo!
@Ja͢ck awesome!
@Ja͢ck I have a couple of nitpicks though
 
=D
the name should be _every()
 
12:26 PM
@Ja͢ck using array_all instead of array_every like every other language sounds like yet another inconsistency
^^
@Ja͢ck also, you could probably use fastzpp
 
kay, what else?
hmm
not sure whether FastZPP is really worth it
 
@Ja͢ck I'd have 2 separate test files for array_every and array_some
 
> This branch is 3 commits ahead, 17748 commits behind php:master
Pfff
 
@Ja͢ck hm, I think it should be used by default, no?
 
Yeah, separate tests would be better
 
12:28 PM
I like how well refactored the code is, btw
 
@FlorianMargaine Not unless it's called in very tight loops
 
@Ja͢ck trying to merge that in?
 
@Amelia I'll refresh the branch and put it up for review.
 
@Ja͢ck why? is there a disadvantage in using fastzpp instead of zpp by default?
 
@FlorianMargaine There is, because everything has to be inlined.
So, internally there's a lot of bloat
Last commit was two years ago .. wow, has it been that long
 
12:31 PM
@Ja͢ck hmmm
what if the users use it in loops?
 
Perhaps if it were used very often.
In any case, if a few more devs feel that it should be Fast_ZPP, I'll consider :)
 
oh, I'm the least competent about this, I'm just not sure about how it should be used either
nor what is the criteria to define "it's used in tight loops"
since we don't know how it's used in userland, after all
 
Let me first see what's going to happen when I do a rebase lol
Rewinding 17k commits .. doo doo doo
 
from the RFC
> We don't propose to remove the existing API, and would suggest to use fast API only for most often used functions to get performance boost.
how objective...
 
most used, averaged per continent
 
12:39 PM
does that mean that new functions (that aren't used anywhere, by definition) should never have fastzpp? :-)
 
omg, it rebased without a conflict!
 
@Danack We never had that chat on how to get Auryn + Symfony working etc :-)
 
@Jimbo just point him to github.com/J7mbo/Aurex :P
 
@FlorianMargaine In this case, something to keep in mind is that the predicate gets called for every element (potentially) ... I think that's a lot more overhead ;-)
 
@Jimbo indeed we didn't - this might be easier via voice....what have you got so far, and also why do you want to do it?
 
12:41 PM
@Ja͢ck fair enough, I guess
 
oh okay, it rebased fine ... but it obviously won't compile lol
 
You probably need a buildconf
 
No no, look at that code, the array api has changed
 
Ah :-)
Right, you haven't updated master in 2 years...
 
probably a few other things too
indeed =D
 
12:44 PM
@Ja͢ck it also needs the proto comments btw
 
@FlorianMargaine Which currently isn't working because Auryn changed Provider -> Injector I think :P But Symfony 2 needs this now
 
@Jimbo oh :>
 
Yup, I'll dress her up a bit more hehe
 
@Danack I want to, basically, do what PHP-DI has done... which is a Symfony 2 Bridge. Reason, I think it's the best shot at a good framework out there and, with that in place, the poor practices can be massively reduced. So far, I've had a play around, and failed :-)
 
@HamZa I have an arko instead of an airco
"alle ramen kunnen open" :P
 
12:46 PM
It'd also increase exposure and is something we could say at our conf talks exists if you want to give it a try 'right now'
 
@FlorianMargaine Hmm, just realised that the predicate only gets the array value; I should probably change that to also passing the key ... perhaps the array itself as well.
 
@Ja͢ck right, php have keys...
 
or indices
 
@Ja͢ck in js, the callback signature is function(element, index /* so, key */, array)
 
yeah
 
12:51 PM
@Jimbo I'm just in the middle of fixing something that I want to show people - back in an hour.
 
Cool, no probs
 
1:03 PM
Wow @ that guy, @Danack
reddit at its best
 
I fucking hate it - they deliberate have no ignore button to encourage flame wars.
 
@Ocramius I'd really appreciate a hint about chat.stackoverflow.com/transcript/message/24224736#24224736
 
@Gordon no clue, tbh
I don't use Symfony, and I avoid Symfony forms especially
(I also avoid ZF Forms fwiw)
 
hmm, okay. then I need to throw out the Embeddables :(
 
Maybe try asking @cordoval ?
 
1:11 PM
@Ja͢ck some/every or any/all
 
on twitter?
 
Anyone know how in Linux I can give a single user (in this case Jenkins) permission to edit /etc/hosts in /etc/sudoers? I presumed: jenkins ALL=NOPASSWD: /etc/hosts. But nope. Ideas?
 
@Jimbo Just install windows...
 
@Gordon yes
 
@PeeHaa Get out.
 
1:13 PM
@Jimbo add user to group
 
@FlorianMargaine Don't want to add jenkins to sudoers then it can do anything, it has to be specifically that file and nothing else
 
@Jimbo /me kicks himself out
oh nope. Cannot kick myself
 
@Jimbo just run Jenkins on a disposable VM
I wish we did. Now we have this shitty jenkins setup where anytime it crashes I have to ask a sysop to fix it (within a week)
 
@Ocramius thanks
 
@Jimbo I was thinking of creating a new group with just this user, and chgrp new-group /etc/hosts
 
1:15 PM
@Ocramius That's the next step actually further down the line - VMs for devs via Vagrant / Docker etc. But not just yet, I need a solution for Jenkins and /etc/hosts that doesn't open too many security holes
 
Jenkins itself is a security hole
 
hello
 
@Ocramius s/security//
 
@FlorianMargaine still the best tool we have, btw
 
@FlorianMargaine Updated \o/
eek, what happen to indentation =(
 
1:17 PM
hahaha
was gonna paste this screenshot
 
damn!
 
use tabstop=8 to get the same view
 
@Ocramius d'oh. I was doing it wrong.
 
@FlorianMargaine Ah yes, much better ;-)
 
@Ja͢ck one test file per function and we should be good
 
1:24 PM
actually .. i forgot to commit that
 
done
now to add support for sending more arguments to the predicate function
 
of course, by doing so it will break my test cases because is_int() only supports one argument hee
 
@Ja͢ck also, why array() instead of []?
 
1:26 PM
mumble mumble two years ago mumble mumble
 
@Ja͢ck I wouldn't add this personally..
@Ja͢ck :D
 
Jenkins hates me because I am programming awesome stuff... CyclomaticComplexity my .....
 
why not?
 
@Ja͢ck dunno
 
doesn't it make sense that the array keys get sent at least?
 
1:26 PM
array keys, yes
oh you mean array keys as 2nd argument, and array as 3rd argument
 
i've had to fix that shit for array_filter() before ... and it's impossible to do so for array_map() .. sad, sad
 
array by reference tho?
 
by ref? yeah, i suppose
 
altering array during traversal is kind of bad, right?
 
1:28 PM
array_some($arr, function($v, $k, $arr) {});
array_some($arr, function($v, $k, &$arr) {});
will this have any difference?
@Ja͢ck right. But then, who cares about bad practices?
it could be used to replace the previous element, for example
which isn't that bad
 
@FlorianMargaine xkcd.com/292
 
@Ja͢ck hey, it's php :D
 
I think you can alter the array argument in JavaScript as well
 
never tried
 
what is the code of the current discussion?
 
1:32 PM
@chozilla This code
 
function array_any(array $a, callable $c = function ($v, $k) { return !empty($v); }) : bool
function array_all(array $a, callable $c = function ($v, $k) { return !empty($v); }) : bool
 
@DanLugg we're thinking about callable $c = function($v, $k, array $a) {} : bool
about every/some vs any/all... I don't really care
there's precedence in other languages, like every/some in js, any/all in ruby...
 
@FlorianMargaine I have a problem with the array being passed as third for some reason, I don't know entirely why though...
 
@DanLugg scared of references?
 
I'm definitely not scared of references /cc @LeviMorrison ;-)
 
1:43 PM
Does anyone know of a tool that will show the username for a comment on reddit for someone who has deleted their account?
 
@FlorianMargaine I just don't see the value in passing it though
array_any($a, function ($v, $k) use ($a) { ... })
 
moin
 
To be honest, I'm not sure why JavaScript does it
 
yup, trying to find a reasoning
cc @BenjaminGruenbaum ^
 
What?
Reason for what?
 
1:44 PM
Considering that, if you're passing a defined function it's probably not an expected argument, and if you're passing a closure you can just use it.
 
@FlorianMargaine does what?
 
@BenjaminGruenbaum why the callback of iterator functions in js are passed the array as 3rd argument
 
Because it's useful?
 
any use case?
 
And JS has optional arguments, you don't have to use it
Sure, deduplicate an array you just map'd, here:
myFn().filter(function(el, i, arr){ return arr.indexOf(el) === i);
 
1:47 PM
ah, thanks
so you don't have an actual closure to work with, hence its usefulness, @DanLugg
 
function myFn(){ return [1,2,3,4,5,1,2]; }

myFn().filter(function(el, i, arr){ return arr.indexOf(el) === i;});
Here, this actually runs.
 
Hi peeps
 
Well, back to Haskell, ttyl
 
@FlorianMargaine Gotcha. Fair enough.
 
@BenjaminGruenbaum ty
 
1:48 PM
Any time
 
However, considering that we aren't dereffing an array...
 
What is the best way when releasing new features for a Web App to present to the users what has been updated?
 
You can't really chain any or all off of a return value.
$array->any() // DEM THANGS WE NEEDZ
 
@Ocramius I'm reasonably certain this was posted by the same guy en.reddit.com/r/PHP/comments/351lqv/… who then went on to delete that account, so that he could troll people anonymously.
50 quadloons to whomever can recover that username for me...
 
@DanLugg array_some(myFn(), callable);
 
1:50 PM
lol, I need coffee.
Seriously, yesterday was Canada day, and like any good Canadian I got plastered.
 
@DanLugg I always mix plastered and flustered
 
Well, when you get plastered you can end up flustered.
I'll see you gentlemen when my brain is no longer full of fuck.
 
@DanLugg If I said that, I'd never see anyone again. :D
 
@Danack Di Doesn't need a 'container' though
 
1:57 PM
@Jimbo yeah...but the guy was being a dick.
which is what I was pointing out.
 
@NikiC When you have zval something; ZVAL_LONG(&something, 123); do you still need to do zval_ptr_dtor(&something); later?
 
@Danack BringTheTanks
I accept quadloons, bitcoins and beer, in reverse order of preference
 
We'll discuss the quadloon to beer exchange rate at southcoast? The currency exchanges are quite rapid at the moment what with greece.
 
Yes, that's the reason I no longer accept Tzatziki as payment
 
2:08 PM
greece lightning!
 
What's the capital of Greece? About €3. *ba-dum-tss*
 
The sign is after the figure
 
@Ja͢ck Really noisy and flamboyant but fundamentally powerless?
 
@DaveRandom That was your mum last night
 
oh dear
 
2:10 PM
Very well done, @Jimbo.
 
@Jimbo She likes you to think that but actually she's playing the long game. One day you'll wake up dead.
 
Oh, it was the long game alright
Ahhh, banter :'-)
 
"wake up dead"?
 
^ Surely he's referring to certain effects of rigor mortis?
 
makes me think of zombies tbh, but I'm not sure he was referring to that
 
2:12 PM
@FlorianMargaine yeah, you wake up and look at your dead body ... and you think by yourself, not sure whether that's me.
 
The whole point of it is that it's a joke because it doesn't make sense, I temporarily forgot who my audience was and I made a joke that does not stand up to scrutiny by logicians. I apologise profusely.
 
@Danack do you have a gtalk/irc/something?
 
recompiling
 
@Ocramius if you just go outside, and shout loud enough, @Danack will be able to pick up the vibrations with his beard ...
 
@Ocramius not really, we could pub later?
 
2:23 PM
That certainly explains the boom sticks
 
Sep 26 '14 at 10:46, by DaveRandom
Never post code in this room if you don't want it dissected :-P
this applies to not-code too :D
 
Anonymous
Is there a decent equiv of php.net/manual but for js?
 
...
tiny-fist
 
@FlorianMargaine did you mean noncode? ;-)
 
2:24 PM
@Danack ^^
 
Anonymous
@FlorianMargaine Thanks, you would recommend this?
 
@Jay no, I gave you the link but I don't recommend it
 
lol
 
indeed, not recommended, i would go with w3schools evil school1!
 
srsly, don't say shit like that
 
Anonymous
2:27 PM
@FlorianMargaine I knew I would get a shitty sarcy comment. For all I know you Googled js manual and sent me the first link, hence why I asked if this is what you would recommend.
 
@Jay MDN is the defacto standard JS documentation. These gentlemen are mocking you because that was, in fairness a pretty stupid question (people won't link you to shit unless they think you should read it)
 
@Jay fair enough :)
@Jay but yes, I do recommend MDN over other untrusty sources like w3schools
@DaveRandom well, theoritically (did I write that right?), webplatform is supposed to be the standard JS doc
 
@Jay Actually, we could have answered with phpjs.org as well :)
theoretically*
 
Anonymous
@DaveRandom I understand, I know sweet FA about js which I guess is why it was stupid. @FlorianMargaine Either way, thanks for link.
 
@FlorianMargaine "theoretically" and no, I cannot even begin to explain why that would be, we have plenty of words that end in "-etical(ly)" and I can't think of any others that conjugate like that
Also webplatform sucks
Also note that I said "defacto"
Also shut up
:-P
 
2:31 PM
Hammering a JS REPL is a pretty good form of documentation.
 
@DaveRandom that's what your mom said
@DanLugg I prefer python for the auto discovery, i.e. __doc__
 
a recruiter for a certain tech giant has ruined my inner peace ... I was quite happy, minding my own business, not wondering where my career might be going ...
 
@JoeWatkins That sounds like it might be a good thing?
 
@Ocramius Especially if you consider how not using array map there is less code, it seems like a good reason :)
 
I don't know, I was happy, now I have to consider things I wasn't thinking about
 
2:43 PM
@Ja͢ck nope. not if you only ever have that integer in there
 
what if it's passed to a user function and they use &$var?
it's this line in particular; i was thinking of making that statement conditional, but then i reckoned .. meh :)
 
3v4l.org/B4IbH ← Can those signatures please be changed to int instead of integer in the error message?
 
@kelunik I guess it's too late for such a BC break -- not sure though.
 
How is that BC break?
 
I wouldn't consider exception messages BC breaks.
 
2:51 PM
People parse error messages....
 
It was int in 5.6, so I see no reason why reverting to that is BC break
 
And when I say people, I really mean "people".
 
@kelunik you should, there was some big discussion about this at some point
 
@Ja͢ck Because scalar type hints didn't exist.
 
2:51 PM
I don't remember for which RFC
 
ah well .. that's fair, it treated it as int class .. hehe, funny
 
@FlorianMargaine Yes, I know that there was a discussion, I thought integer and double would have been replaced by int and float in all error messages.
 
however, the integer thing was only introduced in 7.0 ... so still no bc break if that were changed to int imho
 
dunno if alpha prevents further bc breaks for new features
 
Well, beta isn't released yet, there are stills BC breaks allowed.
Once beta is released, it's the final feature freeze IIRC.
 
2:55 PM
try it then :)
 
I have no knowledge about php-src. ^^
 
then go get some
 
@FlorianMargaine That's ... not a BC break
 
2 mins ago, by Florian Margaine
dunno if alpha prevents further bc breaks for new features
 
Alpha is open for BC breaks
 

« first day (1720 days earlier)      last day (3225 days later) »