« first day (1417 days earlier)      last day (3524 days later) » 

10:04 AM
blood test done, also went to see kids' new school ...
 
being productive today, yeah?
morning guys
@DaveRandom Apparently I needed git rerere, and no, I'm not stuttering.
 
yeah, was meant to go yesterday for bloods but was talking to you instead @Jack ...
 
:)
 
@Ja͢ck morning
 
good moaning mr hordijk :)
 
10:06 AM
 
@Ja͢ck :)
 
O'Bama you say? The Irishman?
 
Morning guys
 
never heard of that before
 
10:07 AM
hehe the irishman ...
 
@DaveRandom Yeah, so it remembers how you resolved a prior merge commit.
 
that could be useful in master/5 merges
 
Yeah, exactly.
 
though I won't be bothering to try and write for both anyway ...
 
2
A: Rebase onto upstream changes with non-trivial merge commits present locally

ChrisIdeally you would "reuse the recorded resolution" with rerere: In a workflow employing relatively long lived topic branches, the developer sometimes needs to resolve the same conflicts over and over again until the topic branches are done either merged to the "release" branch, or sent out and...

 
10:09 AM
good mornings
 
@JoeWatkins Small fixes are still worth it, though.
 
yeah but I mean new code is going to target 7 or be written twice from scratch ... bug fixes should still be going on I guess ...
 
Yeah exactly.
 
I don't want to stop your conversation but I want to ask something about PSR Standards, because I know that you know it better than me. So here's the question: Can I lowercase namespace? I'm using a Windows, that's the reason why I'm asking (case sensitive filesystem)
 
Windows has a case sensitive filesystem?
 
10:16 AM
NTFS actually is case sensitive, Windows applies a case-insensitive access layer over the top of it IIRC
 
Yeah, because BC ... probably, most likely.
 
I think so... I'm not sure
My namespace is CamelCase
 
@VeeeneX it really doesn't matter whether you use UPPERCASE or lowercase or TitleCase or camelCase or CrAZyWtFcaSInG as long as you make sure the files names match the casing
Treat every file system as case-sensitive and you can't go wrong
 
I'm using Universal Class Loader from Symfony Components
 
Similarly, while it may be possible to create afile.txt and AFile.txt in the same dir on *nix, it makes no sense to do so
 
10:20 AM
@VeeeneX PSR-1 mentions that class names should be StudlyCaps.
You've asked for PSR standards, so there's that.
s/should/must/
 
Also @VeeeneX take PSR specs with a pinch of salt anyway, when it comes to coding style. As long as your code is mechanically interoperable then you don't have a problem. It doesn't matter that you follow the style guide as long as you follow a style guide for a specific project, and ensure than all people contributing to the project follow the same rules.
 
iirc both PSR-0 and PSR-4 won't work well if the filenames don't correspond 1:1 to class names.
 
They will not, that's sort of the point
 
Though Composer will try to make some sense out of it.
 
But to me it makes no sense to do it any other way, PSR-4 is basically just stating the obvious
 
10:23 AM
@DaveRandom and @Ja͢ck thank you I'll edit my Autoloading class for lowercasing Namespaces.
 
Hmm, that sounds a lot like .. SplLoader
 
@Ja͢ck Well class-map generators generally scan the file content for class defs
 
Exactly.
 
Class maps are also a better idea perf-wise
 
Haven't tested it ... maybe
 
10:24 AM
composer even has an optimisation flag which always generates a map
 
I've read about ClassMapper class which isn't "using" PSR standards
 
The horror!
 
Morning
 
:D Wut?
Morning @Fabien
 
@Ja͢ck Well the point is that if you have a global class map for everything in the project, you don't need a huge autoloader stack, one for each component (which is what PSR-4 generally implies, although it doesn't need to). You make every load operation O(1) and potentially eliminate a bit of fcall overhead.
Component-level class maps with separate loaders don't gain you much, if anything, though
 
10:29 AM
@DaveRandom Sorry are you talking about this ?
 
@DaveRandom not sure about the O(1) though, I would believe O(log N) :D
 
