« first day (2607 days earlier)      last day (2357 days later) » 

Wes
4:00 PM
@LeviMorrison i have no opinion.. doing blue sky thinking
 
Wes
i don't like anything duck-typed though
 
function copy{{ from: Collection $a, to: Collection $b} $struct);
It has the relevant information without extra.
(Well, you may not care about the entire object so $struct should be permitted to be omitted)
 
Wes
then how you distinguish an object from a class?
 
@Wes If you care about the class then throw it in front.
But for this example it makes no sense to care about it.
 
Wes
4:03 PM
$baz = new Foo();
assert(new {Foo $foo = use $baz; } instanceof {Foo $foo});
 
Stop this use stuff. You are causing me pain, man.
 
Wes
i though you disliked lexical context... also for closures :P
assert(new {Foo $foo = $baz; } instanceof {Foo $foo});
 
I don't even know what you are trying to do.
You can't have typed properties at the moment.
That part only makes sense on destructuring, not construction.
 
Wes
i'm saying that class declaration and anonymous objects should have two different syntaxes
 
$o = { from: $a, to: $b };

// same as:
$o = new StdClass();
$o->from = $a;
$o->to = $b;
 
Wes
4:07 PM
$class = {Foo $foo; }; // declaration
$object = new{ Foo $foo = new Foo(); }; // declaration + new
assert($object instanceof $class);
 
Should work on any class which does not have a constructor by adding the class name before the opening brace.
@Wes No, that's a syntax error. Unexpected T_STRING 'Foo' on line 1.
 
Wes
i feel being trolled
 
Look at my example.
Do you understand what's going on?
 
Wes
you are focusing only on the short syntax
 
That's not a short syntax.
It would work on any type which does not have a constructor:
 
Wes
4:11 PM
$class = {Foo $foo; }; // CLASS declaration
$object = new{ Foo $foo = new Foo(); }; // declaration + new
assert($object instanceof $class);
 
class MyRecord {
    public $name;
}
$o = MyRecord{ 'name': $name };
 
Wes
yes, that, now imagine how it should be if the class were anonymous rather than named
 
lol
 
Wes
$class = {int $foo = 123; }; // declaration
$object = new $class; // new
assert($object instanceof $class);
 
4:12 PM
There's no value in an anonymous struct to be defined with all that arcana.
 
ya
@Wes You just invented a very roundabout way to declare a named class
 
Which is worse in every way, seriously.
 
Just using $class instead of the name
 
The problem with that is, how am I as a developer going to easily ascertain what I need to pass to create the object?
 
Wes
similarly
$class = function(int, int):Foo;
$object = function(int $a, int $b): Foo{ new Foo(); };
assert($object instanceof $class);
 
4:14 PM
Initialisers exist for multiple reasons, one of them is for dev understanding
 
Wes
forget for a second about named parameters @LeviMorrison
 
Anyway, @NikiC, what do you think about object literals + pattern matching instead of named parameters?
 
@LeviMorrison I like the idea of (named) object lierals at least
 
Obviously pattern matching would have other use cases than just filling the named parameter niche.
 
I don't think it's quite a substitute for named params though
 
Wes
4:15 PM
bah.
 
@LeviMorrison The named params use case is also kind of preconditioned on having typed properties first
 
Consider how swift does it. You have 'external' parameters and an internal one if you like... var x = OurObject(namedParam: "param") and the signature is init(namedParam internalParam: String) { /** Use internal param here **/ }
 
@NikiC Oh? How so?
 
@LeviMorrison You'd still like to have type declarations right?
Ah, you mean you want to handle that as part of the destructuring
 
15 mins ago, by Levi Morrison
function copy{{ from: Collection $a, to: Collection $b} $struct);
 
4:16 PM
Would be kinda asymmetric
 
I imagine that just means that the property is at this moment a Collection.
Just like we do with all other type-checks.
Also, this would change how we represent arginfos and so does generics, so while I have you here, @NikiC: how do you think we should represent the arginfo for this: function (): Foo<string>
 
@LeviMorrison runtime arginfo?
I'd say extra flag in the type_info, in which case it's interpreted as a pointer to a separately allocated structure
 
