« first day (2413 days earlier)      last day (2535 days later) » 

12:00 PM
heh
 
@RonniSkansing Hey
 
Plz don't ping people
 
@BrijeshDubey This is the third verbal warning you've received, and you were already kicked once.
I suggest you stop and think about how you want to proceed here.

Is Gordon a good developer?

yesterday, 2 minutes total – 29 messages, 5 users, 7 stars

Bookmarked 1 min ago by Madara Uchiha

8
cc @Jimbo @Gordon
Remember that there's a bookmarking feature to immortalize conversations? 😋
HA!
@tereško Check your rep
 
12:20 PM
hey
 
12:31 PM
> +500 55 mins ago removed How to implement 3rd party (user generated) products for In-App Purchases?
wtf?
 
@bwoebi One of the questions I've removed had a bounty awared on one of the answers by him
Apparently, deleting the question (and all its answers) refunded the bounty.
 
@MadaraUchiha but the bounty wasn't removed from the user?
 
@bwoebi That is an excellent question
 
so the system effectively generated 500 new rep points
@MadaraUchiha Are you going to raise it on meta?
 
@bwoebi Indeed looks like it
@bwoebi Not sure
It's a very specific case
I think you need a mod to reach that situation to begin with.
I'll raise it in the mods' chat though
 
12:36 PM
@MadaraUchiha so, doesn't happen on regular deletions?
 
I dunno, can you even delete a question with a bountied answer on it?
 
@MadaraUchiha I see no reason why I shouldn't be able to
 
I just found out there is a bounty for implementing generics in PHP
 
user6845426
hi guys :)
 
@brzuchal Yes, and they're still not implemented.
 
12:46 PM
@DaveRandom @kelunik @bwoebi has this warning been handled yet?
> PHP Warning: unpack(): Type n: not enough input, need 2, have 1 in D:\Web\AsyncTwitter\vendor\amphp\dns\lib\DefaultResolver.php on line 570
 
oh, huh
 
And no I cannot sanely repro it
 
Looks like maybe server doing something weird, need to see the network data in context really
I can't see any good reason for ending up with 1 byte of data there
but in any case, that routine has been totally rewritten
I will check it out though
 
That has also been a long standing issue for gitamp
 
So it is a message you see occasionally?
as in, you had it more than once?
 
12:50 PM
I don't think I have seen it before on my local twitter / win runs, but I have seen it a couple of times on gitamp
Yes
 
well, @MadaraUchiha, it went better than I expected :D
 
@PeeHaa those are all different issues though. That branch should only be hit at the start of a new response, seems odd that you'd get a single byte packet there
 
well, at least I got another 200-point day, for the badge
 
I'll make sure the buffering layer in the rewrite covers that possibility though
 
Yeah, we didn't know what how blew up
 
12:55 PM
Today in code review...
    private static function generate_nonce()
    {
        $mt = microtime();
        $rand = mt_rand();

        return md5($mt . $rand); // md5s look nicer than numbers
    }
 
That's also why we were / are waiting for a new version because it's blocking v1
 
@Leigh yeah, md5 is not secure, you should use sha1 instead
 
@Leigh It is certainly better than numbers.
 
@tereško Doesn't look as nice!
 
:D
 
12:57 PM
@PeeHaa I must say I find it odd that you get so many issues in gitamp when I've seen like 2 DNS-related issues in Jeeves ever
 
@kelunik it's even better now it returns bin2hex(random_bytes(16));
 
Well... sorry also one behalf of @Ekin?
 
feels like there may be something else at play, but the issues you are finding are genuine issues so I will just fix those first
 
:P
 
12:57 PM
@tereško yep, I'm reviewing the oauth usage in our app
 
@Leigh ...
Good thing it's not actually for security
But yea that get annoying when running any decently sized project
 
@kelunik because someone already noticed it and showed their face in it
 
1:04 PM
Work promised to unblock social sites.. still blocked.
Sigh :<
 
@Sean what sites?
 
@tereško Don't lie, it was all a scam to get +500.
 
@MadaraUchiha and you fell for my dastardly plan
 
Anonymous
you smell of dastardly @PeeHaa.
 
now, on to phase 83
 
