« first day (1751 days earlier)      last day (3197 days later) » 

11:00 AM
@mindplay.dk ...
Are you even reading what I write?
The coverage of getters/setters is implied since when you test other things, you'll be using them
 
Yes. Am I missing something? There is no fourth option.
 
And if/when your getter/setter do more work than just fetching a property, you'd write a proper test for it anyway
Also, it's not "unsafe" when you don't care about undefined behavior, which I don't.
 
Not caring just means accepting that it's unsafe, so there.
I don't accept that :-)
I'm meticulous.
 
@mindplay.dk No, not caring just means not caring.
You can't account for every single case and edge case, not with what most companies pay you, anyway :P
 
it's passive acceptance.
 
11:03 AM
You don't test for every single case, and every single possible output variant
 
yeah, but you could account for a lot of shit if you had simple type-checking for free with zero effort.
 
Otherwise you'd have a million tests instead of 10,000
@mindplay.dk Strong typing detects a class of problems at compile time, but there's a different, HUGE case of problems that it doesn't detect, doesn't care about, and can only be solved with runtime means (such as tests)
 
@MadaraUchiha I'm not asking for strong typing, I'm asking for gradual typing - there is a huge difference.
 
The boilerplate most strongly typed languages introduce is not worth the added security, because, again, based on experience, the bugs I'm having are not type related bugs.
@mindplay.dk And I'll say again, I don't oppose optional type hinting
I just thing that PHP has worse to worry about and fix, before turning to stronger typing :)
 
gradually-typed languages are not verbose, look at Typescript or Dart for one.
public int $age
hardly verbose, is it?
and the value in terms of IDE support is indispensable.
 
11:07 AM
@mindplay.dk sigh it does get verbose when you start with objects and generics
 
@MadaraUchiha no, it does not. look at Typescript.
 
lol
How many languages exist with the suffix 'script'
Typescript, Coffeescript, Actionscript, JavaScript
 
@mindplay.dk Promise<Map<Object, List<function<Promise<int>>>>> $promise
 
@MadaraUchiha dang, is that beautiful code, Java?
 
11:09 AM
lol
default initial value for numbers is 1 in typescript?
 
or this - type safe even without defining a class.
 
Abe
@HassanAlthaf that's the line number. #fail
 
@HassanAlthaf what? no :-)
 
@mindplay.dk Oh... @Abe I see, the thing didnt load completely for me before, it just showed 1 on the right side
lol
 
It's the 2nd. Gotta submit to the CFP today
 
11:11 AM
That is not verbose, in fact it's identical to JS, it's just a shit ton safer.
 
@Andrea pls suggest void return type pls
y u quit
 
@HassanAlthaf I'd overwhelmed myself
 
Abe
why is void return type so important? don't get it :P
 
@HassanAlthaf I might bring it back, because it doesn't look like someone else will
@Abe useful if only for documentation
 
@Andrea yea others won't.
 
11:12 AM
4 mins ago, by Madara Uchiha
@mindplay.dk Promise<Map<Object, List<function<Promise<int>>>>> $promise
What do you do with that?
 
@Abe So that you don't have to look through the code to see whether it returns something or not?
 
I don't even know what that is.
 
@mindplay.dk It's a promise for a map between an object and a list of functions which accept a promise for an integer.
 
Abe
@HassanAlthaf but what would it actually return? null?
 
@Abe If its void, nothing.
 
11:14 AM
@MadaraUchiha but if that was a common type, in a Typescript program, you would give it a name do you don't need to repeat it. Likely you would want to compose that type of smaller sub-types to assign meaning to it though.
 
Abe
so it would prevent this from running returnsVoid() + 10 ?
 
dunno
never experimented
 
@mindplay.dk Do you code in Java?
 
@Andrea no… I'd rather have null being a return type….
 
11:14 AM
let me experiment naooo!
 
@MadaraUchiha besides, with gradual typing, nobody's forcing you to type-hint everything
 
Promise<Map<Object, List<function<Promise<int>>>>> promise = new Promise<Map<Object, List<function<Promise<int>>>>>(); // This type of line is very common in Java
@mindplay.dk We're arguing over different things here
 
