« first day (1495 days earlier)      last day (3453 days later) » 

6:01 PM
@DaveRandom I've improved the implementation.
But... we still have to decide what we want to do.
There are three obvious choices:
1) Accept that there are limitations with the current approach
2) Check covariance when a class is used, rather than defined
3) Switch to invariant return types.
 
Holy fuck this answerer is an idiot stackoverflow.com/a/27023666/508666
 
Since we last talked I have fixed a bug or two and cleaned up the code a bit; nothing major.
To move forward I need to write up the pros and cons of each approach and hit the list for their feedback.
Also note with a few more implementation changes we can narrow the limitations a bit more than we currently do.
 
@JoeWatkins You were concerned about to_int doing a whole function call, zpp parse etc. This performance issue can be mitigated by special-casing it to use an opcode later, like we do with intval, strlen etc. (look in zend_compile.c for "strlen")
 
They would take more work, such as using a three pass parser instead of our current two pass.
 
@NikiC Aha! Thanks.
@NikiC Are they any smaller still in PHP7?
@LeviMorrison Huh, why is it bonkers? try_int tries casting and returns NULL if it fails, it's used to try casting. to_int just casts and blows up if it fails, there's no trying. For to_int, do or do not, there is no try.
 
6:09 PM
@AndreaFaulds yes
php 7 removed a lot of indirection for objects
also, can I use reserved keywords as java class names? It seems to work, but I don't trust it
 
@NikiC By the way, it's weird that zend_function is tiny yet zend_class_entry is MASSIVE
 
@AndreaFaulds Because try_ should match up with a try {} block.
Like its very name would lead you to believe.
 
@DaveRandom They're not. I was just saying you can use cpp on anything, not just C/C++.
@LeviMorrison Huh?
 
If we have a variant that throws exceptions and one that doesn't, and we use the name try_ in one of those variants, you would think that try_ would match up with what you would call in a try block.
 
It matches up with what C# does, and the way I think about it.
 
6:12 PM
With all offense intended, I think it's bloody stupid.
 
I don't see why it'd match up with try {} catch {}.
 
try_ should match the try {} block.
It's very name implies the similarity.
But it's actually the other function that matches up with try?
What?
 
Well, no, it doesn't match with try. It tries for you.
to try twice would be weird.
 
Anyway, this just goes back again to what I've said earlier.
 
try { try(); } makes no sense.
try { to_int(); } does make sense.
 
6:13 PM
Just validate; don't cast.
 
@LeviMorrison DRY.
 
That's not an argument.
 
Why waste time doing the same thing twice?
The process needed to validate is the same one needed to cast.
 
But you are too caught up in that probably negligible difference to see the harm it causes.
 
@LeviMorrison What harm?
 
6:15 PM
Exactly, you don't see it.
 
@AndreaFaulds You need to add that to the RFC. Not because it's helpful, but we need more star wars quotes.
 
Your proposal is also harmful.
@Danack OK, one sec.
 
@LeviMorrison You could also think of it as the try_ version is doing the try/catch inside the function call, in which case it's correctly named.
 
@AndreaFaulds My proposal has less cognitive load and requires more work from the user.
That's not harmful.
 
@Danack Exactly.
 
6:17 PM
Pushing work to the user is often a good thing.
Convenience is the source of so many programming problems.
 
@LeviMorrison It's not in this case, as it defeats the RFC's purpose.
 
Look at ORM for **** sake.
 
This isn't trying to provide a perfect solution. It's trying to provide a similarly convenient, much safer alternative to (int) which is a very dangerous operator.
 
@AndreaFaulds It defeats your purposes for the RFC.
 
@LeviMorrison The purpose of the RFC, yes.
I know it has additional benefits.
 
6:19 PM
@LeviMorrison Yeah but you take it too far sometimes. Not just here but in Auryn as well. Yes I agree with you that your stance on writing code to bootstrap config is generally 'better', but stopping people from being able to put intelligence in the config class forces people to program a certain way...which is bad.
 