1:09 PM
@JayIsTooCommon Oh yeah. Well. You smell like cheese
 
Anonymous
uncalled for.
 
Is there any point to set a real session handler, rather than just settings session.save_handler = memcached
session.save_path = "127.0.0.1:11211"
If we want memcache sessions?
Also, anyone recommend a memcache session handler from packagist?
 
@PeeHaa It's used incorrectly regardless :P
hence the review
 
Yeah nothing about those three lines make sense and is punch worthy and I don't even want to know what the rest looks like :P
 
1 2
which layout makes more sense? better ideas? (infrastructure/data implements stuff from all other layers)
 
@PeeHaa I mean aside from the library, this app is not using OAuth correctly
 
yeah guessed as much
:)
 
@PeeHaa Nice blog post blog.pieterhordijk.com/introduction-to-asynchronous-programming/… and animations. did you design the logo also :D
 
tnx :)
 
Basically using it as an over-complicated session creator, restricted to owners of particular API keys
sooo, need to v2 this shizzle
 
1:21 PM
And nope somebody from the html room remade the pornhub logo
 
Anonymous
Damn, does anyone know where to find (or modify) my Skype handle?
 
Anonymous
I created it some time ago, I think I have no username.
 
@PeeHaa When is your next part of the blog series ready?
 
Either next week or the week after that depending on time etc
 
Anonymous
you got some decent feedback on reddit
 
1:28 PM
Yeah
 
Anonymous
Nov 16 '14 at 14:06, by Andrea Faulds
So, /r/PHP is toxic as usual, why do I keep going there. Reddit is shit.
 
Anonymous
it's all coming true.
 
:P
 
user1804599
1:39 PM
How is the PHP interpreter loop tested?
 
user1804599
Through PHP examples?
 
@rightfold yes. There's not really any unit tests for the engine itself.
 
user1804599
Are all tests run by run-tests.php, or are there tests that are run differently?
 
Just the behaviour of it.
 
user1804599
OK!
 
user1804599
1:41 PM
Thanks!
 
@tereško FB, twitter, linkedin (specifically their CDNs), few other bits and bobs
PieterHub
 
Hi Folks! I have CSV file with 3 columns and I want to explode it by EOL

function arrayFromCsv($url)
{

$csvData = file_get_contents($url);

$lines = explode(PHP_EOL, $csvData);
$csv = array();
foreach ($lines as $key => $line) {
$csv[] = str_getcsv($line, ';');
}

return $csv;
}


$csv = arrayFromCsv('http://urltocsv.csv');
echo "<pre>";
print_r($csv);
echo "</pre>";

--------------------------------
It is returning something like this

[0] => Array
(
[0] => 1102
[1] => TOALETKA 1102 ANTYCZNA CZERE�NIA
Oh sorry, I changed the values 1102 to 110AAS33 etc but I meant the same values, I forgot to change before post :)
 
1:56 PM
@Vamsi The scary thing is there are still sites out there running PHP 3
 
2:30 PM
@ErykWróbel $csv = array_map(function($line) { return array_combine(['ref','name','status'], $line); }, $csv);
// or this if you don't like map/callback
const CSV_KEYS = ['ref', 'name', 'status'];
foreach ($csv as &$line) {
	$line = array_combine(CSV_KEYS, array_slice($line, 0, count(CSV_KEYS)));
}
 
strtotime() does not define behaviour of h/m/s when passed only a date – #74652
 
hi, I have just built a php with debug enabled. Without installing it, I want to build my extension, pointing to this php instead of the installed php in the system. How should I set that up with ./configure
 
3:00 PM
Evenin
 
3:17 PM
@PeeHaa I must be the only one in here not recognizing it as the pornhub logo …
 
Anonymous
@bwoebi that's because you're weird :)
 
@JayIsTooCommon let's not talk about your weirdness…
 
Anonymous
I'm perfectly normal
 
Anonymous
inb4 the obvious s/ly normal/
 
3:20 PM
o/
 
Anonymous
yo felux
 
evenings o/
 
@Danack I really would not recommend memcache for sessions. A previous company, nowhere near max memory, memcache settings were fine, memory was randomly getting corrupted and user's would see another company's data. Switched to DB and everything was fine again
 