@MadaraUchiha I'm not a fan of Java either :-)
@MadaraUchiha and yeah, that example is extremely verbose.
 
You're arguing that gradual typing is useful, and I argue that it's not useful enough to have priority over other important things that PHP needs to get together
Like named parameters, like consistent function naming, like fixing the convoluted contribution process
 
@Abe In Java, it looks like it doesn't return anything.
 
Abe
11:18 AM
in java i would expect a compile error
if you use a void function in an expression
 
2Mad
 
:-D
keyboard spaz
@MadaraUchiha none of those things are slowing me down. writing boilerplate day in and day out is.
 
Abe
@MadaraUchiha basically things that nobody gives a shit about :D
 
@Abe PHP is run and maintained by a very very exclusive club of people, and the entry bar is too high
Also, most different opinions are bashed on an obnoxious level, further discouraging people from participating
 
11:21 AM
@MadaraUchiha besides, PHP is gradually-typed - we have optional type-hints for parameters, and now for return-types, so the public part of objects is almost gradually-typed, we just need property type-hints. It's half-done. We're inching towards optional typing at like 5 year intervals. I wish they'd just go ahead and fucking finish what they started.
 
And last but not least, the mailing list system itself sucks.
 
@MadaraUchiha so true :-(
@MadaraUchiha internals is a great place to get your head bashed in and have your ideas trashed :-)
I left internals about a year ago - there is just no point.
still, since I'm stuck with PHP, I do care - for one, I'm working on an RFC for property type-hints.
 
Internals Rule #1: Don't get too engaged in discussions, speak up when needed.
 
@bwoebi heh, yeah, but then, why are you there in the first place? ;-)
 
@mindplay.dk to speak up when needed.
 
11:25 AM
@bwoebi I mean, why would you be there, except for one reason, you care about the language and you have ideas for improvements.
people come there with good intentions and get bashed the hell out of there.
I sort of get it though, everyone works for free, of course they're goint to get extremely attached to every idea and every line of code they contribute.
 
@mindplay.dk Yeah… never take it personal. And anyway, when long as you have no supporters, you just should give up.
 
PHP desperately needs a real organization, and somebody backing it with time and money and talent, to progress further.
 
Abe
@mindplay.dk isn't everything like that?
 
@mindplay.dk Why are you stuck with PHP?
 
@Abe yeah, but most things do not get where PHP is with no government, no incentive, no structure... and I'm not sure that's a good thing - people are suck deeply invested in something that cannot at all keep up with demand...
 
Abe
11:29 AM
@MadaraUchiha stfu. you are not one of us
 
@mindplay.dk sure. So learn to live with having your code rejected.You can't do OSS and have everything accepted.
 
Abe
:D
 
@bwoebi What makes that specific group of 40-50 people more qualified than the rest of the HUGE PHP community?
 
@MadaraUchiha good question. it's my job, for one - and, I can't honestly find a better alternative.
 
Why shouldn't the discussion be completely public?
@mindplay.dk You couldn't find a better alternative than PHP?
The only thing PHP is really good at is the low entry bar...
 
11:30 AM
@MadaraUchiha for language design? Not sure. Some do have more experience… but in general, no idea.
 
@MadaraUchiha lots of promising things have cropped up over the year, and I try everything (believe me) and everything has unacceptable shortcomings that makes PHP the lesser evil.
 
@mindplay.dk Meh
@bwoebi How many language designers are in that group?
People who have designed languages that they can boast at?
And regardless, whether or not a feature is requested/important is not really up to language designers
 
There just are some people having a deeper understanding of the engine. @MadaraUchiha … And these are definitely needed.
 
Language designers get a feature requirement, and it's their job to make the API be consistent/nice/whatever
@bwoebi And there are some people without a deeper understanding, but with a wider range of experience and viewpoint, whose feedback is critical.
You know what happens with small communities and inbreeding, right?
> Jack of all trades, but master of none, still a lot better than master of one.
 
@MadaraUchiha sure. Some of them are on internals, but yeah, a bit more people sometimes wouldn't be bad.
 