We don't need to_int. In fact, adding to_int I think would be a mistake.
We need to fix ext/filter.
 
Fixing ext/filter won't solve the problem this RFC sets out to solve.
 
Yes, it will.
 
hm
jpauli is serious about the preprocessor.
 
No, no it will not.
 
6:20 PM
not sure if it's a good thing.
 
@FlorianMargaine Maybe we can go all MSIE and have /* if ($foo) { } */
 
@AndreaFaulds What advantage does to_int() have over filter_var()?
1) It's shorter.
 
@LeviMorrison Convenience, and throwing an exception.
 
Uh
Throwing exceptions is bad; surely we've been over that enough?
 
It's not bad. It depends on the use-case.
 
6:22 PM
2) It actually works properly with objects (but this is just a bug in ext/filter)
So 2) should go away.
 
Throwing an exception means you can failsafe.
 
So we're back to just 1) it's shorter.
You can throw an exception from ext/filter. You aren't winning that battle.
I know I've complained about EVERYTHING you've tried to do with this RFC.
 
Maybe.
Being shorter is a benefit, though.
 
You are probably sick and tired of hearing from me.
 
Not really.
 
6:23 PM
But I keep bringing it up because I absolutely think you are making a mistake that will significantly impact PHP's future.
 
I get you thinking I'm making a mistake. But "significantly impact PHP's future"?
 
Yes, if strict typing happens.
 
Go on....
 
Also, why are you still sticking with 50%+1?
 
Because that's the current rules for RFCs?
 
6:26 PM
^
 
Stop thinking about what's allowed; we already know the project has horrible rules.
 
Oh. Ooh. I just had an idea, actually.
Call me crazy, but.
 
By doing 50%+1 you are saying that if 45% of people don't want it they get it anyway.
 
Are you familiar with JavaScript's use strict?
Or Perl's, even.
 
Yes (we even have an easter egg for it)
 
6:27 PM
$ php -r 'use strict;'
PHP Fatal error:  You seem to be trying to use a different language... in Command line code on line 1

Fatal error: You seem to be trying to use a different language... in Command line code on line 1
Heh.
Well, here's an idea: Add type hints, and make them loose by default, but strict from strict code.
 
If we already had production and development modes I'd probably say that's fine.
 
Rather than making the strictness optional from the API point of view (oh dear god no, strictly typed APIs mixed with non-strictly-typed APIs)... we make it optional from the user's point of view.
@LeviMorrison No, not an INI setting, and not a production/development thing.
A per-file thing.
 
@LeviMorrison Even when you're right you sometimes come across as a bit of a dick. This RFC does not change the language and it doesn't need 2/3 vote. If you want to change the rules on RFCs then go for it. And it's a change that you don't have to use if you don't want to - you're sounding like Lester in resisting change because you don't like it. Claiming it's significantly impact PHP is just completely over-reacting.
 
"use strict" is basically the same thing.
@Danack Surely you know me better than that.
 
Huh? Nobody turns it off during development and on in production or vice-versa.
 
6:30 PM
@AndreaFaulds It changes the mode based on a condition.
Just "where" is different
 
@LeviMorrison It's not conditional, though. It's a pragma.
 
@Danack Look, if you really care about PHP's future just use 2/3 on everything. It means that if the vote falls in the 50% - 66% range you have to convince more people the next time.
The only reason to do 50% is because you think it's more likely to get in.
 
@AndreaFaulds I just wondered what that was in reply too ... and not sure why we can't tell Stas
 
@LeviMorrison I know you mostly from interacting here - and sometimes you do appear to act in aggravating ways in order for you to get your way. It's just a couple of functions. It's not going to be terrible for PHP to have them. If they really do turn out to be bad, people can just not use them.
 
There's no selfish motive for me to say that.
 
6:32 PM
@JoeWatkins He's convinced that special-casing isn't an implementation detail and it becomes a "language change"
Despite opcodes inherently being an implementation detail, they're not in the spec and never will be
 
@Danack If 66% percent of us agree to make a mistake then shame on us. But if 45% warned and it was a mistake and we did it anyway? Shame on selfish RFC author.
 
