« first day (1275 days earlier)      last day (3677 days later) » 

1:01 PM
@NikiC I wish I could rip that out off of it :) But this is old code that's being worked on, and it would be best to add pre/post commit hooks to scm or something.
 
@TOOTSKI Are they in Git somewhere?
 
But needs PEAR shit, I'm just going to rip it apart and version it. Not like it's going to be updated, ever.
 
@TOOTSKI I was going to say, just add:
  "repositories": [

        {
            "type": "vcs",
            "url": "https://github.com/clbustos/PHP_Beautifier"
        }
 }
 
Oh... damn. I figured something like that should exist :D
It's better I fork it anyways.
Thanks :)
 
But if it needs Pear shit, then you can manage that through Composer - It's a fucking bad idea to do so though. Just download it all and stick it in a dir in your project.
 
1:07 PM
YES!
I can't believe how good this works :)
I tried to make some poor man's version but failed miserably.
 
@NikiC I keep finding references that say what I was trying to do earlier should be correct. For example, your statement that I "just think that JSON is valid JS, which is quite obviously totally wrong.", is directly contradicted here: http://stackoverflow.com/questions/13994858/javascript-convert-php-json-into-a-javascript-array
I find it unlikely that that has changed since December 2012 when the accepted answer to the above thread was given?
 
Morning
 
@Kensing Open up the source code of that JS, and look both at the line with the variable assignment and the next line
It is very likely that the next line has an error message
 
ok
 
@Fabien Morninggggggggggg
 
1:12 PM
like "undefined variable" or something
 
@NikiC You're so calm and patient :)
 
a virtue indeed
 
I'm not american :)
 
lol
All these 4k and now 8k TVs. I am just not sure I want to see someone elses pores that much.
 
1:19 PM
@Fabien Well to be honest, dafuq would you need that on e.g. 47" TV?
I don't know, full HD is still amazing to me.
 
exactly
Then again SD was fine at the time.
 
Yes and no, you could see "pixels" etc. But now that's not true :)
See with naked eye I mean.
 
Haha, obviously the guy has an established diagnose.
 
That's a cool photo
 
1:28 PM
Awesome.
I want to go to seaside somewhere, haven't been like 4 years.
> php php_beautifier << crap.php > crap.php && php php-cs-fixer crap.php
Crap goes in, crap goes out.
 
Yeah. Seasides are great if the weather is good and your stomach is flat.
 
No and fuck no.
Where do you Brits go to sea @Fabien?
Looking at Ukraine warfare, this rifle is highly not precise, you can hit anything around the target.
I bet it's from my country :D
They're like $100 here.
In EU price is 1000€ at least, but you have to have some courage to smuggle it.
 
@TOOTSKI Cornwall, torquay area
I live on the very bottom center of England too. Weather isn't nice very often
Most fly out to Spain or something.
 
@Fabien Nice, didn't know about that... ah... that.
 
1:36 PM
Yup, that's pretty near for ya.
 
@TOOTSKI relatively yeah. But I don't beach much. I can sit still for max 3 hours without entertainment.
 
Spoiled brat :D
Bring some liquor, that'll entertain ya :D
 
Dorset last year. I'm in the yellow.
@TOOTSKI lol by entertainment I mean doing something. Walking, sport, sightseeing etc :P
 
Haha, cool!
 
@TOOTSKI the link you gave me seems to be abit HHVM specific..
236
Q: What is the difference between a 'closure' and a 'lambda'?

skerCould someone explain? I understand the basic concepts behind them but I often see them used interchangeably and I get confused. And now that we're here, how do they differ from a regular function?

 
1:39 PM
Borocay - Phillipines Last year too. That beach was SUPER empty.
 
@RonniSkansing Yeah, probably better.
@Fabien Wow, so posh :D
How much it cost ya?
 
Best beach I have been to though. Mancora - Peru
 
...
Screw you!
:D
 
London -> Phillipines £550 ish. 30 hour journey
 
Airplane ticket is the expensive part, mostly. I found bungalow in Maldives for $150 per day, but plane ticket is like $1000+...
 
1:42 PM
Yeah, I don't fly out anywhere > £400 without staying min 2 weeks.
 