@VeeeneX No I'm talking about composer and the --optimize-autoloader argument, which generates class maps for PSR-[04] projects as well. You should still follow a one-class-per-file layout where file names match the class namespace/name, but in production it's still a good idea to generate a class-map based autoloader as it's faster
 
@DaveRandom Thank you for answer ;)
 
@krakjoe hope you're OK. Be careful putting so many personal details on twitter.
anyone who wants to steal my identity is fucking mental ...
 
@JoeWatkins But what if they don't like pthreads and they want to personally tell you that.
 
user2862309
10:37 AM
0
Q: Create a Collection of Objects from a Class Using a Transformer Function

Mr. MeshuggahIn this question I would like to discuss a problem related to building a collection of homogeneous objects from a class using a transformer function that transforms a passed array or other sort of collection. The problem lies in the fact that I want to persist most clean code as possible and at t...

 
@Ja͢ck They can just hack into iCloud and post nude pictures of the threads they don't like on 4chan
 
heh
For some reason I thought that NoRewindIterator extends Iterator ... apparently, not.
Well, rather, it extends IteratorIterator.
 
yeah ... we don't do that ...
I like how absolutely nothing extends stdClass
 
Oh well, I'll just leave my rewind() implementation empty then ... tada
The comment // we don't rewind, ever. ... should do it.
 
@Mr.Meshuggah So you want a typed collection (or in other words: generics in PHP)? I can't quite figure out what you want there.
 
10:44 AM
Generics? Please sit there and wait for hell to freeze over.
 
:'(
I really flit back and forth on this particular issue, I mean the argument that generics do not belong in a dynamically typed language really does hold a lot of water
But I still want them
If we get scalar type hints then I think there's more chance than people will come around to the idea of generics eventually
 
It gets close to those "But .. Java" arguments, which makes it somewhat subjective.
 
@Ja͢ck why ?
 
I dunno, most of the time I'm just blurting out stuff
 
generics don't seem dependant on scalar hints ... I'd rather have generics first ...
 
10:47 AM
@NoPoliceman
17 year old YOLOer. Pass times include: buying and selling drugs and related paraphernalia, using drugs as well. Msg me to party. #notacop
3.2k tweets, 227k followers, following 6 users
 
lol
 
@webarto Does he follow a cop, though?
Not very good at spelling either
 
When you stand back and look at it objectively though, some elements of the concept of generics are directly at odds with the idea of dynamic typing. But that is also true of a lot of the classical OOP model, which we already have quite a bit of, so...
 
Objectively? I see what you did there ...
 
:-P
 
10:49 AM
It's hard to see where this would go if we had generics
 
@JoeWatkins Indeed they are not, mechanically. But I do think that if they existed, and people got used to them, it would soften the nay-sayers on other strong typing concepts.
 
well ... classes are not dynamically typed
 
Or can the language itself provide enough support to implement generics yourself?
 
This is more about dogma than anything else
 
they are strictly typed, so you can avoid that whole conversation about changing the nature of php if we do generics first ...
 
10:50 AM
This looks interesting ^
 
it has to be supported by the language if you want it to be usable in the real world, you can of course write collection classes, but they'd be horrible ...
 
@JoeWatkins I am fully aware that what you say makes logical sense, but politically... it ain't gonna happen in that order. Look at what happened with typed arrays...
@JoeWatkins They would be less horrible if type hints were covariant
 
it wouldn't matter the problem with a userland impl is the same as the problem with the internal implementation of arrayof ...
 
:18632872 Yes, the fact that hack already has what is basically generics works strongly in our favour here I think. People will come around, it's just a question of time.
 
Ah
 
10:54 AM
you cannot make these checks all the time, you cannot stop a reference to a member having it's value changed either ...
 
Hack has a bunch of nice stuff, as it seems.
 
Although at the moment there's something of a mentality of people using the "just because hack does it, doesn't mean we have to" which people are taking too far the other way - arguing against things purely because hack does it, regardless of merit
 