@NikiC Do we have any more room in zend_type?
No other flag space.
Actually... isn't there guaranteed padding there?
At the end of the struct? Even on 32 bit platforms?
 
evening room
 
\o
 
4:26 PM
o/
 
Instanceof unsearchable – #75634
 
@LeviMorrison I see one bit used for null. Should still be one free?
 
4:45 PM
What's the point of a 'PUT' request?
 
Anonymous
3994
Q: PUT vs. POST in REST

alexAccording to the HTTP/1.1 Spec: The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line In other words, POST is used to create. The PUT method requests tha...

 
@JennaSloan generally, people use PUT for idempotent stuff, while POST isn't.
 
Well, I just watched an interesting video on idempotency, cows, and REST APIs, but I still can't think of a time there I'll ever actually use PUT.
 
Depends on the context, as always
 
@JennaSloan A really good case where I use put is like a profile image.
example.com/user/1/profileImage. There will only ever be one, and I always know exactly where it's at...so if I ever add or change a profile image there's no use in differentiating between POST and PUT. I can just always send PUT.
 
5:03 PM
Lol, scheduled task monitoring looking almost like a pulse.
 
That first one is pretty dang close.
 
@Sean pulse of that box probably?
 
you guys use xdebug or phpdbg with phpstorm?
 
the former, mostly
 
Always used xdebug, not tried dbg
 
5:10 PM
@FélixGagnon-Grenier apparently the hooks for phpdbg to work with PhPStOrM haven't been done yet.....so Xdebug.
Nov 15 at 8:13, by Joe Watkins
it emerged from the whole drama ... when we committed a protocol of our own, the shit hit the fan ... the only protocol we can reasonably expect to be able to commit to php-src is one based on dbgp ... in conversations we had since then with phpstorm people, they made it pretty clear they don't really want to invest time in a brand new protocol either but would have done it, if the demand was there ...
 
hmmmmmmmmmmm
 
Hello guys
I am a Wordpress Developer. I want to dig in to PHP framework. Which framework is best to start ?
 
@NikiC I think there are actually 0x1fff - a few bits free.
 
Thanks
 
5:15 PM
Wait, never mind. Conflated two concepts
If it's a pointer then the other bit may be unused.
We'd just need to shift things slightly differently, I think.
 
But i have a confusion between Laravel, CI and Yii
 
@JennaSloan Create a new resource or update a resource in its entirety.
 
@Ranjit I'd recommend either Laravel, or Slim ....CI and Yii should probably be avoided.
 
Thank you @Danack
Can you give me some tutorial urls ?
Which are best to start
 
just google for Laravel ones.
 
5:23 PM
Thanks again
 
mm... I drew something today \o/
 
morning
\o
 
it's really bad, but here goes: imgur.com/a/mPYSo
@Wes what do you thing ^^
 
Wes
too much animes
 
@SaitamaSama Did you draw it yourself?
 
Wes
5:31 PM
AHAH i knew it
 
@mega6382 yeah... :D
 
Wes
i wrote that before i clicked it :P
 
:P
 
:P
I just can't make sense of the nose, otherwise its good.
 
Wes
5:35 PM
sketchtoy.com/38386041 beat my american-style cartoons
3
 
@Wes late to the party, @DaveRandom is correct, regardless of version srand will cause rand to produce the same output for the same seed on identical platforms
 
@Wes hahha
 
Wes
 
i miss those elephants
 
@DaveRandom Any idea why reading from STDIN fails any subsequent fwrite calls to STDOUT for child processes on Windows?
 
Wes
5:44 PM
@SaitamaSama seriously, it's good. but do something else please :B
 
:P thanks, and I'd try to
 
@NikiC From their commits:
> Add support for inout annotations in first-class function (closure) types. We require 'inout' to appear at both the definition and call sites, and the type checker needs to track the inout-ness of a parameter to enforce that it is used in a sound way.
Odd it is required at call site.
 
Why?
It's the same as ref/out in c# basically
ref being the equivalent of inout here
 
I don't use C#. I have no experience there.
C# really requires the out keyword at the call site?
 
