« first day (2593 days earlier)      last day (2346 days later) » 

Wes
1:29 AM
@Danack what else do you have under lights? :B
 
mornings o/
 
#PHP versioning can be difficult to understand. here's a simple infographic to explain
no wait I made a better one
#PHP versioning can be difficult to understand. here's a simple infographic to explain
 
Wes
lol
what happened now?
 
@Wes I was just noticing some “minor BC breaks” being added to 7.2
we don't really follow semver and semver is nonsense anyway so here's an “accurate” versioning scheme
 
Wes
1:44 AM
:D what is it?
 
the BC break? something to do with resources. the versioning scheme? see above
 
Wes
yeah the bc break. i know they happen all the time. why you say semver is nonsense? :B
 
@Wes well, it sort of makes sense, but I don't think it reflects real software
new features and BC breaks go hand-in-hand
 
Wes
indeed
 
and changing the major version every time BC breaks is… well, what does the major version even mean then?
 
Wes
1:47 AM
it should be just major.minor
major for any potential bc break, new features, etc. minor for bugfixes
 
yeah, perhaps
 
Wes
that's an actual thing with a name. there's a competing semver thingy that suggests using only major.minor
i don't remember it though :B maybe @Ocramius knows?
but people don't like if the "major" increments too fast
i don't know why they even care
 
semver sort of makes sense for machines. …sort of.
hey okay so a thing I want to add is
Closure::method($name) which essentially returns function ($obj, ...$args) use ($name) { return $obj->$name(...$args); }
 
any objections/thoughts?
 
Wes
1:53 AM
mh
not sure about that
 
@Wes oh, I was expecting X.0.Y
 
Wes
yeah that would be better. strange that it's not x.0.y :\
 
like, as-is, you get no bug fixes. not even security. wtf
I know that they consider bug fixes the problem but I think it's features that are
anyway, the justification for Closure::method is how frequently I want to array_map a set of objects and call some instance method
 
Wes
for example, using array_map?
 
array_map(function ($definition) {
    return $definition->toArray();
}, $definitions);
That kinda thing
Or even array_map(function ($definition) { return $definition->toArray(); }, $definitions); but I dislike how long that is
array_map(Closure::method('toArray'), $definitions);
 
Wes
2:06 AM
i see
but imho again the solution should be short closures
 
basically transforms an instance method into a function
perhaps
 
Wes
array_map(($d) => $d->toArray(), $ds)
 
yeah
I'm just a sucker for higher-level functions :p
 
Wes
:P tbh i normally like named functions too
it's one of the problems i have with functional programming. i have no idea what's what.
 
Evening.
Ooooo I should probably read the chat log. Looks interesting.
 
Wes
2:11 AM
especially because people like to use one letter names for variables
it's not much @LeviMorrison
\o
we were complaining about the absence of short closures :p
 
@Andrea I need a more complete example.
 
array_map(Closure::method('toArray'), $definitions); // this is a complete example
you could also pass more arguments potentially, but array_map is the main function I have in mind
 
What is $definitions?
As in, what does its structure look like?
 
@LeviMorrison an array of objects of a class that has a toArray instance method
class FieldDefinition
{
    /* ... */
    public function toArray(): array {
        return $this->serialize();
    }
}
 
The point I see is that all methods called this way must be called with the same arglist.
While there is some use I don't think it's general enough for stdlib material.
 
2:17 AM
@LeviMorrison same arglist?
 
array_map(Closure::method('toArray', $arg1, $arg2), $definitions)
 
ah, I was about to clarify, there's no partial application of the method arguments
at least, not built-in to Closure::method
 
I'm aware. It's not partial. That's the full arglist that would be passed every time.
 
but even if there were, yeah I see the issue there
 
(or you can think of it as partial which happens to bind all parameters and not permit any further binding)
 
2:19 AM
@LeviMorrison well, consider: usort($arr, Closure::method('compareTo'))
The awkward thing here is the ad-hoc contract
the class can't require itself to implement a callback signature
 
Here it would be in various other short syntax stuff I've used lately:
usort($arr, { $0->compareTo($1) })
usort($arr, []($a, $b) { return $a->compareTo($b); })
usort($arr, ($a, $b) => $a->compareTo($b))
usort($arr, Type::compareTo)
// haven't used this one lately but:
usort($arr, Type::compareTo(_, _))
 