quite a lot of it is stupid too ...
 
@SecondRikudo Yeah, interesting
 
@JoeWatkins If it only applied to objects (which would be the case without strong scalar types anyway) you could just forbid references. There's almost no reason to ever pass an object by reference anyway, the only reason you would is if you were doing a dirty hack that would be an epic violation of at least one SOLID principle
 
10:57 AM
yeah, sensible ...
see ... better do it before scalar hints area thing ...
not convinced they will be a thing ...
 
I'm still in favour of straight casting hints, seems like the only sensible option for PHP
All this "data loss" business I don't really get. People are already losing data (and not caring) by writing manual casts
 
Anthony makes a good point though, regarding scalar methods, but the same applies to scalar hints ... the only sensible option is to cast yes, but, that does indeed change the nature of php, up until now, now included, we care about context, we don't care about types ... if we introduce scalar hints or methods we have to care about types, what happens if you call ::length() on a float is the same question as what happens if you hint for a string and get a float ... there are no good answers
to these questions ... and if we compromise, we will do it wrong ...
increasingly I think better to ignore it entirely ...
just don't bother with either ....
in ng, objects are hella fast
if you want a string class so you can hint for strings then have a string class ... simple ...
 
I personally just see scalar hints as syntax sugar. I regularly write code that casts arguments to a specific type at the top of the function, being fully aware of the casting rules and how this will behave. If you want something that is int-ish, just use docblocks like you always did and ignore the fact that the hints exist at all
 
they are a minefield, I don't think there are good solutions to these problems so better not to waste time on it ...
 
probably true
 
11:03 AM
@SecondRikudo It's yours Birthday? then
 
Although I'm sure it will still keep coming up, again and again
@JoeWatkins This also is an acceptable approach for me, but only if they work sanely with scalar literals.
 
probably, and I'd vote in favour of any implementation that made sense, so long as an implementation casts in the same way as zpp, then it's compatible and good enough, but, that's not to say I would deploy it, ever ... and would rather we worked on stuff that is sensible ...
 
@DaveRandom can you make a ticket for the savehtml thingie? I already don't remember all of the details of the feature.
 
no worries, give me a minute
 
you don't need to do it now don't worry, I won't work on it before a few hours anyway
 
Hack seems to be the winner.
 
@AndreaFaulds Always has
For some undetermined reason everybody seems to want to have strict typehints
 
@AndreaFaulds Sample size too small to be useful, but I suspect the results are pretty accurate anyway
 
It's a useless sample though
 
What I really need are internals folks
@FlorianMargaine Yes
 
I don't like it :/
 
Though that RFC is dead in my mind
 
I don't like hack's way either
I like this RFC, but being really strict.
 
@NikiC at the same time would vote against strict types has also the most votes of the against-style options.
 
11:11 AM
@AndreaFaulds True, but what users want should be determined first. Internals people (should) vote on whether or not they like the implementation of a feature that has been previously agreed upon.
 
function f(int $i) {}
f('1'); // error
is what I'd like ^
 
A lot of people would like that. I'm not sure it's a good idea or that it would ever pass.
 
@FlorianMargaine that's strict ^^
 
@NikiC well, that's the point of type hinting
 
@FlorianMargaine Are you sure you wouldn't just rather be working in <insert strongly typed language here>?
 
11:12 AM
@NikiC Nothing wrong with being strict.
 
would you pass an stdClass to a type hint saying "array"?
 
@FlorianMargaine Hardly comparable
 
@DaveRandom no... but type hints should be strongly typed.
 
We never type juggle non-scalars
 
@FlorianMargaine yes, sure, but why do you then way that you don't like hack's way either? doesn't it do exactly that?
 
11:13 AM
@AndreaFaulds not really. You can switch between array and stdClass
 
string doesn't work too
 
@FlorianMargaine The very existence of stdClass pisses me off so... no
 
@NikiC I don't like hack's syntax
 
@FlorianMargaine which part?
don't they use the same typehint syntax?
 
@FlorianMargaine Only with explicit casts
@NikiC They do
 
