« first day (1525 days earlier)      last day (3417 days later) » 

5:03 PM
posted on December 19, 2014 by kbironneau

/* by Arysthaar */

 
Shame about the site really :-/
 
:-)
 
@ircmaxell Your tweets are very cool. Thanks man.
 
I don't always deploy on a Friday but when I do it's the last work day of the year
 
@user3002233 I wish I had cool tweets.
 
5:11 PM
random fun fact: It's friday. I am on vacation tomorrow and I am currently doing a release/deploy
2
 
/me goes to get drunk
 
@salathe What is your twitter account?
 
@DaveRandom I figured I should have a drinkup on every successful deployment to our production servers and then gradually move to continuous deployment
 
5:28 PM
Failed asserting that two strings are equal. <Click to see difference>
clicks Contents are identical
 
@NikiC Do an md5 of them...
 
likely just newlines once again
yeah that was it
fuck whoever invented \r
 
I think we can blame bill gates ?
 
5:45 PM
@JoeWatkins It's a bit older than even him - en.wikipedia.org/wiki/Baudot_code#Murray_code
 
OS/2 did it because Windows NT did it because Windows did it because DOS did it because CP/M did it because teletypes were slow
@JoeWatkins The folks at MS were pretty decent actually, compatibility was always the problem. If it weren't for that, DOS would've probably used LF newlines and / as the directory separator
 
good morning
 
@JoeWatkins It was IBM who came up with \ as using / for directories would mean changing the command-line switches to use -
 
@AndreaFaulds and a happy friday to you
@crypticツ howdy.
 
@Orangepill hello
 
5:59 PM
I have a potentially long winded function to run that I would like to include results to the user if it returns in an alotted amount of time but give an alternative response if it takes longer then that.
 
@Danack nah, hex dump
 
github.com/php/php-src/pull/955 <-- thoughts? (for the summary, just read the sed script)
 
any one got any suggestions to nudge me in the right direction?
 
Both are good - the values returned by spl_object_hash tend to only vary in the middle...
@Orangepill Make something that processes tasks in the background and poll it for a result.
And use supervisord to keep the background processor alive.
 
@danack rabbitmq or it's ilk a potental solution?
 
6:02 PM
^ this, was going to suggest the same
You could also use pthreads maybe
 
No More var_dump – Introducing Symfony VarDumper! - SitePoint PHP http://www.sitepoint.com/?p=96884
 
@Orangepill Yes - though if you have Redis already installed, you could just use that for pushing tasks /polling /notifying.
 
@ircmaxell Yes, you need xdebug vardumper, Derick Rethans told me so
 
no, you need to vardumper. You need an interactive debugger
 
I don't use var_dump anyway, I use printf debugging
How do you locate a segfault? Put a printf before and after where you think the fault occurred
If the second printf doesn't show up, you found the fault.
 
6:05 PM
/me face-palms
 
@ircmaxell this is how I do most of my debugging, far more effective than gdb :-D
 
how do I locate a segfault? I run through it with GDB and then look at the backtrace
 
valgrind and strace really help
 
well, that's locating why, I'm talking locating where
 
6:08 PM
I use valgrind
 
I also usually use valgrind for that
 
gdb seems to always be useless when I get a segfault, though
 
Wait, are we talking about php here or C?
 
fair enough
 
It's a tradeoff between how much time valgrind takes to run and now much time it takes to invoke gdb instead of valgrind ^^
 
6:08 PM
C
 
though gdb --args helps
 
Ah, then yes. I use GDB often when I can't find it with valgrind.
 
/away
 
@ircmaxell that's hilarious :D
Don't IDEs like PHPStorm break on uncaught exceptions?
 
6:10 PM
probably
 
there's an option
 
It's just much more useful to break into a debugger on exception than the alternatives.
 
yup
 
I'm trying to enable php on my mac and following php.net/manual/en/install.macosx.bundled.php and I get lost after step 2. Anyone done this before
 
@benlevywebdesign If you don't need apache, you can just try the built-in server php -S localhost:80
 
6:21 PM
@nikiC How do I do that?
 
@benlevywebdesign Run that command from your document root
 
@NikiC I think this is where I got lost...
 
so, do you know how to use the terminal?
 
@benlevywebdesign mamp.info/en
 
6:27 PM
Mac has php built in though...
 
I don't think I need to use mamp if mac has it built in. I just need to enable it?
 
Google it
 
I did and I got lost as I said earlier
 
6:45 PM
@ircmaxell well, actually if you try to use var_dump with sf2 you actually get some information overflow ... which perhaps is as well the case with the sf2 VarDumper but anyways :)
 
"information overflow"...?
 
@ircmaxell all full of objects with objects and what not. just too much information, there's no benefit in using var_dump in a sf2 app most of the time.
or not much benefit.
 
var_dump is not a replacement for a debugger
 
user image
5
I would just like to remind everybody that this happened.
 
posted on December 19, 2014 by Anthony Ferrara