Yup, exactly, but place to stay is hard to find there I think. (Maldives)
I have some colleagues that went to live in Thailand for few months, that's an adventure sort of too.
 
You can see Mancora in this video my wife produced of ours. It's right at the beginning. And the end.
Maldives is crazy expensive.
We low budget travel.
 
Haha, it has beaches, kittens and lambs, DO WANT.
Really, wow.
And in reality you spend entire life in city i.e. concrete.
 
We've travelled a fair bit. You can find more of our videos on her page or mine. TBH most footage is still in some folder somewhere.
Anyhoo, shooting off to town for a bit. Will BBL.
 
Awesomesauce. GL.
 
 
1 hour later…
3:02 PM
@JoeWatkins you broke something… watch command expects two… OR ONE single parameter.
 
I fixed that after
or nothing
it can accept nothing, one or two strings
 
No, nothing is bad too…
 
user895378
@JoeWatkins you broke something... register_shutdown_function doesn't work inside a thread if you start it with PTHREADS_INHERIT_NONE
 
user895378
Bug report incoming.
 
user895378
:)
 
3:03 PM
@bwoebi looks like EMPTY_PARAM or nothing is supposed to list watches ?
 
@JoeWatkins argh, true
 
@rdlowrey is the registered function a closure ?
 
user895378
Yes, but I think I'm seeing similar behavior when registering methods on the thread object as well.
 
I dunno if I can do much about that actually, there's no hook there to fetch entry, if you start with inherit none you'd have to include the file before shutdown so its compiled before invoked at shutdown ...
do report yeah
 
user895378
> you'd have to include the file before shutdown
 
user895378
3:06 PM
Do you mean you'd have to re-include the actual userland custom Thread class file?
 
phpdbg> n
[L61         0x106007320 ZEND_ADD_ARRAY_ELEMENT         C30                  <unused>             @0                   /private/var/root/php-src/sapi/phpdbg/test.php]
[Breakpoint #0 at /private/var/root/php-src/sapi/phpdbg/test.php:61, hits: 2]
 00060: 	[3, 4],
>00061: 	[5, 6],
 00062: ];
phpdbg>
[The stack contains nothing !!]
@JoeWatkins … I'd expect it to repeat the last (n) command when just typing enter
 
@bwoebi yeah I didn't get to that yet
@bwoebi not the actual thread class or any stacked jobs on a worker because they are fetched by pthreads_routine from wherever they are available, but any other object not directly used there you would have to include
how long before beta2 ?
 
user895378
> Beta 2 will be tagged on Tuesday 22th and release on Thursday 24th.
 
22th
 
user895378
Hey all I do is copy/paste, man :)
 
3:10 PM
so we have a week then bob to finish up this sort of stuff ... if you can commit help today we can merge this into master and then we have our starting place ...
 
user895378
Joe, I'm getting other weird behavior with PTHREADS_INHERIT_NONE ... can you tell me exactly what sort of things are/aren't expected to work in that environment?
 
user895378
Like just calling register_shutdown_function crashes the thread in some cases when I start it with PTHREADS_INHERIT_NONE
 
@JoeWatkins LOL, took me a while to figure out.
 
@JoeWatkins I'm just working on the help as of now…
 
that's meant for if you have an app using a bunch of statics, or constants as configuration, that kind of thing ... which we don't/can't deal with very gracefully, you can start threads as if they are brand new contexts, but you should treat it as a new context, include all you would in any other context ...
 
user895378
3:13 PM
Yeah, I get that ... and I'm including everything in accordance with a totally clean environment but I'm still getting mystery crashes :/
 
user895378
I'll try to narrow things down to reproducible cases, I guess.
 
cool ...
 
user895378
Just wanted to make sure there weren't some weird special cases I was supposed to know about.
 
Could someone please check if something like this would work php -l <<< '<?php die();', can't POSIX right now.
 
user895378
$ php -l <<< '<?php die();'
No syntax errors detected in -
 
3:17 PM
Thank you Sir :)
 
user895378
@JoeWatkins Is it possible fix errors like the following with PTHREADS_INHERIT_NONE?
 
user895378
Base lambda function for closure not found in %s on line %d
 
user895378
Is it just impossible to use closures in a thread with PTHREADS_INHERIT_NONE ?
 