I'd still like usort($arr, function ($a, $b) = $a->compareTo($b));
 
Some of these HHVM provides functions for to make it a bit easier:
usort($arr, class_meth(Type::class, "compareTo"))
 
Closure::method is basically HHVM meth_caller, but with the class being optional (or maybe not specified at all)
 
I would just add these as library functions to your application.
I don't think it's worth putting them into core at the moment :|
 
2:27 AM
shrug
For context, it would probably be part of this set of things: github.com/php/php-src/compare/…
 
I agree we are deficient in this space.
 
the problem with short closures imho is they are a bicycle shed syntax-wise and the nice syntaxes are tricky to parse
if we're going to have them use Hack's ==> I'd say
that might get voted down but I'll believe it when I see it
 
The trouble is that Hack's ==> does not solve the prefix parsing issue.
 
Yeah, that's the tricky part
 
If it did I'd be all aboard the bandwagon.
 
2:30 AM
but all the prefix syntaxes are objectionable somehow
 
I suspect this would not be well received: usort($arr, { $0->compareTo($1) })
But having used Swift recently for some programming puzzles I quite like it.
A lot.
 
I like $0 and $1
they're not even ambiguous! currently invalid
 
The only worry I have and it's literally my only worry is that it might conflict with object literals.
 
yeah, same
also it feels kinda weird to use {} when it's an expression
 
I don't care about object literals by themselves, but as a form of pattern matching they'd be awesome.
I guess that since we have reserved object now we could do:
object{ "property" : "value" }
 
2:35 AM
ooh.
not a bad idea for handling stuff without a class
 
Could generalize it construct any class with public properties that either doesn't have a constructor or has a zero-arg one.
 
I'd like unquoted properties though. Always did.
 
That list bit might be troublesome because of func_get_args
@Andrea If we want to allow arbitrary expressions as keys then we can't do that.
If we don't then I'd prefer unquoted keys as well.
 
@LeviMorrison doesn't make sense in a pattern-matching context
 
No, not on the LHS but for building them on the RHS.
 
2:37 AM
ah, right
 
The trouble with obejct{} and unquoted strings is that one of the benefits of object literals is being able to use JSON directly.
 
yeahh
 
If we can't do that they lose a decent chunk of value.
It was a good, short-lived idea :D
 
well, we could copy JS
both foo: and "foo": are valid
I really like the former, as you may know :p
 
Except in PHP that first would need to be a constant.
 
2:40 AM
in JS you'd think it would be, but it's not
it's ~special~
 
Yeah, and it's terrible lol
 
it's… convenient
…anyway I should go to sleep, I have work to get up for
 
night
And, for the record, I think the hardest part about short closures is the binding style.
Not the syntax.
 
3:29 AM
morning
 
@tereško ... oh well. It seems I was drunk and impulsive all over again.
o/
 
@JoeWatkins Morning.
I haven't worked on parameterized traits since my last push. I've been working on some use-cases to test it with (not just tests, real things).
Need to make sure I achieve the design goals, you know?
 
sure sure ... and I lost the tests I was working on and all scrap code had too ...
 
Bummer.
 
3:45 AM
monday wasn't very kind to me
 
good morning
 
o/
@LeviMorrison I noticed use of delref on strings
this will not call free at the appropriate time, should only be used if you know you are not dealing with the only referee ...
 
What's the appropriate function then?
 
zend_string_release
 
... that's a really bad name.
That implies you know you have the only remaining reference...
Naming. So hard.
 
3:51 AM
@JoeWatkins was that the source of the leak?
 
so hard
@Orangepill no, I didn't find it, it was strings, but used as hashkeys
I'l also getting a fault in this fetch_type_parameter function for pretty simple code
 
@JoeWatkins The encoding/decoding is 100% wrong.
 
that explains it
 
I just don't know why yet. That's where I left it.
 
cool, I'll play with it ... feel like I'm using someone else's computer though ... I hate change
 
3:53 AM
Thanks.
 
(ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT && zend_array_count(ce->type_parameters) > 0
ZEND_ACC_TEMPLATE 0x880
?
 
4:16 AM
@JoeWatkins ?
 
let's have the compiler set appropriate flags for the entry, and let's create appropriate flags for the entry ...
 
Oh, ZEND_ACC_PARAMETERIZED probably.
 
Probably pick a constant that would be valid on both classes and methods for future compat.
 
that's tricky
ce flags and method flags don't overlap ...
except final
 
4:18 AM
I was about to say we allow abstract and final right?
 
yeah but only final overlaps, there are specific flags for abstract classes (implicit/explicit) and then just abstract for methods
got any solution to error messages ?
they're going to be strange if we don't replace literal names
"can't find class T" and so on ...
 
Wes
4:39 AM
mornings
 
@JoeWatkins We can error in FETCH_TYPE_PARAMETER.
 
oh of course, we already figured that out :)
why is there two tables now, I'm not sure I get it ?
 
Well, right now with only traits in the picture we could use one.
 
that would be better, I think ...
 
4:42 AM
Classes need a "method name" => (HashTable of type parameters => type arguments).
However, that may not be necessary after all.
Oh, no wait, 100% is.
We don't store a pointer to the trait that the method comes from. If the zend_function had one we could just look up the type parameters that way.
But increasing the size of zend_function is a pain and IIRC tends to degrade performance.
So on the class that uses the trait we build a lookup table.
 
gotcha
zval type_parameters;

		ZVAL_ARR(&type_parameters, fn->common.scope->type_parameters);

		if (zend_hash_update(&ce->method_type_parameters,
			key,
			&type_parameters
		)) {
			Z_ADDREF(type_parameters);
		}
they appear to be the same type parameters for every method, which is confusing isn't it ?
> We don't store a pointer to the trait that the method comes from.
prototype.scope ?
just set prototype properly when specializing/binding the trait, no ?
I'll find a better way ...
 
5:04 AM
oh man what did i come into to...
 
@LeviMorrison I'm going to stop for a bit and think ...
 