@Jimbo Just use Redis instead. :P
 
3:40 PM
I just might use Redis.
Oct 29 '14 at 17:17, by DaveRandom
@Danack and Redis, sitting in a tree, c-a-c-h-i-n-g
 
memory getting randomly corrupted sounds weird. Surely it's more likely the problem was more simple - probably conflicting cache keys
 
Or the extension being crap.
 
possibly both
IIRC the extension silently chops cache keys to 255 chars
(or something like that)
 
Anonymous
4:02 PM
@Danack @DaveRandom You used to be funny?? what happened?
 
4:19 PM
@JayIsTooCommon he still is, are you blind?
 
Anonymous
@bwoebi brilliant
 
ah, yes, the "kill all, who are not vegans" chick
 
Anonymous
Everyone is just trying to force everyone else to think the same way as they do.
 
Anonymous
 
4:31 PM
it's more like "we are offended as hell"
 
Anonymous
 
Anonymous
So that just happened to me.
 
Anonymous
@littlepootis she just needs a nice warm glass of milk :(
 
@samayo I wonder, will it be a banking scam or an infected file
@JayIsTooCommon that would be racist (if you have not heard it yet)
 
Anonymous
oh no..
 
4:35 PM
@samayo Is she trying to sell you her gold medals?
 
Anonymous
More like a math course
 
you jsut need to send a photo of your credit card
 
Anonymous
That's a real guy btw, it's not a bot
 
hi, does anyone know how to build an extension for a php that is locally compiled, but not installed in the system.
 
4:52 PM
do opinions ... if you agree with me
if you don't, just stay quiet, can't be bothered to argue
 
@JoeWatkins I don't care much, but I don't see a good reason why not merge that.
 
the root problem is not ours
 
@JoeWatkins right, we should be consistent between our own docs and code though (i.e. what you get back through reflection).
I don't agree with the argument that one should always use the same capitalization than the original, but I agree with the argument of consistency within our own docs and code.
 
believe the docs mention that we treat methods names case insensitively :)
 
we do - when functions are being called.
@JoeWatkins but that doesn't matter - I'm only saying that we shall document our functions under the names they report themselves to have.
 
5:02 PM
I don't see that there is any value in phpstan raising the warning in the first place, if there is value and parity between docs and code is important, then obviously the docs should be the target of the change ... but if we start breaking links that have worked forever in docnet, it will piss people off ... therefore, there is nothing we can or should do ... the important question is why is phpstan raising a totally pointless warning
 
@JoeWatkins our documentation links are case insensitive too - it won't break anything to fix docs here.
 
didn't know that
so target the docs, but changing code makes no sense, and I have a feeling it's going to open a can of worms to do anything ...
are they case insensitive in every format ? some applications embed chm docs
or used too, not applications I use any more ...
 
@JoeWatkins I'm fine with not changing code.
 
Yes, better fix docs than code.
 
@JoeWatkins yeah, they're normalized to case insensitive with lowercase, underscores to dashes etc.
 
5:06 PM
I still can't get my head around my we need to change anything really ...
if nobody cares what case you use, not docs, not engine, then why do we need to do anything ? and why is phpstan telling you about it in the first place
 
@JoeWatkins Ignore phpstan
I'm just saying that it should be consistent in the first place.
 
I can't bring myself to call it inconsistent ... it doesn't matter, it's unimportant is what it is ...
 
@JoeWatkins It doesn't matter to you - that's your good right. Would it matter to you if it were consistent either? No. So, just ignore it and defer it to someone else.
 
I don't mean it doesn't matter to me, I mean it doesn't matter to php what case you use, or the documentation ...
 
@JoeWatkins if it doesn't matter - why not just change it in order to shut the people up to whom it matters?
 
5:11 PM
You spent more time discussing this now than it needs fixing.
 
because can of worms ... the way I see it a third party is raising a pointless warning, we could change the code to provide legitimacy to the warning, and open the door to an infinitely long list of such pointless changes, or we can shut the door and say deal with it elsewhere ...
 
7 mins ago, by kelunik
Yes, better fix docs than code.
 
yeah, sure ...
 