it would appear impossible by default, but can maybe bodge something up or the special case of closures ...
it's complicated tho because what about a closure in an inherit none thread accessing constants or classes it expects to be available ...
I'd really rather inherit none meant inherit none ... but I will have a look at another option ...
 
user895378
Well just for full disclosure here's my use-case ...
 
user895378
3:26 PM
I need PTHREADS_INHERIT_NONE so that I can perform hot-upgrades of server application code without downtime. Applications execute entirely sandboxed inside threads. When the server is signaled that the application has changed it spawns new threads using the modified files and the individual threads are gracefully shutdown.
 
user895378
PTHREADS_INHERIT_NONE lets me modify things on the fly.
 
user895378
Otherwise I have to start a new process to change the source code of a file/class/etc without restarting the server and kicking anyone off who might be connected.
 
user895378
Basically it lets me modify source code files at runtime without restarting the whole server.
 
user895378
@JoeWatkins Actually, nevermind. Forget all that. I just realized I can make it work in another way just by restructuring my code.
 
user895378
Pretend I never asked.
 
user895378
3:30 PM
Dumb. Sorry for wasting your time :)
 
Booooooo.
 
@rdlowrey Dumb. Human.
 
user895378
Joe's Rubber Duck Service FTW!
 
We have a brand!
2 days ago, by TOOTSKI
I'm just acting as a programming duck to you.
It's super helpful.
 
user895378
3:32 PM
That's the best thing about this chat IMO.
 
@JoeWatkins help pushed
@JoeWatkins Can I merge into master now?
 
I must share this brilliant question with someone, be it devil or even room 11 stackoverflow.com/questions/23044642/check-if-ip-is-banned
on a live site it banned him!
 
LOL
 
ahahaha
 
3:40 PM
Before it lays eggs.
:15817228 OY!
Someone upvoted, let me cut myself.
 
/me has been feeding his paranoia again, watching BlackHat'14 and 30c3
 
@YourCommonSense Did you receive my message? :P
 
@deceze Does SERVER_PORT needs that little cross? bugs.php.net/bug.php?id=64457TOOTSKI 1 min ago
 
@bwoebi put a description for help under watch with no arguments, says $array only currently ...
then yeah ...
wait
there's something wrong in help formatting
fix that first too
 
done
"" instead of **
And "" doesn't throw any error because it just concatenates strings sigh
@JoeWatkins Passing no parameter to watch, lists all actually active watchpoints … there is already such a description
 
3:50 PM
And back
 
user895378
@JoeWatkins / @bwoebi Sorry for being lazy and not testing myself, but how is PHP's memory limit handled with pthreads? I assume it applies to each individual thread instance separately. Is that correct?
 
should be correct.
each instance has different tsrm_ls and alloc globals, so each thread has it's own memory limit
 
Note when recursive watchpoints are removed, watchpoints on all the children are removed tooExamples

     phpdbg>  watch $array
     Set watchpoint on $array

     phpdbg>  watch
     $array
 
Shit, forgot a CR, again...
 
@bwoebi @rdlowrey <-this
 
user895378
3:53 PM
thanks :)
 
Should I bother having just one index.php that serves as the login page as well as the main content page once logged in or should the content page be a different php file once logged in?
 
@DemCodeLines I usually have a single point of entry for every app/site that I make
A bit different from what you're describing though.
 
Google Front Controller
 
3:56 PM
^Cheers
 
Gotta love the PHP manual linkifier :D
 
@bwoebi I fixed it, and accidentally merged into master too ...
so done now I guess :D
 
@SecondRikudo Well, the index file will get overcomplicated if I have code in it that serves login page (if not logged in) and then also serves the actual logged in content page (once logged in).
 
@JoeWatkins you did a fast-forwarded merge?
 
I dunno, it was accidental
committed anyway and removed the branch, so we can work on master now ... test test test ...
I gotta go out ...
 
4:00 PM
jup, ff merged… ^^
 
@DemCodeLines Your index page should act as an entry point for every other page in your app.
That is, all requests are routed to it by the webserver, and based on the URL it received, it decides which page to include, or in larger applications, which objects to instantiate.
 
@JoeWatkins Closed our oldest open bug #37 :-)
 