yes
which imho is very reasonable
 
5:56 PM
For C#, maybe.
 
it's a big change in calling semantics
 
It's not a dynamic, interpreted programming language.
 
@LeviMorrison I think it also makes sense in PHP, which is why wiki.php.net/rfc/explicit_send_by_ref
 
@mega6382 d8^)
 
Oh, I am totally fine with allowing & at the call site for clarity and ensuring that it is taking it by ref.
I just thought it was optional in C# and whatnot. Didn't realize it was required.
 
5:58 PM
@LeviMorrison I think we should require it, it's just not feasible at this point
 
Anyway, how would out work in PHP? Defining a variable gives it a value, so...
 
@LeviMorrison basically in the way that ref arguments work now, just without the reference part ^^
 
The reason requiring out or ref or something at the callsite is disappointing is that it is ruins migration.
 
and i guess with only the ability to write to it, in the case of out
 
array_pop(inout $data)
Having to write that would be a major, major BC break.
 
6:00 PM
@Danack Did you meant to tag me?
 
Swift does not require anything at the calling site, FYI.
(well, as long as it's a reference already)
 
@LeviMorrison that's the difference then
e.g. in rust you also need the explicit &, unless it's already a reference
but that just doesn't make sense in php, as our references don't work in that way
 
Yeah.
 
@Wes lot of chatter on bugtracker about that narrowing bug which I didn't bother to report and others later did =oP It could have been my first valid bug =o(
 
Anyway Swift uses inout on the declaration but & at the calling site, in effect
So as long as array_pop(&$array) works if we changed the underlying definition from a ref to inout then it should be fine...
 
Wes
6:04 PM
@crypticツ what bug? sorry, forgot about it :B
 
Of course that's not even allowed today, which was a mistake and your RFC makes total sense.
 
OK, so will syntax like this be mandatory inc(&$i); or just allowed?
 
Wes
i remember actually something. what was it? some static analysis tool?
 
@mega6382 Currently it's not even permitted. We are talking about making it optional because that's far more sane.
 
Wes
6:05 PM
oh yeah now i remember
 
is 20 columns too much?
 
Seems someone found a bug in PHP: stackoverflow.com/questions/47659587/… - Not entirely sure. Perhaps some of you can check?
 
@LeviMorrison I don't know but it doesn't make sense in declaring reference on both call-site and definition-site. It will just cause more confusion.
 
@Wes Did you push your thingy?
 
@Wes ohai
 
6:10 PM
@mega6382 Why do you think it's more confusing?
 
Wes
@Allenph nop. had to work today. also i have more work. i need to make a new layout for a 3 pages site. it's 7pm and i didn't start yet lol
@Dereleased yo \o
 
Bootstrap it up.
 
Wes
no, i am smart :B
 
You don't like Bootstrap? I always use Bootstrap. :p
 
Wes
it's crap
 
6:13 PM
That's a bit harsh, it's not crap.
 
How so?
 
So does anyone know what's going on with the question? Or should I proceed in making a bug report?
 
It's a scaffolding framework. You're expected to add your own styles to it.
 
It's never done anything but make my life easier and people know exactly what I'm doing when they look at the HTML. Of course you still have to mess with it, but...better than writing all of it. I think it makes reasonable assumptions. :p
 
Especially since the latest uses flexbox, yes.
 
6:16 PM
@icecub strict types is determined by calling scope. Internal code is always weak
Callbacks called from internal code will always use weak types
 
@NikiC Ah. Thanks for the explanation :)
 
@icecub It's a common issue
 
/me waves
 
@JoeWatkins Seems decent unless you pay a lot.
 
6:22 PM
I'm jealous Joe Watkins. I'm still getting like 600kbps peak. Dies Inside
 
20 eur for 10.5gb ... that sucks ... but it's plenty fast ...
 
Just kidding. I'm not jealous. That's an insane price.
 
@Allenph No fiber network?
 
it's such an improvement on the 64kbps I was getting earlier today, I'll pay it ... over and over and over again
 