11:33 AM
@bwoebi We've had this discussion here not that long ago
That PHP's discussions would be a lot better should they be moved to GitHub issues
 
Gotta split. Nice chatting folks. Take care :-)
 
@MadaraUchiha yea…
 
Frankly, I'm amazed no one ever even brought it up in internals before
I mean, I'd probably have different complaints if it were to be raised and shot down, but how come no one even thought about bringing it up to begin with? :|
 
@MadaraUchiha no idea. But some people seem to think the mailing list were a great medium of communication.
 
@bwoebi They were
There are infinitely better alternatives today.
GH issues is almost 100% upwards compatible with the mailing list interface
 
11:37 AM
which they don't (want?) to realize.
 
@bwoebi That's because no one brought it up in the first place :P
 
morning
 
@MadaraUchiha bring it up on internals :-D
 
@bwoebi I don't care enough
It's your language, you do it.
 
lol
 
11:38 AM
Either they're all blissfully unaware (which I don't believe), or the environment in internals is so toxic that everyone who do care are too afraid of putting it up there due to it being shot down instantly.
That's the way I see it, anyway.
@bwoebi I've also heard arguments about having a higher entry bar being a good thing
Which is even worse :|
 
@MadaraUchiha sure. That's why someone who has nothing really to loose should put the stone rolling…
 
@bwoebi Can I start a thread without actively subscribing to the mailing list?
(If so, please post the email address I should post to here)
 
@MadaraUchiha I'm not sure. Never tried … Mail to internals@lists.php.net
 
3
A: Generate cryptographically secure random numbers in php

Salvador DaliQuick answer: In a new PHP7 there is a finally a support for a cryptographically secure pseudo-random integers. int random_int ( int $min , int $max ) Longer answer There is no perfect random number generator, and computers use pseudorandom number generator to create sequences that looks ...

I can't award my bounty for 18 hours :\
 
@bwoebi I wouldn't. That allows return ($foobar); where $foobar is NULL.
 
11:45 AM
@Andrea and that's an issue… because?
 
@bwoebi it's nonsensical
void functions don't return value
 
@Andrea because you don't do that. But it makes much sense with union types.
 
@bwoebi We can have nullables for that
I think void would be more familiar to people, anyway
 
@Andrea nullables are weird with unions IMHO ?Foo | Bar vs. more readable Foo | Bar | null
 
Hmm, yes, that's true
I'm still unsure about unions
The main benefit I can see is they fit some existing functions well
 
11:50 AM
@bwoebi I still don't like unions.
 
But they have downsides. They'd interact awkwardly with weak typing, and they're basically a crappy form of overloading.
Heck, they may not even be that useful. In order to handle the value you get, you need to switch() over its type anyway, so you could just throw an exception in the default: case
 
@Andrea not sure about the weak typing part yet, though. It'll need some conflict resolution strategy there, yes. … how would you specify union return types?
overloading is input… and the output?
 
you couldn't do that with a switch(), that's fair
 
@Andrea Also, I'm not sure if it's that way or if overloading is a crappy form of unions. It's bugging me a lot that overloading also needs conflict resolution strategies (like the most specific one … and then if equal a long list of rules… in Java).
Unions though all point to a same function and only would need a strategy for a few scalar types.
 
which one is more faster ? (just give me a number, 1 or 2 ?)
1. select * from table where id = $id;
2. seelct count(*) from table where id = $id;
 
11:56 AM
@Sajad count(*), obviously. 1. is fetching the all the matching rows to send…
 
@bwoebi I don't know english very well, just give me a number, 1 is faster or 2 ?
 
2 ^^
 
tnx
 
@Andrea also, something like a class implementing two interfaces… and there's two overloaded methods: one accepting the first interface, one the second. But what I really want is just having both interfaces handled. Yeah… what do I end up doing in e.g. Java? An explicit interface cast and calling twice… Do you like that?
 
11:59 AM
@bwoebi but you're doing something similar in PHP
 
@Andrea hmm?
 
@bwoebi Unions are the crapping thing. Your method / function should do exactly one thing, if you have something like if ($foo instanceof Bar), it's not doing one thing anymore.
 