5:31 AM
	if (class_node.op_type == IS_CONST && (ce && ce->ce_flags & ZEND_ACC_PARAMETERIZED)) {
		zval * type_parameter;
		ZEND_HASH_FOREACH_VAL(ce->type_parameters, type_parameter) {
			zend_string * new_type = Z_STR(class_node.u.constant);
			if (zend_string_equals_ci(new_type, Z_STR_P(type_parameter))) {
				is_type_parameter = 1;
				opline = zend_emit_op(&type_parameter_node, ZEND_FETCH_TYPE_PARAMETER, NULL, NULL);
				opline->op1_type = IS_CONST;
				opline->op1.constant = zend_add_class_name_literal(
ping @Levi
this can't work
 
Hi all
I need some help from you great minds
0
Q: How the object instances of same class can be sometimes different and some time same?

user2839497Consider below code : <?php class Test { static public function getNew() { return new static; } } class Child extends Test {} $obj1 = new Test(); $obj2 = new $obj1; var_dump($obj1); // Output : object(Test)#1 (0) { } var_dump($obj2); // Output : object(Test)#2 (0...

 
5:44 AM
@samayo Yes buddy, I did it. thank you.
Just one thing, can I change the password of my server? Isn't that offensive? (honestly I'm not familiar with your culture)
 
6:02 AM
@LeviMorrison who let a cat on the internet... how absurd...
@user2839497 "$obj2 = new $obj1;" thats a interesting way to declare...
I have learned somthing today
 
@JoeWatkins I'm not entirely sure. If you have an abstract method on a trait then a using class also has an interface method of the same... what even happens there?
But my initial idea was to use prototype, yes.
I'm pretty sure the prototype is set to the interface requirement.
I don't think it matters whether the trait method is abstract. Just that if a trait method has same name as an interface method on the using class then prototype would be set to interface method.
@JoeWatkins For every method from the same trait, yes. Not for all methods on the class.
And that's why I used a pointer to hashtable - or I think I meant to.
You could instead store the mapping of method to trait it came from, but then you are just going to look up the hashtable on the trait. And if we ever extend this to other features then we're going to need a hashtable of all parameter types the method has access to anyway. Seemed slightly more robust.
@JoeWatkins Why?
 
6:21 AM
posted on November 21, 2017

New Cyanide and Happiness Comic

 
well it can't always work
I've commited some changes, I'm not sure if any more works or not ... I'm still thinking really ...
you can probably see what I'm thinking from reading about as well as I can explain it by talking ... so I won't ... the kids are awake, hope to have some more time today ...
 
$foo = "T";
new $foo();
You mean stuff like that..?
 
yeah
 
I'm 100% fine with that.
"T" is a string, not a type parameter.
 
that's true
templates are implicitly final ?
 
6:29 AM
What do you mean? Traits don't have anything to do with inheritance, really.
 
oh
I was sure you could extend them ... okay good ...
I dunno why I thought that ...
 
7:02 AM
@Levi so I think the table is compiled properly now, but I still get strangeness, the prototype is set properly, the scope of the function is set properly ... we should have ZEND_ACC_TEMPLATE on the traits and ZEND_ACC_PARAMETERIZED on the implementations (I think) ...
you need to change new to delayed generation, you need to set result of fetch to op1 of new, and set op1 type of new to something other than IS_CONST or IS_UNUSED ...
storing zend_type in Z_PTR is not working for some reason ...
some more eyes will probably see the problem ...
 
Hmm.
Why won't zend_type work in a Z_PTR?
@JoeWatkins Is there a reason these need to be distinct?
 
you want template to set trait, but parameterized not too
 
What do you mean?
 
you want to tell the difference between a trait and a template, and you want a template to be treated as a trait (for the purposes of ce construction/destruction and other things like that), but the implementation shouldn't that it's a trait ... so that the flags can be copied to the concrete class (not the one that uses) and not interfere with anything ...
I think I thought it through right, but it's early ... and I'm probably wrong :)
 
Where would it interfere?
 
7:13 AM
also, ZEND_TYPE_CE will only work if you set it previously, we haven't for the type ...
the storage of zend_type works fine sorry...
code in headers^^
 
@JoeWatkins What is that?
 
in the vm handler, I'm just going to fix it ... you still need to figure out the delayed generation thing to make it actually work though
 
Delayed generation..?
 
how to send data from local system to live server phpmyadmin database automatically wihtout loggedin into cpanel(i means Is there any way to store or send data into database into my local php file configuration.)within local file configuration i need to give my username and pssword and want to send data into live server
 
13 mins ago, by Joe Watkins
you need to change new to delayed generation, you need to set result of fetch to op1 of new, and set op1 type of new to something other than IS_CONST or IS_UNUSED ...
 
7:17 AM
I don't understand.
 
I'll get to it tomorrow if you haven't ... the kids are fully awake and squeaking at me now ...
 
I don't know what those words mean.
I know about wiring it up to new, I think, but what is this delayed generation?
 
right now you generate new after fetch type opcodes, you probably want to generate new first so that you know the location of op1 (where you need to put the ce at rt) ?
 
Can't we use the make_result thing?
Maybe I misunderstood it but I lifted it from somewhere else.
 
not familiar with that ?
 
7:23 AM
zend_make_var_result
Looks related to zend_delayed_emit_op which I don't understand.
You are probably right about that stuff, I just don't know the terminology here.
 
I've got to do real life things, I'll try to find time today, if not I'll see you in the morning I hope :)
 
8:10 AM
Hello, who can help with this issue stackoverflow.com/questions/47395052/…
 
8:20 AM
@MadaraUchiha can you please check stackoverflow.com/q/47407340/208809. The OP provided an answer by himself, then deleted it and then "some other guy" provided the same answer again. I smell a sock puppet.
 
Anonymous
Yup. a member since today and gets his first answer accepted.
 
Wes
 
@Wes ))
 
8:36 AM
mornin
 
Anonymous
@Wes you mean angular 2
 
Anonymous
9:07 AM
morabfnfanugi
 
o/
 
Wes
\o
 