I learned something rather disturbing yesterday. CodeIgniter 3.0 will support PHP 5.2. To put that in context, there hasn't been a supported or secure version of PHP 5.2 since January, 2011. That's nearly 4 years. To me, that's beyond irresponsible... It's negligent... So I tweeted about it (not mentioning the project to give them the chance to realize what the problem was):

10
 
time for dinner.
 
@ircmaxell good
 
7:18 PM
Really it just highlights how far behind CodeIgniter is
also
 
yup
 
it doesn't have to be about version numbers ... say for instance if you don't know or care about CI, then it's more about attitudes than numbers or any particular project ...
 
Man there's so much drama and fantastic RFC's at the moment....
 
good evening
 
someone said on internals the other day that a release of say fedora, uses a single version throughout the release ... is that right ??
because that's really against us if true ...
I think Zeev said it .... though can be wrong ... it was definitely said ... that they don't even change patch version ...
 
7:24 PM
@JoeWatkins Could be true, I think it's the same for Ubuntu..
 
@Feeds There is a discrepancy in this post between <= 5.2 and 5.4+
 
maybe if we had a better way of deploying php, we'd be in a better position when it came to adoption rates ....
 
@JoeWatkins PHP 5.3.3-7+squeeze22 with Suhosin-Patch (cli) (built: Sep 29 2014 17:48:08) seems to be the latest version available on Debian 6 (which is still supported)
 
What if we put PHP, in composer?
mind-blown
 
Good fcriday evening morning room
 
7:29 PM
@Feeds Omfg Debian 5.2 has no mitigation for hashdos?
 
@AlmaDo "fun"...
 
Hopefully people on that version at least use suhosin ext
 
Aw, have to wait for php"7" for this
I'm going to guess.. is that called: callable dereferencing?
 
I would just call it "actual callable" or considering it is php real_callable
@ircmaxell you twitter reference fails on me:
> WordPress users who don’t
 
7:52 PM
@Jimbo Uh ... why would you need that?
 
@NikiC As a replacement for call_user_func([$obj, 'method'])?
 
@Jimbo And why would you need that (the call_user_func)?
 
@NikiC Taking in a string and, if the method exists on an object, calling it
:D
 
I don't get it
Isn't call_user_func([$obj, 'method']) the same as $obj->method()?
 
What's a way I can generate a numeric only UID from a string, where it's unique to that string and will always generate the same UID. I basically want to generate the UID for analytics per domain name. I was thinking assigning each letter the numeral of it's placement in the alphabet, but that would require a bit of code, any other simpler ways?
 
7:57 PM
@NikiC Well the method's in a string
I know you can use { } but don't like that
 
@Jimbo So $obj->$method() maybe?
 
@NikiC Yeah, I'll use that :-P cheers
 
@crypticツ ord?
 
@Jimbo Too much magic (I can say the same about $obj->$method()).
Morning room.
 
What's the best way to convert [$a, $b, $c, $d] to [$a => $b, $c => $d]?
I could do a simple loop, but is there a built in function for that?
 
8:01 PM
@crypticツ 3v4l.org/g70NH ?
 
@PeeHaa That's not unique though
 
I read it as "unique to that string" as in one string one id thingy. Maybe I am wrong :)
@crypticツ clarify that shit! :-)
 
I understood it as "two strings won't have the same UID"
@kelunik Don't think there's any totally simple way
 
@Leri Trying to map a JS string (chosen from a dropdown, it'll be sanitised etc), to a method being called on an object from a lib: Source
 
There's array_combine if you have two arrays, but you have both in one, so that won't work
 
8:05 PM
@Jimbo call_user_func would be much verbose.
 
@Leri That's not what @NikiC suggested
 
@kelunik So... simple loop is not so simple?
 
trololol
 
@Leri Why write more code, which is less clear?
 
@webarto It is, but I did this several times and @bwoebi replaced that with some array_* more than once.
 
8:07 PM
Ah, yes, Bobby has some tricks up his sleeve.
 
@NikiC To be more verbose. If you work for a company, you should not only think about your comfort, but also what will happen when you leave group. More verbose your code is, better new comers understand it.
 
@Leri Zero fucks given.
 
@Leri verbose !== more clear
 
:-P
 
Not always at least :)
 
8:09 PM
@Leri Verbose code is not clear code. $obj->$method() is more straightforward than call_user_func(array($obj, $method)). The latter is a pretty meaningless callback convention PHP uses, while the former is a totally normal method call.
 
@PeeHaa I never said call_user_func is clear.
 
@PeeHaa With reasonable certainty, I must admit that my opinion on this matter is considerably similar to that of which you have just expressed in this conversation.
 
If you think "verbose code" is good, go write programs in XSLT
 
@Leri "better new comers understand it."
 
@NikiC "program XML" lol You ruin my fun :-P
 
8:09 PM
Am I really missing every point everybody in here says? :(
 
@NikiC Pro tip: google it (nsfw)
Unless it is my search bubble :P
 
@PeeHaa nope, not your search bubble ^^
 
\o/ :-)
 
8:13 PM
@salathe :D
 
What we're missing here is array_combine($array[0::2], $array[1::2])
And array_slice has no step support either
Also I just noticed that :: yields a scope op, so that syntax isn't the best idea anyway ^^
 