@LeviMorrison Actually, the voting RFC doesn't necessarily give the author a choice
You could interpret it as non-language changes must be 50%+1
 
@LeviMorrison That would only work if there weren't some people who almost always vote no, without any regard for what is being discussed.
 
7 mins ago, by Levi Morrison
Stop thinking about what's allowed; we already know the project has horrible rules.
 
@FlorianMargaine crazy
 
6:35 PM
Seriously, what reservations do you have about making it a 2/3 vote?
 
you know many people are of the opinion that everything should be a 2/3 majority, me included ...
 
@LeviMorrison Why should I? I've never made something 2/3 which wasn't required to be. It is pandering to those opposed to it.
 
@AndreaFaulds That's not a reason. Give me a reason.
 
@LeviMorrison That is a reason.
 
You want 50% because you want it to pass and 50% gives you a better shot.
 
6:38 PM
For me - because it's a just a couple of functions. If adding function to PHP requires 2/3 vote then useful stuff will be rejected due just to bike-shedding, people not liking trivial stuff. And that's the point at which progress becomes almost impossible. And anyway it doesn't need to be justified. That's the current rules.
 
That's it.
 
Adding those functions changes how developers use exceptions though.
 
@Ja͢ck wat?
 
@LeviMorrison I wouldn't say I want 50%, I just don't see why I should up it to 2/3
Maybe we should hold a 50%+1 vote on whether to up it to 2/3? ^^
 
@AndreaFaulds 2/3 is better because it eliminates the possibility that 45% of people say no and it still passes.
Think about that.
 
6:39 PM
@LeviMorrison 50%+1 is better as it gives all votes equal weight, rather than privileging those opposed.
 
@Danack That seems to get brought up regularly… are there some people who almost always vote no?
 
@salathe Not really.
 
@AndreaFaulds Yes, but that means the author has to fight that much harder to get support.
 
There are a few conservatives, I suppose, but they don't vote against everything, they're just more cautious. There are some who always vote against BC breaks (Derick).
 
Usually that means improving the RFC, or changing it.
That's a good thing.
 
6:42 PM
@salathe I haven't done an analysis, so I may be casting aspersions, but stas + rasmus seem to vote no most of the time.
 
Rasmus doesn't even vote most of the time ...
 
And yeah, Derick votes against anything that breaks BC
 
he only really votes to stop bad things happening ...
 
@Danack Stas votes in favour of some things.
 
@AndreaFaulds it also means that near as makes no difference half of the voters can disagree with a change and they will be ignored, what's the point in asking people to vote if you're going to ignore them ?
 
6:45 PM
Anyway - the point was, requiring a 2/3 majority for just adding a couple of functions to the core library is a stupidly high hurdle.
 
I don't think it matters what the feature is ...
 
@Danack If 45% are against it why should it go in?
 
You're just repeating yourself.
 
But you haven't addressed it.
 
17 mins ago, by Danack
@LeviMorrison Even when you're right you sometimes come across as a bit of a dick. This RFC does not change the language and it doesn't need 2/3 vote. If you want to change the rules on RFCs then go for it. And it's a change that you don't have to use if you don't want to - you're sounding like Lester in resisting change because you don't like it. Claiming it's significantly impact PHP is just completely over-reacting.
We don't have to address it. We don't have to justify why we aren't following a different set of rules that you wish were in place.
We only have to follow the current rules.
But anyway:
2 mins ago, by Danack
Anyway - the point was, requiring a 2/3 majority for just adding a couple of functions to the core library is a stupidly high hurdle.
That's the reason.
 
6:47 PM
@Danack no it's not
 
Thank goodness someone else joined in here.
 
you're adding it to core, which means that it'll be there practically forever
if you can't get 2/3 of people to agree it should be there, then that's a problem
 
@LeviMorrison I tried ...
 
@JoeWatkins I know. Thank you, Joe.
 