@JoeWatkins As said, I agree that the code shall not be altered…
@kelunik Maybe, but it's important to argue about what to do about things you don't think matter (in the meta-sense).
 
that's a really stupid thing to say by the way ... if we used that as a principle to develop software, our software would not be very good ... "if a patch takes less time to merge than discuss, then ship it" ... stupid ...
 
5:17 PM
@JoeWatkins If there are only do it and doesn't matter to me voices, then I don't see any reason to discuss why it does / doesn't matter.
 
right.
 
I'm not that comfortable acting unilaterally on these things ... so was looking for some validation or argument ...
also, this is the longest conversation I've had for 9 days ...
 
evenin
 
@JoeWatkins … since you being circumcised?
 
5:24 PM
yeah
longest I been able to sit at the desk actually ... am uncomfortable still, but can cope with less pain killers ... feel a bit more alert ...
 
@JoeWatkins How long until you feel comfortably enough to focus a bit on mind intensive tasks?
 
hopefully not long, maybe a few more days
I guess the doctor was expecting it to last two weeks ... got enough for two weeks at the prescribed dose
 
I never imagined that to be so painful…
But great to see that it's improving :-)
 
I guess it wasn't so straight forawrd ... before they only mentioned paracetamol and ibuprofen as pain relief ...
then sent me home with tramadol, which is opioid ...
 
umm. ok.
 
5:36 PM
someone know if cpanel is compatible with hhvm?
also how I can use a ip insted of a nameserver?
 
!!?cpanel hhvm
 
yes
in replacement for php
 
> We have no immediate plans to add HHVM support.
also, hhvm is pretty pointless ...
 
looks they wont support it for while
 
@JoeWatkins you missed a whitespace behind the ? I guess
 
5:45 PM
can i use the vps ip insted of the nameserver to point domains ?
 
!!help
!!uptime
grml.
 
Would it be possible to parse such syntax using current PHP's type of parser:
<?php
class Foo {
    public static function bar() : Bar { return new Bar(); }
    public function baz() : Baz { return new Baz(); }
}
class Bar {}
class Baz {}

$foos = [new Foo(), new Foo(), new Foo()];

// short syntax
$bars = array_map({Foo::bar}, $foos);
$bazs = array_map({Foo->baz}, $foos);

// the same as
$bars = array_map(function() { return Foo::bar(); }, $foos);
$bazs = array_map(function(Foo $foo) { return $foo->baz(); }, $foos);
 
XPS 15 arrived
time to nuke Windows :D
 
I wan't to parse those lines with short syntax would it be possible?
 
@brzuchal well, it will conflict with general braces syntax.
 
5:50 PM
shit
@bwoebi so there is no way for that? any workaround ?
 
@brzuchal use another synta
x
 
@NikiC Sorry if I misrepresented your opinion on the PHP namespace at all in my latest email to Internals.
@brzuchal Nope!
The reason is {Foo::Bar} would be an expr and we simultaneously allow stand-alone blocks.
 
@LeviMorrison I see, thx
It's ruining my whole idea :/
 
This may not quite accurate; it may be doable but you have to distinguish between exprs and exprs that are used at the top-level. Not a fun exercise.
Given that we don't have block scopes we shouldn't have allowed arbitrary blocks since they don't do anything but oh well ^_^
 
So if I understand it right if given context is assigment or argument passing this might be doable, yes?
 
5:54 PM
@brzuchal That doesn't really help you because parameters can be any expr.
 
@LeviMorrison even stand-alone block?
 
Well... I suppose if you wanted them to be literals only (never used in a sub-expression) then it might work.
 
@LeviMorrison But blocks require a semicolon after statements in there?
 
@brzuchal The trouble is sub-expressions.
@kelunik In our current grammar class this doesn't matter.
 
@LeviMorrison What exactly do you mean? Some example?
 
5:56 PM
@kelunik we do not have enough lookahead to determine that.
 
foo( ({Foo::Bar}) )
^ Wrapping it in parenthesis puts you into general expr land again.
 
Could it be considered the same way? When in context of assigment?
Ahh
 
@brzuchal anyway, I think your idea is trying to solve a too specific use case.
 