6:23 PM
@LeviMorrison I live on the Magna side of West Valley. We were supposed to get fiber from someone, but Windstream has a monopoly there somehow...which is weird. They're not even supposed to be in Utah.
The apartment complex won't even allow me to get anyone else, even if it's one of those wireless recievers.
 
How's the job search going? Maybe move to a Utopia or Google service coverage area?
 
I have 200 mb/s down, and 10 mb/s up at home now
 
@LeviMorrison Meh. I can't afford to move. I just totaled my car and have no gap insurance.
 
Got 500 Mbit up/down thx to fiber. But it comes with a pricetag
 
Not well. I've had a couple interviews but at crap places. Domo expressed an interest, and so did Sling/Dish, but my dad works for Echostar and he says it's pretty bad.
 
6:27 PM
I did have 100mbps down, using two lines ... I miss it a lot ... but whatever I can do the php release ...
it's the most expensive php release that has ever existed ...
 
I can pay $50 for 100 Mbps or $70 for 1 Gbps or $0 for 10 Mbps. I pay $0 currently but did the other plans in the past.
 
I pay $85/month for 200/10
 
At my last place I payed $120 for 100/20. :p
 
Not sure how much longer the free thing lasts, but it's not like a promotion. It was part of the sale of the network to Google.
 
I guess we'll just have to wait for Elon Musk to provide us with insane speeds for $10
 
6:29 PM
Utopia has absolutely pitiful ping. Can't play online.
 
I pay €85 for 500/500 including tv with extra channels and phone
 
Sorry for late response was AFK.
So, I say this because declaring reference on call-site doesn't provide any functionality it just suppresses the error that you currently get. To me it is the same as:

//&$a
inc($a);
 
Ah, it doesn't work like that.
inc(&$a) would require that the first parameter of inc accepts by-reference.
It wouldn't suppress an error if it doesn't exist, I don't think. @NikIC could clarify.
 
@LeviMorrison if what doesn't exist?
 
In inc(&$a) what happens if $a is not defined?
 
6:35 PM
it will be implicitly initialized
Same as usual
 
No, currently you will get something like syntax error, unexpected '&'. But if explicit_send_by_ref is implemented, you won't get this error anymore.
 
@mega6382 You will only get an error if the function you are calling does not accept by-ref.
 
@mega6382 Think of it in terms of the & being required. (If not by PHP, then by PhpStorm or whatever.)
 
@ircmaxell I pay 14$/mo for 100/100
 
@NikiC If we allow & at call-site for references then we can't use & at callsite for inout, right? I ask because I'd rather work towards inout.
 
6:44 PM
... and a little less on my phone for 50/50
 
Well, I guess it is distinct in the grammar so possibly could.
 
@Wes do people tell you that you're amazing, enough? You're amazing, notwithstanding your crazy ideas
 
@LeviMorrison We could use it (as in swift), but not sure if we should
I'd prefer to mirror the declaration and use inout for the call as well
 
@NikiC I would be interested in it for a smoother migration path.
In 7.3 you add & to your calls and in 8.0 you avoid the overhead of references.
Win-win?
 
Wes
@FélixGagnon-Grenier fuck you
i mean, thanks
 
6:48 PM
<3
 
@LeviMorrison maybe
 
@James you around?
 
@NikiC I don't see how we could avoid a hard-break otherwise.
Which means legacy uses references and new stuff uses inout.
 
I wonder how much inout really buys us
 
Performance wise or..?
 
6:52 PM
@LeviMorrison To advance the referencocite
 
Performance is a point, but I don't think it's that big
 
for the first time ever, I have to turn off my router and say good night ...
if tomorrow isn't better, I'm going to kick @JayIsTooCommon ...
nn all
 
@JoeWatkins nite
 
6:53 PM
nite
 
Can you kick him even if it is better too please?
 
In some languages you are forced to initialize it or pass it to another function as inout.
So that helps with avoiding errors.
If inout requires it to be explicitly called with & or inout then we could do that at compile time, right?
Not sure how complex our CFG is at the moment so maybe not complete enough for it?
Wish I had time to follow all of that work.
 
... hey when did Jay become our official punching bag?
 