Not when it's such a couple of small functions.....the maintenance burden is very small. If you think fixing ext/filter is the way to go, then fantastic. But I really don't see the problem with having these functions, and saying that it's "a mistake that will significantly impact PHP's future." is not realistic.
 
6:51 PM
Also, for what it's worth @LeviMorrison, we're getting strict typing anyway by the back door.
 
/laters
 
> I absolutely think you are making a mistake that will significantly impact PHP's future.
I did say outright that it is my opinion, not that it IS a mistake that WILL significantly impact PHP's future.
 
......
 
Er.
I don't see how that changes anything.
 
well hold on it isn't just a couple of functions, casts that are function calls are horrible, it will require engine changes on top of that to be reasonable, in addition it's another set of casting rules that don't really seem to be agreed upon ... I don't know about significant, but impact, sure ... it's not just a couple of functions and never ever is ...
 
6:53 PM
Casts as function calls is hardly a new idea... nor a bad one.
 
it's a bad one alright, in every measurable way ...
 
function ($int, $bool, $double) {

}

if i use these new cast functions, a call to that function can cost me 4 function calls ...
 
No, really, why? Functionally, there is no difference between operators and functions. Some languages have even unified them (Haskell, C++)
@JoeWatkins The conversion costs you anyway
 
@JoeWatkins Which is the same as doing the filtering through ext/filter?
 
6:56 PM
Also, it's not like you'll be doing the conversion more than once.
 
@AndreaFaulds sure but not four function calls, casts belong as operations, operators, and if we did introduce these new functions we would be mad not to special case them, and then we're not talking about functions that are self contained anymore ...
 
@JoeWatkins Sure, we could choose to add opcodes for them if we wanted, I suppose.
 
Hello
 
Though, wait, why are opcodes faster than normal function calls? Why should they be?
 
well we already have an opcode for casts, really you're talking about complicating that with a second set of rules for casting ...
 
6:58 PM
For a single-argument function, shouldn't it be just as fast?
Besides, I doubt performance is much of an issue...
 
experience tells us it isn't, why do you think we special case reading Z_STRLEN if a function call and opcode should perform in the same way ?
 
People already use filter_var, and that's slow.
@JoeWatkins Because we haven't optimised function calls enough.
 
I have built a simple php app which I was running till now with the inbuilt php dev server. I wanna put nginx in front of it now, what all should I consider? I can't find any article on google describing this.
 
For certain internal functions, I can't see why we should have to special-case them.
 
@AwalGarg What in specific are you looking for?
 
7:00 PM
May I ask a question related to laravel eloquent here?
 
@mpet You can ask - the chances of getting an answer are very low.
 
@mpet You may, but I doubt people will be able to help you
 
@Fabor Yes, but I rarely write blog posts.
 
@PeeHaa routing. wouldn't nginx respond to http://site:port/foo/bar/ with a 404? but the inbuilt server doesn't care for the request url so routing the requests was easy.
 
@Danack There is no any laravel related chatrooms here..
 
7:03 PM
@AwalGarg What do you expect / want instead of a 404?
 
@mpet there is a #laravel channel on freenode
 
@RonniSkansing thank you
 
@mpet np, feel free to ask here anyways another time. There might be a couple hidden laravel devs lurking or chances are someone else can spot a logical bug or etc.
 
@PeeHaa like presently when run with the inbuilt server, the index.php file checks the request url, matches a pattern, and responds accordingly. http://site:port/user/edit/ would point to editprofile.php, I can't understand how would the same code work with nginx :(
 
@AwalGarg So you want to route all requests to a single file?
 
7:06 PM
@PeeHaa I think that is how it should be done, but then, I have static files too...
 
location / {
    index index.php;
    try_files $uri /index.php?$args;
}
If a file does not exist it goes through your index.php file otherwise it just serves the file
 
ahh!
lemme try to understand all those words
 
Sure
 
@AndreaFaulds I'm not saying it's a bad idea by the way, just trying to point out that we're not really just talking about a couple of functions ... I think there is justification for wanting a 2/3 majority on every vote, but in particular here ...
 