@bwoebi I think this might also work with simple functions as well, for eg. $fn = {Userland\somefunc}; array_map($fn, [...])
It would be more friendly in refactoring, because you're not passing function name or 'User::bar' as a string etc.
It would be something like create closure using FQN
@bwoebi WOuld it be then also too specific use case?
 
You're essentially trying some new callable syntax, right?
In that case with the first parameter being the $this of a callable instead of the first arg to a function call
 
6:06 PM
I was rather thinking about new syntax for creating closure from existing functions/static methods/methods
Then I could simply just bind $this into this syntax like $foo = new Foo(); $resuld = {User->bar}->bindTo($foo);
 
@brzuchal well, I'd love to see short closures (fn($a) => $a->foo) and a short callable syntax for FQNs (e.g. fn(strlen))
to be honest, something like {...} looks too magic and not verbose enough to me.
 
@bwoebi you could get used to! right? from all inconsistencies PHP is consistently inconsistent so there are many weird things in PHP, well I'm also known from founding weird things also :)
 
@brzuchal the most things you commonly use are not that weird though.
Yes, I got used to $$varvars, but they're still dark magic, and the syntax underlines it, just as an example.
 
Short closures syntax would be ambigous IMO if you could write fn(strlen) then that would be weird.
 
@brzuchal why would that be weird?
 
6:13 PM
Becaus emost of the time it would be used like fn($var) => $var *2;
I mean like a real shorthand
 
@brzuchal fn(strlen) looks short enough to me
@brzuchal I do not want symbol gibberish-like shorthands
 
github.com/amphp/amp/commit/… changes the php-cs-fixer runtime from 40 to less than 4 seconds...
 
@bwoebi Yes but it also look ambigous to syntax with arguments, normal functions have arguments in parenthesis function(int $no) {} and the short syntax for this like fn(int $no)... looks quite intuitive to gues what would happen. Which I cannot tell about fn(UserLand\somefn) that gives me nothing about types and arguments
 
@brzuchal well, the definition is where the function UserLand\somefn was defined
 
6:30 PM
Yes, so it'll need to be loaded to check types at compile time? Correct me if' i'm wrong
 
6:46 PM
@brzuchal if you want compile-time type checking, yes. No way around that. But in PHP we've traditionally not done compile-time checking, so not so much an issue
 
Hi I am downloading pdf in php, I want to show the html display after initiate download
How can I reset the pdf download headers
 
@brzuchal I'd go for UserLand\somefn::function instead.
 
I just think that syntax with arguments one time and another time with function FQN would be ambigous
 
`
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $name . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($attachment));
ob_clean();
flush();
readfile($attachment);
`
It just downloads pdf
 
@Gowri you first show the the the page and then redirect to "attachment" link
 
6:49 PM
@kelunik Yes, but that is ambigous with class constants, and function in namespace FQN would be ambigous with namespaced constant also
 
@brzuchal As is ::class. Just reserve it.
 
@kelunik I'd expect something like that giving a string repr and doesn't work well on methods.
 
ahhh function
 
@bwoebi Yes, and that's all that's required, no?
 
@kelunik but that would work only for functions, not methods
Using braces syntac could cover all of them like $fns = [{strtolower}, {UserLand\somefn}, {User->getId}, {User::getInstance}];
 
6:52 PM
@brzuchal For methods it could be $obj::method::methodname;
 
too many :
 
@brzuchal How do you want to solve the ambiguity problem with namespaced functions? strtolower could be the namespaced one or the global one.
@brzuchal Should probably be $user->getId?
 
@kelunik No, the closure which produces this syntax woul not be binded into any object
methods belongs to the classes
/afk now
 
@brzuchal Oh, you want that to return a closure instead of a simple string representation?
@brzuchal An instance method should be bound by default for a callable syntax IMO.
 
@kelunik yes I want closures
 
7:10 PM
@kelunik that looks gruesome…
@kelunik and that too, ideally
 
@kelunik Not if you wanna use it to map whole collection of same class instances
 
@LeviMorrison I found the post, news.php.net/php.internals/98225 in case you want to pursue the point. And that guy seems to be good at blowing off arguments he doesn't like.
As he replied to Nikic on exactly that point when it was made in Feb.
sick burn wikipedia https://t.co/4g0gtmKjoW
 