@NikiC What do you think about that part and when do you intend to move RFC for discussion?
BTW Hack allows & at callsite and according to a comment in IRC they intend to require it at callsite soon.
(when in hack mode, ofc)
 
@LeviMorrison yes-ish
All the cfg stuff is in opcache, so...
 
7:14 PM
@PeeHaa What's up Peter
 
@James Trivago still hiring? Asking for a friend
 
Yep. Not remote.
 
Also in DE?
 
Also hiring in DE yeah
 
@Patrick 20 USD?
 
7:16 PM
Dusseldorf, Leipzig, Palma
 
Can I twatter DM you?
 
Sure, no need to ask dude ;)
 
@Wes drawn with mouse or tablet? showed it to a coworker who loves simpsons, his question.
 
\o/
 
Wes
@Tiffany mouse. i have a tablet but i never use it
 
7:22 PM
[‎12/‎5/‎2017 1:17 PM] Coworker: with mouse?
[‎12/‎5/‎2017 1:17 PM] Me: I'll ask
[‎12/‎5/‎2017 1:18 PM] Coworker: because if so that is impressive, if not that is impressive
 
Wes
:B
i wish i could make money drawing stupid stuff
 
stream on twitch
takes time to monetize it, but something
 
@NikiC With out parameters do we check type when function returns?
 
@LeviMorrison That would make the most sense to me
 
with inout we check on entry and exit?
 
7:39 PM
I wanted to make every little aspect of my project customizable and now my class is full of setters and getters, am I doing it wrong?
 
@yessure .
Probably.
 
You mean about the way I make my project customizable or the 'fact' that I'm doing this?
.
 
The full of getters and setters part.
 
@LeviMorrison what approach do you think I should use? I thought of using setters and getters for the encapsulation
 
Typically when you customize things it's on object construction. After constructed the behavior shouldn't change. Is that the case here?
If so then I recommend taking everything as optional in a constructor and then using a builder or factory pattern to make it easier for the user.
 
7:56 PM
@tereško hello can you send me the new architecture?
 
honest answer: I don't know
it looks like in past year I have been doing only REST APIs
 
@LeviMorrison I have made something like that, but I didn't separate the Builder and the 'logic'
 
:D
 
@DaveRandom Any idea why ci.appveyor.com/project/kelunik/process/build/1.0.59/job/… fails? It's the only test that sets environment variables.
 
8:11 PM
posted on December 05, 2017 by kelunik

- Added `OutputBuffer`. - Fixed `ResourceInputStream` for STDIO pipes.

 
8:24 PM
@NikiC I think see why C# requires out parameters to use out at the call-site: the initialization requirements. If you pass an out parameter to an inout parameter it can't know that the inout parameter initializes it.
 
hi, what that question mark is doing?:
public function get(string $key): ?string
 
However I think out parameters in PHP would not need that, necessarily. If we check the type when we return then it was either initialized correctly, initialized incorrectly, or was never initialized and is therefore null. If the type permits null then that's fine but if it doesn't that will trigger the error. So I think we don't need static analysis. Seem right to you?
 
so generally string and null is allowed
^^ ?
as an output of that function
 
@Edenwave Yes.
 
thank you @LeviMorrison
 
8:36 PM
@FélixGagnon-Grenier in case you belief in humanity has reached unprecedented heights: tandfonline.com/doi/full/10.1080/0966369X.2017.1395822
this isn't even a new thing
Feb 18 '16 at 22:23, by tereško
@Machavity have you been exposed to "intersectional veganism"?
 
9:05 PM
 
/cc @bwoebi @NikiC @ircmaxell and @Ocramius
 
@MadaraUchiha Is that yours?
 
@LeviMorrison looks like an insta-no for me :-\
 
@NikiC To IS_UNDEF or IS_NULL?
 
9:09 PM
or it needs better reason why it is proposed
 
@Ocramius Because of..?
 
@LeviMorrison null
 
@LeviMorrison I'd rather have const vars than runtime checks there
 
@Ocramius I don't understand what you mean.
@NikiC Could we change that in the case where it's used directly as an argument? Then we could possibly detect read of out prior to initialization and fatal?
 