11:14 AM
@NikiC my bad, they do
I thought they used (int: $x)
but it's for the return type
that they use the colon
that would prevent further addition of named params, eventually
 
What compile options do I need to use to generate a "no-debug-zts" build?
 
@Danack --enable-debug --enable-maintainer-zts?
Or... wait
what do you want sorry?
 
@Danack just --enable-maintainer-zts
 
cheers - trying to replicate bugs.php.net/bug.php?id=67940
 
lol, debug mode fixes bug
awesome
 
11:16 AM
Keep reading, it gets better. The crash dump isn't even close to the php code that is being called.
 
Sounds like a job for something like valgrind
I bet you there's a dangling pointer somewhere
 
user2862309
@DaveRandom well the point is that I avoid calling a static method from one of the concrete objects in order to produce a whole collection
 
Arrrrrrgggggggh
> SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0xef3033 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
 
user2862309
If I make a separate collection class then it's decoupled from the class itself so I have to call it with some strings which is dirty
 
@PeeHaa Don't use UTF8, use UTF8mb4 for actual UTF-8
 
11:18 AM
WHat was the pdo type again to pass binary shit?
 
@AndreaFaulds Dunno....I run valgrind on the Imagick...it's probably going to be okay.
 
@AndreaFaulds Isn't that mysql?
 
Oh.
Nevermind
 
user2862309
I can't find a way to make a separate class without genercis and tell it to produce a collection with certain type of concrete class objects
 
user2862309
Without passing a string to the function that generates that collection with the class name that could be used
 
11:19 AM
@Mr.Meshuggah It's the only way, in PHP, if you want to avoid a static call like that. You can use ConcreteClass::class to avoid writing an actual string and make it a bit more IDE/namespace friendly
But you still end up having to do a instanceof check every time something is added
 
Found it \PDO::PARAM_LOB \o/
lob that shit
 
@PeeHaa google for "utf8 ef3033" gives no hits....I'm not sure it is valid -
doesn't like it.
 
user2862309
@DaveRandom yep I know that but I kind of dislike it :/
 
that check has to happen somewhere
 
@Danack $stmt->bindValue($token, \PDO::PARAM_LOB); solves it
It's the result of some encryption magic
 
11:22 AM
"solves"
 
nope without quotes
 
.....you're storing the result of some encryption in a field that is storing utf-8 ?
 
user2862309
so @DaveRandom what do you think is more proper? To use the abstract class that holds the method and call ConcreteClass::createCollection($rawData) or create a separate collection and say new Collection(ConcreteClass::class, $rawData)
 
bytea
 
@Danack That stack has to be from executing different code, surely. Either that or it is some epic and weird bug in xdebug
 
11:24 AM
Not exactly sure what the error message is trying to tell me besides yo dawg no idea what you have there fix that shit :P
 
@Mr.Meshuggah the latter, the former violates several design principles that I adhere to
 
@DaveRandom Yeah, it's either complete user error or something (but probably not in Imagick) is borked.
 
you have an accessible machine that can reproduce @Danack ?
 
@PeeHaa You're storing arbitrary bytes in a field that doesn't accept arbitrary bytes. Not all combinations of bytes are valid utf8, and that's what it's checking for.
 
@NikiC hey, did you notice the failing ftp tests on travis?
 
11:25 AM
@Danack I actually have a zts no-debug 5.6 build if you want me to do anything? I don't have imagick but I should be able to get it set up pretty easily
 
user2862309
@DaveRandom can you please elaborate on those pricipals
 
@JoeWatkins Just compiling now....strongly suspect user error.
 
@Ja͢ck in zts? yeah
 
yeah, which is kinda weird; they all pass on my machine =S
 
there's no kind of user error that should lead to a fault tho
 
11:27 AM
@Danack But but but the field is meant for bytes. Why would it care about encoding?
 
@Mr.Meshuggah Well firstly, no static methods for anything ever (just a general principle). But also your ConcreteClass would then be coupled to the Collection class (unless you also accepted that as a string, rendering it no better in that respect), and would have a method that's not really anything to do with the class itself (SRP violation)
 