@brzuchal Do you have a real use example for that?
 
@kelunik most of monads
When doing for eg. flatMap call
 
@brzuchal Then just use ->bindTo(null) in these cases.
I don't want to bind everything manually like in JS. Methods should be bound automatically.
 
7:23 PM
If we had unified tables this would be so much nicer ^_^
$obj->method <- bound, obviously
Class::method <- not bound, obviously
 
@kelunik No, that's not the point, doing flatMap call you can chain calls then like, for eg. with proposed sytnax Option::of([new User, new User, new User])->flatMap({User->getProfile})->flatMap({UserProfile->getAddress})->flatMap‌​({UserAddress->getPostcode}) and you should get all those 3 users postcodes :)
If it has a profile, and if it has an address
 
@brzuchal TBH; it feels easier to read just three imperative instructions instead of three subsequent mappings
i.e. apply a, b and c to array vs. apply a to array, then apply b to array, then apply c to array
 
@bwoebi it depends, if you preffer imperative over functional because there are also many functional preffering instructions developers (it may be not English correct)
 
@brzuchal I like functional, but I'd try to not make three array ops with each one op on the values, but one array op and three ops on the values
 
I mean, there are also functional developers, which preffer this way instead of imperative way, and why PHP could not fit to both otf their needs?
I know from one of them that they complain about loong closures syntax they need to write right now
 
7:40 PM
@brzuchal yeah, I would like to see the short closures too
But I'd like to see these first, before deciding on whether we need even more compaction.
 
I'd like to see them too, also generics and enums... :/
Also class scopes and inner classes and assemblies :/
There are so many things I'd like to see in PHP
 
@brzuchal class scopes? assemblies? what are these?
 
Private and protected classes whichare not accessible through other namespace
Assembly is as I see them are like bounded context for a namespace where only public api is accessible outside.
 
8:15 PM
It's one of those days where I'm repeatedly going, "why the fuck did I do that"
I have a massive list for people who have editing rights to the website, and the way I organized it is a fucking cluster fuck
 
8:28 PM
@brzuchal I don't have a problem with having that additionally.
 
8:43 PM
yay .. wrote another tablecloth about mvc
I really should stop doing that
anyway, is anything interesting going on?
 
tablecloth?
 
I was trying to translate a latvian idiom
 
ahhh
really long comment?
 
I think the international term is "wall of text"
 
Ahhhh
tablecloth sounds funnier
 
8:49 PM
> for large values of small
<3
 
Guys, can someone improve this fucking logic?
if( isset( $_GET['u'] ) && ( $_GET['u'] == 'true' || $_GET['u'] == 'false' ) ){
	if( isset($_COOKIE['qanda_unanswered_status']) ) {
		if ( $_COOKIE['qanda_unanswered_status'] != $_GET['u'] ){
			setcookie("qanda_unanswered_status", $_GET['u'], 2147483647);
		}
	} else {
		setcookie("qanda_unanswered_status", $_GET['u'], 2147483647);
	}
}
 
well, those cookies are both the same
 
yes .. what's wrong?
 
you could use &&
 
so, you would only need to make a condition that covers isset($_COOKIE['qanda_unanswered_status']) && !($_COOKIE['qanda_unanswered_status'] != $_GET['u']) which would be the condition when not to set cookie
 
8:55 PM
so you lose an extra if statement
 
@Tiffany nope!
@tereško oh, got it. I guess you are right
emm I don't know, its late and my brain doesn't work as well
 
I was too lazy to write what @tereško wrote, but that was what I was getting at
 
@Shafizadeh did you take formal logic in university ?
 
ah .. thx then
 
you basically have A && !B as a condition when not set cookie
so you just need to invert it
 
8:58 PM
@tereško is that supposed to be such a book?
 
yes
I'd offer to ship you my formal logic book, but it's shit
 
the "negation" of A & !B should be !A || B
 
Teacher would lecture on stuff and assign homework, and the homework had nothing to do with what he lectured on
 
then not with "formal logic" name .. but I've passed a similar lesson in university
@tereško yes, true
 
@Shafizadeh can you access amazon?
 

« first day (2413 days earlier)      last day (2535 days later) »