@JoeWatkins But we are just talking about a couple of functions. If someone decides to special-case them later, that's all well and good, but it's not in the RFC.
 
7:10 PM
$uri refers to the request url, like we get it from the request_url thing in PHP, $args (TIL) refers to the ... arguments?
 
@JoeWatkins As the proposal currently stands, would you vote in favor of it?
 
@PeeHaa is it possible to dump the $args thing on a page?
 
forget special casing, what about the introduction of another set of casting rules into core ?
 
@AwalGarg $args is the querystring e.g. ?foo=bar&baz=qux
 
@NikiC Would you mind if I allowed whitespace and + signs?
 
7:12 PM
@NikiC I didn't know it was finished, there are a few things not making sense still ...
 
What about changing them to be the same as the current rules? I know it's not inline with the original design of the RFC but it would make it easier to comprehend.
 
I guess I understand now. I can continue from here.
 
When an email verification goes out with the long convoluted URLs --- what function is behind that?
 
@AndreaFaulds I wouldn't mind about +, but I'd mind about whitespace.
 
Thankyou so much @PeeHaa
 
7:13 PM
@AwalGarg No problem. Just ping me when you are stuck / need help
 
sure :)
 
@NikiC Hmm, why? I'm considering allowing it to make it closer to FILTER_VALIDATE_INT and because it'd possibly put people off using it
 
@AndreaFaulds If I want whitespace I'll just trim. Usually I don't want it.
 
I suppose it's all down to a judgement of how likely it is there'll be whitespace in your input.
away, shower
 
@AndreaFaulds Partially because it does things like unconditionally cast things to strings first. This is also a source of some of the confusing edge cases.
 
7:30 PM
@AndreaFaulds Btw, I'd really dispense with that string-cast indirection. I know it's a simple rule to follow, but the condition itself doesn't make much sense and the constraints resulting from it may not necessarily be optimal.
 
@PeeHaa if the request is on http(s)://sub.domain.com/, the $server_name would be sub.domain.com right? Or just domain.com?
 
server_name sub.domain.com someotherdomain.com foo.bar;
However you would like to access it you can add it
So if you only want to access it through subdomain it would be±
server_name sub.domain.com;
 
ahh I see.
 
@NikiC Right, I agree
@LeviMorrison I mean, it's slow as in it takes a function call
 
@AndreaFaulds Fine with me. Is this really a large concern?
I'm sure Dmitry would be concerned (he's always concerned about performance)
 
7:39 PM
@LeviMorrison @JoeWatkins cared, thus the mention
 
But definitely don't cast to string first.
 
Right.
 
so , how was the festival of stupid @DanLugg ? how long were you able to stand it ?
 
That's one of the critical things ext/filter does wrong.
 
@tereško I just kinda sat with my jaw open, possibly drooling a bit, trying to comprehend how people can pretend to try to comprehend things that don't even make sense.
 
7:46 PM
I think I must share this "knowledge" with others too: @crypticツ @PeeHaa @LeviMorrison @AndreaFaulds try watching this
=]
actually I found it by watching this playlist first: youtube.com/playlist?list=PLHLnw5-2vMBRvibTnTI89CaPt6M-WI0R4 (which is making fun of the one above)
 
@PeeHaa I figured everything, thanks for the help! Also, I saw I can add some more parameters to the nginx log format and tail it to see those parameters in realtime by making those requests from the browser.
which also helped me understanding some bits and pieces
Thanks again man!
 
@AwalGarg yw \o/
 
:D
 
warning, watching this might cause aneurysm
 
@AwalGarg what does your name mean
 
7:51 PM
@ziGi in hindi? Awal = The one who is always at the top. Garg is just a common last name of my birthplace, according to the caste system followed in India.
 
@tereško Ah spirit science. The bestest kind of science
 
you are the top guy of your family :D good, one, I was just wondering
 
> I know what MVC ist. There is NO stellar example for a good MVC. There are some MVC's that make your life easier with built in hardening of your code.
Gimme teh good MVCs plox!
I need more good MVCs!
 

« first day (1495 days earlier)      last day (3453 days later) »