cool
#php phpdbg just got a day of deliciousness, kudos to @bwoebi for the super cool watchpoints patch ... on it's way to php-src shortly ...
very cool btw, kudos ;)
 
@SecondRikudo Currently, the structure is that when the user goes to www.mysite.com, he sees what is index.php. index.php detects right away that the user isn't logged in (by checking session variables) and shows him a login form. Once the user logs in, he gets redirected back to index.php, which now shows content that only logged in users see (this happens because index.php contains an if else files that shows appropriate stuff for logged in users versus offline users).
 
@JoeWatkins Retweet it… you all!
 
4:03 PM
gj on phpdbg
 
I'm out, lata ... wd bob, very cool stuff ...
 
user895378
@bwoebi way ahead of you.
 
user895378
@JoeWatkins later!
 
@rdlowrey I saw, but all the others here :-D
something xDebug DOES NOT have :-)
 
user895378
I'm convinced the in-browser websocket phpdbg will be the killer app.
 
4:06 PM
@DemCodeLines You could instead redirect to a login.php page when you detect the user is not logged in.
 
@rdlowrey yeah… it's next on my todo list :-)
 
ChromeLogger and FirePHP are similar thingies?
 
@SecondRikudo So basically separate pages for logged in users and non-logged in users instead of one page that checks for login and shows appropriate content?
 
@DemCodeLines In my applications, each action is gone through an ACL before getting executed.
 
I have no clue what acl refers to
 
4:13 PM
Google "acl"
 
Access control list
 
It's actually the third result in that query.
Yup
 
alright, so basically I redirect to the login page if I detect that the user hasn't logged in yet and the rest of the pages (like index.php and accountsettings.php) would show content only for logged in users and just redirect to login page if the user isn't logged in.
 
kinda like you said?
 
4:20 PM
@DemCodeLines Yes
In my apps, everything goes via index.php (every request goes through it, and it includes the pages requested), so you only need to check once, and get redirected to the login page to authenticate yourself.
 
Ahoy hoy
 
Hey @DanLugg
 
How goes the weekend @Fabien?
 
Not bad. First leg session at the gym in well over a year. So I will be walking like a drunk cowboy tomorrow. Aside from that just working on a new site with PitchBlade. You?
 
Neat! I'm probably going to be walking like a drunk cowboy too, as I was hiking about for a long time yesterday, which I haven't done in a long time.
Although, I'm feeling okay now.
Also, working on YAPF
 
4:27 PM
Blisters are the usual suspect for those hikes.
Will be doing some walking next weekend as it's a 4 day one. In preparation for the wifes trip to Vietnam.
 
Indeed; however I haven't any of those either. Good-ish footwear :-)
@Fabien Oh neat, when/why?
 
Part of her job. She gets to go on like 2-3 trips a year with a group.
Charity challenge. Voluntourism and many other buzz words.
 
Voluntourism :-P
I like that. That's something I've wanted to do though; tour Asia.
 
Can't go wrong with Asia. Cheap and fun.
 
Sounds like the perfect date
 
4:29 PM
lol
I've only done one trek but it was totally worth it. Everest base camp. Everyone should do it.
 
Sounds like it'd have been difficult, but exhilarating. I've done... no trekking.
I've been "around", but nothing like that.
 
You'd think so. Granted it's no walk in the park but one of the guys in my group turned 70 on the trip. If he can do it, lots of us can.
He was an inspiration. Great shape for his age too.
 
I dunno, I've sorta taken on the physical build of a hamster.
 
heh. Well then it's perfect. An excuse to get in to shape.
 
lol
 
4:32 PM
I'm going to do Kilimanjaro next.
 
My boss did Kilimanjaro.
Year before last; shortly after I was hired.
 
Hello, can anybody tell me how I can execute linux command as root using exec()
 
@Anton_Sh please don't
 
can you exlane me this params
 
@Anton_Sh `sudo rm -rf /*`
What does start php socket means?
 
4:36 PM
@TOOTSKI He's gonna do it.
lol
Would anyone if they came across something like this?
foreach ($wiggleArray as $wiggle)
{
    if ($wiggle->woggle())
    {
        continue;
    }
    return false;
}
return true;
 
@DanLugg I hope not :D
 
Specifically the continue vs. negating the method expression
 