(o
 
mortejsgtnr
 
9:23 AM
@FélixGagnon-Grenier so, I assume you bought it
 
morning
 
mornkin
 
Anonymous
!!wotd
 
footloose free to go or travel about; not confined by responsibilities.
 
mirnin
 
Anonymous
9:27 AM
yosko
 
footloose, footloose~
 
this ^
-______-
 
Anonymous
In this time you'd have to be legally insane to be truly footloose
 
Anonymous
9:42 AM
or wealthy.
 
9:55 AM
Morning all, what's the best tool to create documentation from DocBlocks? Ideally i'm looking for something that i can use periodically and save them to a git repo. (or is there a better way of doing this?)
 
There's at least 2-3 main ones out there, why don't you give em a try? They should be easy enough to just plug in and run. Maybe the only differences are the themes / structure of the docs
Either way, they should all compile down to version controllable files.
You could even set up git hooks to gen documentation before commits.
 
Cheers Sean, i'm having a gander now at them
last time i used PHPDocumentor was years ago and it always ran out of memory so i stopped using it. But then i guess more Ram and more versions will make this more efficent
 
Eek
 
10:12 AM
hey guys
 
@Wes Tomatoes, but they're taking a while to get going.....and maybe something special for medicinal purposes...
 
Wes
:B
 
@Andy how many years? It's quite likely to just work a lot better now with the same amount of memory
 
Wes
are you using halogen lamps? i had to stop with them when i got my first bill :B
 
oh man, i cant recall TBH, it was a LOOOOONG time ago. Or at least felt that way :)
 
Wes
10:14 AM
now i only grow stuff that naturally grows on my balcony
 
speaking of tomatoes. Has anyone ever seen a Tomafoot? I am curious why all we ever see are the toes.
 
just running it now, seems to be working a lot better than i remember, which is something.
.... honestly Gordon
 
For a 'contact us' form is it enough to just limit the number of requests in a short time per ip in order to prevent spam or do i really need a captcha? I don't know if i really have to implement something like google offers... what u say?
 
@Andy where are all the other parts?
 
Wes
basil dies almost immediately, but i have rosemary, laurus, salvia. those survive easily
 
Anonymous
10:15 AM
@PeterCos captcha
 
@PeterCos i would say that a captcha is important, regardless of whether you limit per IP or not, nothing stopping a bot using a proxy and messing that rule up.
plus, you dont want to get shit emails, even if the bot is restricted, you'll have to spending time seperating the wheat from the chaff
@gordon .............
 
Wes
also have fennel but i'm not really a fan of it
 
@Andy, true...
 
fennel is minging
why grow it if you dont like it?
 
Wes
i don't grow it. it just survives. i give it some water during the summer
 
10:17 AM
fun fact, i ran the documentor, but didnt restrict the vendors directory .... oops
 
@Andy , are you familiar with invisible reCaptcha? that's what i got in mind to use but it says that u need a ssl to implement it,is that true?
i think i ran over it in some google docs
 
news to me, sorry, i havent had to deal with this stuff for years
but SSL is easy enough, just use certbot
 
@Gordon Whatever happened, it happened to the pineoranges too
 
free and everyfink (this is where someone says, dude that's a rubbish solution)
@Sean dont you start too
 
@Andy, awesome,thx
 
10:20 AM
TIL you can give headers' :before pseudo elements a negative margin & positive height to offset fixed position headers for anchors
My life has changed
 
@Andy you are not the curious type of guy, huh?
 
Wes
@Sean it would be awesome to have infinite amount of ::pseudo elements, eh? :B
that's the only problem with this kind of tricks. you can have only one at once
 
Yup :p
 
@Gordon i am about certain things
just not horticultural things
 
Anonymous
1 message moved to Trash
 
Anonymous
10:27 AM
@Andy I think he's just flirting with you
 
Wes
@JayIsTooCommon ABUSE OF POWER
 
we just wanted it to get infinitely deep
 
Anonymous
stopping you both from being annoying isn't abusing power
 
Wes
41 secs ago, by Wes
32 secs ago, by Wes
15 secs ago, by Wes
@JayIsTooCommon you've changed
 
Anonymous
10:29 AM
Blame @bwoebi.
 
Guys, what do you use to detect performance degradation in production? As in, actually pinpoint that call /user/login became slower by 300ms in the last week or similar stats
 
Anonymous
New Relic
 
and you have the calls as key transactions?
 
@JayIsTooCommon Instana :P
 
Anonymous
@pmmaga yeah
 
Anonymous
10:32 AM
@Gordon I've heard their developers are amateurs
 
@Gordon would it warn me about these even if I don't track that specific call as a key transaction or any other kind of whitelist?
 
@JayIsTooCommon you shouldn't rely on hearsay
@pmmaga kind of. we detect sudden drops and we do trends for all your endpoints. you dont need to instrument them manually.
 
10:48 AM
I wish New Relic were better :(
 
10:59 AM
Morngins
 
Anonymous
yopee
 
yo
 

« first day (2593 days earlier)      last day (2346 days later) »