you're accepting either then checking the type in the body
Also, dare I say it: if you want to accept two different things for the same parameter, maybe you should make two different functions instead.
 
@bwoebi Sure, it doesn't work without some explicit hint.
 
@kelunik "Sure" :-P
@Andrea yeah, maybe. I'm just bringing arguments.
 
12:02 PM
@bwoebi sent
 
… ok … got the mail.
 
Cheers, I'd probably get replies with the reply-alls, but if I don't let me know how it goes :P
 
@Andrea Same for return type hints. If you need union types, you should probably split the function into two separate functions.
 
@kelunik that, or you may want some sort of enumeration result
 
Abe
12:06 PM
these chaps at CNN are so smart
 
i.e. a union type/sum type (not quite the same as what bwoebi's suggesting)
enum HTTPResult {
      Response(string $body),
      Error(int $code)
};
for example
 
@MadaraUchiha yeah, you will… :-)
@Andrea Is that a bit comparable to a typedef'd union?
 
not quite, I think
int|float is only used for typechecking purposes. The actual value you'd get is an int or a float, the union doesn't really exist outside of the type signature
 
@Andrea yeah, that's an excellent examples. Maybe we'll get numeric once, but it still just is an implicit union… Question is whether we'll export the unions to userland or not…
 
@Andrea Well, float should automatically accept an int there, no need for a union type hint.
 
12:11 PM
@kelunik oh, it does. But it casts to float which may not be what you want.
 
@kelunik well, depends if you want to preserve the precision
 
@kelunik Also, if we'll ever have bigints, even more important.
 
Another way to put across how I feel is that I'd rather see foobar(DateTimeInterface $d) than foobar(DateTime|DateTimeImmutable $d)
 
@bwoebi Once we have them, then it's important, yes.
 
@bwoebi oh yeah, though I don't know if that'll actually happen
Certainly it's not going to happen for 7.x
 
12:14 PM
@Andrea Maybe you'll want to work on them again :-) … I believe you say no… but anyway, I think if someone brings up a solid bigint impl, it has good chances to pass.
 
@bwoebi Even if I do (or someone else does) work on it, I don't think you could nicely integrate it into 7.x
I think you'd have to do nasty things to maintain BC, and I don't like that
 
@Andrea yeah, I agree. But I think we could bring it in like in 2017 with 8.0
Once it's there, I don't believe it'll be too much work to merge that later in.
 
I might write a postmortem for that branch someday
There are some things any future attempt should do differently
 
@bwoebi I don't think we'll have 8.0 in 2017.
 
@kelunik If there are things needing a new major and people accept that new feature, it'll come.
@Andrea that's a very good idea.
 
12:22 PM
heh
 
no, seriously…
 
@Andrea why did you go for dropping rvalue usages instead of using an inline function?
 
@NikiC I wanted to maintain lvalue use
wait
oh.
 
@Andrea You can assign to an indexing operation on a function
 
right, it's a pointer, it's not going to be assigned to directly anyway
Andrea is silly.
fixes
 
12:34 PM
@Andrea In any case, nice work
Amazing that it works with so little change
 
^^
 
Did you run any perf tests yet?
 
@NikiC Yeah! Turns out most code actually uses the macros
@NikiC Nope, but I'll do some
 
@bwoebi "What wrong with <news://news.php.net/>?" ... He's joking, right?
 
@NikiC Actually, wait, no. I can't make that a function
Well, I can, but it still has to be an rvalue
Think about what happens otherwise ;)
 
12:44 PM
@Andrea what will happen? I don't see it ^^
 
@MadaraUchiha Unfortunately, I don't think so. "Furthermore participating requires a github.com registration whereas this medium is free to use." GitHub is also free to use. ^^
 
@kelunik Please respond
I'm not going to defend this notion any further
@bwoebi convinced me to set the rolling stone
I have, good luck :)
 
@NikiC the data isn't in what the pointer points to, it's in the pointer itself
so you'd be giving back a pointer into a dead stack frame of _zstr_val...
 