@PeeHaa It's not meant for bytes, it's meant for utf-8 chars....it inspects the encoding to trigger errors to be helpful, to prevent non-utf8 chars from sneaking in their and fucking up the collation.
 
I can probably come up with other reasons I don't like it if you give me a minute
 
oooooooow
 
By the way
 
user2862309
11:29 AM
I see, I had similar suspicions because this is just a part of collection not the collection itself
 
that database character set is what it is checked against
 
What does everyone here think of my idea to make zpp emit E_RECOVERABLE_ERROR, much like userland typehints do?
 
user2862309
so calling a method from a single object to create the collection that will hold it and others is kind of not really the best working solution
 
BTW which PHP version support typehits?
( Scalar Type Hinting)
 
6
 
11:31 AM
@VeeeneX none
 
"PHP 7"
:D
 
Scalar Type Hinting? Please sit over there and hold your breath.
 
@PeeHaa yeah, it's definitely not valid. The second byte in a multiple byte char always has the pattern 10xxxxxx. The 0x30 in 0xef3033 is '0011 0000' so your DB is definitely protecting you from invalid data for that type.
 
0
Q: Language made only of brackets, plus and exclamation marks

Eugenio LaghiA colleague of mine sent me a snippet of code made only of brackets ()[]{}, plus signs and exclamation marks. [][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]] and it goes on like this.. This vaguely reminds me of Brainfuck, but I couldn't find any esoteric language...

 
you wonder when they will grow up
 
11:33 AM
@PeeHaa but array is supported
 
@Danack WARNING: php_bin /opt/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match <-- I never use PECL, does this matter? Do you know what it means?
 
pffff stupid database. thinking he knows it better than me. what does he know?
 
(trying to install PECL imagick)
 
@DaveRandom No idea...I never use PECL.
 
@VeeeneX Your point?
 
11:34 AM
Just get source and build manually?
 
build yes, "/usr/local/bin/phpize
./configure --libdir=/usr/lib64 --with-php-config=/usr/local/bin/php-config" for centos
 
@PeeHaa Thank you :)
 
user2862309
@DaveRandom should I extend ArrayObject? It has some nice handy properties
 
@Mr.Meshuggah I'mm pretty sure you'd end up overloading basically every method, and the problem is that you cannot use proper type hints
@Danack cannot reproduce
 
11:42 AM
@DaveRandom MySurpriseFace.jpg
 
[cw@web01 ~]# php -r 'echo "A\n"; new ImagickDraw(); echo "B\n";'
A
B
[cw@web01 ~]# php -v
PHP 5.6.0 (cli) (built: Aug 28 2014 13:40:12)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
[cw@web01 ~]#
 
user2862309
@DaveRandom ok I see
 
@Danack confirmed cannot reproduce with any combo of xdebug/opcache being enabled/disabled as well. Going to leave a comment and put bug report into "feedback" status if you're happy with that
 
@DaveRandom Sure. I strongly suspect that it's Xcache though....
 
@DaveRandom remembered opcache.enable_cli ?
 
11:53 AM
"If you want to investigate the issue, please can you disable XCache and all other extensions other than Imagick, try to reproduce the issue, and then re-enable the extensions one by one."
@JoeWatkins The user's not using it:
 
it can't really be that I don't think, because internal functions ...
 
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v4.0.0-dev, Copyright (c) 2005-2013, by mOo
    with Xdebug v2.3.0dev, Copyright (c) 2002-2013, by Derick Rethans
    with XCache Cacher v4.0.0-dev, Copyright (c) 2005-2013, by mOo
 
I'm sure I read that doesn't support 5.6 yet a few days ago
 
@Danack Ooh using some funky xdebug dev version though
I'm not even sure where to get that from, may be built straight out of git, not available on xdebug web site or pecl
@Danack yeh looks like OP is using a version of xdebug built straight out of git master, which is pretty insane.
 
@DaveRandom s/insane/adventurous :D
 