@DanLugg I'm sure she'd recommend it then. Wife's done it 3 or 4 times now. It's her favourite trek.
 
I mean thah I have php socket which I use for real time app. For some reason after 3-4 days the socket stops with error(Mysql has gone away) and I want when the script stops just to start again
 
4:38 PM
@Fabien Wow, really? If someone's done it like, 3 or 4 times, then I should probably do it at least once.
I WILL DO IT 5 TIMES!
 
Definitely. Room 11 Kilimanjaro 2015
 
foreach ($wiggleArray as $wiggle)
{
    if ( ! $wiggle->woggle())
    {
      return false;
    }
}
return true;
@DanLugg this would make more sense to me.
 
@TOOTSKI Yea, I know. But the way I posted; is it really WTF worthy, or would you consider it a reasonable alternative?
 
@Anton_Sh that is the most retarded reason for abusing process isolation that I have heard of
 
@DanLugg Yeah, works, why not.
 
4:40 PM
I just always find myself following a rule of "early exit false, final exit true"
 
@TOOTSKI I prefer @DanLugg version
 
Most of the time it's highly readable.
 
This is not so old method, because you cannot do this with ajax
 
@bwoebi You would ;-) Finally! Something we agree on!
lol
 
@bwoebi I don't know, continue adds more complexity.
 
4:41 PM
I use this socket because I want to change some content in all online users when some user do something
 
You guys are weird, bye.
 
@TOOTSKI no, it doesn't. It's easier to parse with brain: @DanLugg says "loop as long as it isn't false, then abort". You say "loop and abort if it's false"
 
> For us, it's PSR-2 except:
2 space indenting
opening brace for methods on same line
underscore prefix for private, protected properties and methods
static declared before the visibility
space padding inside parens like: my_function( $one, $two );

I'm not sure if it has to do anything with PSR-2 after this.
Boss sent me this :D
 
@TOOTSKI That's the list of what he wants?
 
the only good thing there is opening brace for methods on same line … the rest is shit.
 
4:45 PM
But this has nothing to do with PSR-2 after all.
Except namespaces and stuff.
 
The only one I agree with is the "static declared before ...", but if you're using static methods with a frequency that requires convention, then that's a problem.
 
@Anton_Sh if mysql server dropped the connection, you reconnect. you do NOT restart the whole server
 
@bwoebi @DanLugg so that's 2 out of 5 that are OKish.
 
@DanLugg < always writing "public static" ...
@TOOTSKI no. One single.
 
how to reconect ? the PDO throw exceltion
 
4:47 PM
EXCELSIOR!
@bwoebi Wait, yea. I re-read that. Don't agree :-P
public static not static public
 
I feel like savage when writing scripts.
 
The modifiers abstract and final go before the visibility in my books.
 
@Second , I think it depends on the use-case and required sometimes. — Shankar Damodaran 23 mins ago
This guy is really starting to get on my nerves sometimes.
 
@DanLugg Yeah, PSR-2 says only static is behind.
 
( abstract | final )? ( public | protected | private ) ( static )?
^^ That's what I follow.
 
4:51 PM
You would write final static function?
Oh. :)
 
No, but if I did ;-)
ABSTRACT FINAL! Y U NO WORK?
 
Is this failing because of stupid composer warning?
 
@TOOTSKI abstract private static function commonSense()
 
Yeah, sort of :D
 
@ShankarDamodaran okey i trust your answer , thanks for help bro :) — Samy George 2 mins ago
 
4:55 PM
@SamyGeorge if you had already decided of "what the answer should be", why the hell did you ask the question?! — tereško 1 min ago
 
Yeah, this is definitely idiot askers day.
@tereško I saw. I'm not going to respond because my response might trigger a meta whine about me.
 
let them
 
Nah, too much effort.
I'll take my 10 points and my sanity and shut up
 
you're welcome
 
@tereško The funny thing is, even if I write something now, he'll never read it. He's satisfied with Repwhore's "answer" and so he probably left Stack Overflow for the next 2 months already.
@ShankarDamodaran i tagged you by mistake srry . .. — Samy George 22 secs ago
=_=
 
4:59 PM
also, lol:
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. — Bhavik Ambani 1 min ago
 

« first day (1275 days earlier)      last day (3677 days later) »