@NikiC How about array_combine($array[0~2], $array[1~2]);
 
heh
 
@kelunik $array[0☃2]
 
8:17 PM
don't really think the slicing step is worth special syntax. not using it so much in python at least
 
aww, snowman looks rubbish here :(
 
@salathe But you can still recognize it :)
 
@salathe ...and make the syntax only valid if it's currently december
 
@NikiC and the code's running in a place that gets snow?… :P
 
@salathe that's too hard to figure out ^^
 
8:19 PM
To be honest, figuring out if it's December is hard enough!
 
@salathe Right, because of the timezone warning
 
@crypticツ might be overkill but github.com/ramsey/uuid is useful for other stuff as well.
 
8:34 PM
@NikiC So, in other words, Java?
 
@Danack it has to be numeric only =o( the ids are stored as int in database and can't change that. That in mind the value can't be too big either.
 
@crypticツ php.net/manual/en/function.crc32.php then....and put a sanity check when you add strings to check for a collision. You're unlikely to have any but it is possible.
 
@Danack ooh forgot about that function and that it returned an integer. Yeah, I don't think I'll have much of a problem with collisions and if it happens can take care of it.
 
9:06 PM
can someone help me do pregmatch so i can be letters a hyphen and spaces
so far i have preg_match('/^[a-z0-9 \-]+$/i', "some string - here")
 
@this.Tony /^[a-z -]+$/i
not sure why you had numeric in there since you are not asking for that, and you don't need to escape the hyphen if it is the last char in the list.
 
yeah im not very good with regular expressions but thanks a lot @crypticツ
 
if by 'spaces' you mean whitespace, you would want to use \s
 
where would i insert that?
 
replace the space that there is right now with \s
 
9:12 PM
what's the difference between the little space and \s
 
@salathe ninja'd
 
@this.Tony \s matches linefeed, newline, space, tab, etc according to docs will match any whitespace, a simple space will only match a space.
 
simple space is good then @crypticツ thanks man
 
9:15 PM
@DanLugg For all my hate of Java - it comes nowhere close to XML based programming languages
 
I thought @this.Tony got suspended?
 
on a different subject:
nice post, @ircmaxell
 
@ircmaxell "Think of the shear number of servers that were upgraded." (shear should be sheer, afaik)
 
9:34 PM
Opinions on my JsonValidator?
Is there a better way?
 
am I only one who think that PHP should either have catchable warnings or get rid of them
 
@tereško Yep, for things like that, file_get_contents() etc, I have to @ them and throw my own custom exceptions
At least I can maintain a consistent object api by doing that
 
well, IMHO, warning should act as exceptions, with only difference that not catching them will display a non-fatal error message
.. then again, I am not in the core team .. hell, I can't write a hello world in C without google
 
10:07 PM
        $data = @json_decode($data);

        return ! (is_null($data) || json_last_error() !== JSON_ERROR_NONE);
@Jimbo :D
 
Good afternoon
 
@webarto Ah, nice. Thanks :P
 
10:20 PM
Is there a way to check if a variable has actual text in it or if it's simply &lt;p&gt;&amp;nbsp;&lt;/p&gt; or other combination of non-important tags?
 
not easily
 
Basically, I just want to see if there is actual text. Not just those tags. Strip tags and trim don't get the job done.
 
what's the problem that you are actually solving ?
because this sounds suspiciously like a case of XY problem
 
@NikiC Hm… step support for array_s(p)lice sounds like a great idea :-)
 
10:47 PM
@ircmaxell 'If users don't know what "version" means, then teach them. That's how we all get better. That's how the community moves ahead.' <-- This so much.
 
@kelunik Why do you need to do this? That's what I always wonder.
How did you get the data in the 'wrong' format to begin with?
 
@LeviMorrison Redis ;-)
 
@LeviMorrison redis output.
 
What about it?
 
10:53 PM
@LeviMorrison it returns one line key, one line value, one line key, ...
 
Then why don't you read it off properly to begin with?
 
good question, ask @kelunik
 
@bwoebi It returns an array with these keys.
 
You anyway do something wrong when you only operate on data after everything has been fetched…
 
@bwoebi But given the current sigs, would be pretty ugly
 
11:05 PM
WTF is this shit, Facebook engineers. Why the hell does Hack do that? I am disappoint.
oh well my troll attempt failed
 
@AndreaFaulds The URL is a bit too obvious...
 
@NikiC It's url-encoded, but Firefox (maybe Chrome too?) decodes it :(
The actual URL ends with %68%74%74%70%3a%2f%2f%72%65%62%65%63%63%61%2e%62%6c%61%63%6b%66%72%69%64%61%79%2‌​f
 
@AndreaFaulds chrome too
 
@FlorianMargaine damnit
 
besides, facebook blocks you and shows you the url
 
11:46 PM
reddit.com/r/PHP/comments/2pthe6/on_php_version_requirements/… => Did I understand the last paragraph wrong or is this person exceedingly stupid?
 

« first day (1525 days earlier)      last day (3417 days later) »