11:59 AM
Did we bump Zend Engine version yet?
 
Hmm, is it typical that a scanner uses a bit mask for its state?
 
Guys, I need a new keyboard. Low profile, silent! and with mechanical keys if possible. Can anyone recommend something?
 
Why silent?
 
@Gordon Das Keyboard Ultimate Silent Edition?
 
I always like to share with others how busy I am ... therefore blue switches!
 
12:07 PM
@Ja͢ck because noisy keyboards are noisy :)
 
@Danack added a comment and set status to feedback, feel free to add anything I might have missed
 
ta
 
@FlorianMargaine hmm, that could work. do you own it?
 
@Gordon nope
@Gordon that said, I have an apple keyboard. It's great, and a couple of friends who are used to mechanical keyboards told me they were great too
 
12:11 PM
Ha apple Ikeyboard
 
@FlorianMargaine oh wait. it doesnt have labeled keys?
 
@Gordon yeah :D
not for pussies.
 
@FlorianMargaine im not a ten finger typist
 
@AndreaFaulds is Glasgow a bit far for you? twitter.com/glasgowphp/status/506766033156198400
 
@Gordon I'd just recommend apple keyboard then :)
 
12:16 PM
@DaveRandom Is Xcache a PECL project? If not at least some of the bugs related to it could be closed on bugs.php.net e.g. bugs.php.net/bug.php?id=66775
 
@Gordon cherry strait
 
@GeraldSchneider thinking about that one as well. though its not mechanical, right?
@FlorianMargaine this would be plan b :)
 
@Gordon it is mechanical. Cherry is the company that actually builds the switches that are used in most high end keyboards
 
12:22 PM
 
@GeraldSchneider do you know how noisy it is?
 
It is very silent .. I use it day by day.
 
Good morning
 
@Danack I don't know, I don't mind handling that imagick bug because it's pretty obviously at least a little bit PEBKAC, but in the general case... I'd rather leave package specific bugs to package maintainers
 
Sure - it is weird to have bugs listed for something on an official php site when the software isn't listed under pecl.php.net/packages.php?catpid=3&catname=Caching
 
12:32 PM
Yeh that's definitely not sane - but I think the real solution would be to add it to PECL if it's popular.
 
@GeraldSchneider hmm, I dont think it's mechanical. it's too cheap :D
plus, the website doesnt mention which switches it uses
but still a good choice I guess
 
Anyone any idea what does it mean when you run PHPUnit and it doesn't give any result like this:
C:\Program Files (x86)\Zend\Apache2\htdocs\fmsdev\tests\application\controllers>"C:\Program Files (x86)\Zend\ZendServer\bin\php.exe" C:\Users\Ivo\AppData\Local\Temp\ide-phpunit.php --bootstrap "C:\Program Files (x86)\Zend\Apache2\htdocs\fmsdev\tests\library\boot
strap.php" App_Data_Abstract2Test
 
"ide-phpunit" that looks weird.
Oh ZendServer....
@ziGi I have no idea what's going wrong for you. However I do recommend learning to and almost always running your tests from the command line yourself, so that you are always running the tests in the same way as your automated tools will be running it.
 
@Danack that's quite a good point
so you recommend that I use
phpunit --bootstrap src/autoload.php tests/MoneyTest
under command line
 
12:47 PM
@ziGi Yes, but stick all the the details about bootstrapping into the phpunit.xml file so the command line to run the tests is the same for all of your projects php vendor/bin/phpunit -c test/phpunit.xml
That way you don't need to remember the individual options for each project.
 
I seee
ok, thank you for the useful advices
 
/cc @ThW ^ anything I missed from conversation the other week?
 
@ziGi Because the phpunit documentation isn't great, here's an example config file pastebin.com/6t5Dinw4
 
ok I will take a look in a minute
 
@BenjaminGruenbaum +1, if only on the strength of the last line
 
12:51 PM
:D
 
Just erase all the answer text, but the last line — Alma Do 2 mins ago
:-p
 

« first day (1417 days earlier)      last day (3524 days later) »