I use out vars in only one location and for performance, and even then a PHI optimisation would render my hacks useless/superfluous, so I don't see a reason to have out, ever
 
9:12 PM
@LeviMorrison your array_push should be inout
 
@NikiC Oh, it isn't? Oops.
Fixed.
@Ocramius You've never written similar functions to array_push, array_pop, swap..?
 
@LeviMorrison how would we actually implement this?
 
@LeviMorrison yes, functions, not routines
 
Let's start with the out case
 
and yes, I used to write them ages ago, when I didn't yet have so many mutability bruises
 
9:14 PM
Would the out argument only be evaluated for-write after the function has finished?
 
Do you mean that the variable is local and then when it returns it moves it into the correct location?
I'm not familiar with all the opcodes for function calls and sending parameters but I imagine that we have a new one that sends an address when we do & directly on a arg. Then on the receiving side if it's out it just uses the zval * of the original and if it's reference it makes a reference from the original.
 
@LeviMorrison That would require creating a reference
 
Only safe way to obtain a pointer
 
I don't understand that, I guess.
 
9:20 PM
pointers become dangling pointers
 
You shouldn't leave your pointer dangling around like that :(
 
In this case how wold it dangle?
The caller has the zval on its stack, yes?
 
e.g. if you pass an array element, the array could be realloc'd
 
is that importaant toknow design ptterns in php when I use laravel?
 
@NikiC Outside of that case any others?
Objects don't have this issue, correct?
I don't think ints or floats or bools or nulls would. What about strings? Only if you were to take a reference to a particular offset or something..?
 
9:25 PM
@LeviMorrison for objects if dynamic properties are used
 
We should forbid that already, for heaven's sake...
 
For variables, if they are dynamic
 
@NikiC You mean $$var or ..?
 
@LeviMorrison yes
and well, for arrays and objects nothing guarantees that the array or object itself will even exist that long
so it also applies to objects without dynamic property usage
 
@NikiC How does that happen?
 
9:28 PM
@LeviMorrison foo(&$a->b->c), reassign $a->b to something else in the function
 
@Edenwave depends. do you want to be a cheap and bad programmer or do you want to build your skills and get good?
 
hmm ... old Moonspell albums seem quite good for coding :D
 
@NikiC If we just used a GC and didn't refcount them it wouldn't be an issue, correct?
 
@Patrick I am trying to understand them from few days but they are tiresome to me :( And i think i dont understand it too much on not practical examples i found. Which ptterns i absolutely need to know in php and js? Do you know maybe some good sources with non-trivial exmaples to learn it?
 
@LeviMorrison it would still be an issue
 
9:33 PM
@NikiC How? The out parameter would still be keeping it alive?
 
@Edenwave patterns are just names that are given to common solutions to a problem
knowing those solutions helps when you come across that problem
 
@Patrick Yes I know. I was trying to write my own example of strategy, basing on ducks...
 
@Edenwave leave the poor ducks alone and implement it when it is the right match for a problem that you are facing.
 
@LeviMorrison no
at least not magically
you'd have to explicitly keep the surrounding structure alive
I just love America
 
I'm not an expert in GC but when there's a pointer into a property managed by an object doesn't that extend the lifetime of the object?
 
9:38 PM
Looks like the 4th Circuit has just established that it is indeed illegal for a police officer to force a teenager to masturbate in front of them for the purpose of obtaining a picture.
@LeviMorrison Ah, I see what you mean now. Yes
 
It would prevent segfaults but I'm not sure if that would still be the correct behavior for arrays that get realloc'd.
 
@Patrick Oh my god its a huge number of patterns :D I will learn it for a year...
 
@NikiC In that vein on an object we'd increase the ref count on the object it's a property of, but that would be undesirable for arrays I think, yes?
Since modifying a refcount from 1 to 2 would then cause copy-on-write instead of the intended behavior of out parameters...
 
@Edenwave you don't need to learn all of them. just know they exist and look them up when you need them
some are more useful than others
 
9:49 PM
@Patrick From where to know when to use them... Short description that 'its a good solution as an alternative for a inheritance and to switch strategies' isnt enugh I think
 

« first day (2607 days earlier)      last day (2357 days later) »