I'm not sure moving normal ML discussions to Github issues is a good idea. I thought this was about moving RFCs there
@Andrea Yeah, you're right
 
@NikiC Well... why not?
 
12:52 PM
I've noticed some places which will probably break because of this optimisation
 
How is PHP different from other projects of the same caliber, who do most if not all of their discussions in GitHub (or otherwise on issue trackers) and are greatly successful?
 
In particular, in a few places we just grab the ZSTR_VAL of some zend_string and stick it in a variable to use later, and assume that the string won't be deallocated or moved
 
@MadaraUchiha Because Github issues are a shitshow for normal issues, and would be even worse for heated debates like RFCs.
 
@Danack Because a mailing list is better?!
How many new users have joined the discussion in the past year?
 
My solution would be void zend_string_unpack(zend_string **str); or something
 
12:53 PM
Yes, it allows at least a primitive form of threading, whereas github has none.
 
@Danack WAT
 
@MadaraUchiha GitHub just lists everything chronologically
 
If I join today, I have exactly 0 threading on previous messages
 
Whereas a good email client can show replies as a tree (think reddit, Hacker News)
 
@Andrea No, that's news.php.net!
 
user3119231
12:54 PM
Am I stupid? :D
 
user3119231
if (!getDBData($username, $username)){
	global $db_host, $db_name, $db_user, $db_pass, $username, $password, $email;
	$db = new PDO("mysql: host=$db_host; dbname=$db_name; charset=utf8", "$db_user", "$db_pass");
	$query = $db->prepare("INSERT INTO user(username, password, email, role, creations, logins) VALUES(?, ?, ?, admin, 0, 0)");
	$query->execute(array($username, $password, $email));
	$db = null;
}
 
@MadaraUchiha Nope! Use the Newsgroup.
@MadaraUchiha The web interface.
 
@Andrea Yeah... doing things like putting a string from a zval into a local zend_string* variable and modifying it won't work anymore
 
user3119231
@MadaraUchiha is everywhere :D
 
You can't really treat strings as a pointer type anymore
 
12:55 PM
@NikiC oh yeah, that's a particularly bad case, hmm
 
@Andrea Yeah? Can you, by any chance respond or otherwise interact with the mailing list from said web interface?
 
dammit
 
Why can't things ever be simple
 
@MadaraUchiha The news.php.net you talked about is the web interface. But it's also a newsgroup server.
 
12:56 PM
@Andrea Have you visited it recently?
Awesome threading bro/sis :P
 
@MadaraUchiha I didn't say it had threading
You said it didn't, I agree
I'm saying newsgroup clients can support threading
 
@Andrea Oh, so now I have to download additional software too?
 
@MadaraUchiha Well, yeah, all webmail clients suck
You also need to download a browser to use the web
Or download an IRC client to chat on IRC...
 
@Andrea No, I don't. Any OS comes with a browser
 
@MadaraUchiha Yes, usually a bad one.
 
12:57 PM
Nobody uses local mail clients
 
@MadaraUchiha It has threading when viewed here: marc.info/?l=php-internals&m=143850642319675&w=2 It has threading when viewed in my email. And this is yet another discussion where you are being tedious with semantics.
 
OSes used to come with newsgroup clients
 
@Andrea You don't get my point.
 
@NikiC I do.
@MadaraUchiha what is your point?
 
@Danack I don't see threading there
 
12:58 PM
I have to download an additional piece of software just to participate on internals sanely
 
Threading as in hierarchy
 
@Andrea Except Gmail.
 
@NikiC prev in thread] [next in thread]
 
@kelunik Gmail also sucks
I've used it.
 
@Andrea Everything sucks
 
12:59 PM
Or the thread view: marc.info/?t=143835274500003&r=1&w=2 @NikiC
 
28 secs ago, by NikiC
Threading as in hierarchy
 
You just want to find the one that sucks the least.
 
@Danack How is that threading?!
 
@Andrea That's not right, there's kiwi or how that thing is called.
 
You get that kind of "threading" on issues as well
 
12:59 PM
@kelunik there are some web clients, they're not all that good
 

« first day (1751 days earlier)      last day (3197 days later) »