« first day (3412 days earlier)      last day (1519 days later) » 

1:41 AM
Ate to much.
 
1:59 AM
and falsey "0" bites me again :|
 
2:40 AM
Have anyone worked with gcloud?
 
yup
 
Ahhhhhh
 
@MarkR I have shut down a project, I had a vm instance running in that
Wll i be charged for that even after shut down
 
2:57 AM
If you've completely killed the project, no, I don't believe so
Outstanding payments will still need to be made of course
 
??
I just shut down it yesterday
Will thr vm instance charge me now??
 
No, but if you already had a bill to pay, shutting it down wont prevent that bill
 
What to do to stop charges from that project
I am on 12 months free tier
 
Then you're fine
 
I will not be charged???
 
3:05 AM
Not if you're on free trial and there's nothing to pay??? but if you want to be sure contact billing??? okay???
 
Will that vm instance charge my free trial credit??
 
For however long it was up, yes
 
After 30 days, the project will be deleted, will i be charged then too??
 
I'd not think so. But I say again, if you want to know for sure, contact billing
 
3:51 AM
Can extensions implement interfaces that are defined in userland? Not surehow that would work given order of initialization.
 
 
3 hours later…
6:56 AM
no
well
you would have to jump through many hoops, it's not supported because the user interface is going to be freed and the internal class is persistent ...
but that's not to say it's impossible, it's obviously possible if you're willing to hack enough of the engine, but imo it's not a good idea to try ...
 
@cmb Thanks!
 
 
1 hour later…
cmb
8:18 AM
\o
 
indeed
 
<3 php at 2020
 
8:50 AM
o/
 
cmb
9:04 AM
\o
 
o/
 
9:52 AM
Madainn mhath!
 
morning
 
10:11 AM
\o
 
I want to tear my own eyeballs out, there has to be a better way to create factory objects which only take one extra parameter :|
 
Oh goody. That came sooner than I expected. Taking a read
This is huge.
One thing that comes to mind @NikiC is pre-tokenization parsing, such as could the detection of edition come before the compilation step, or are we forever locked into one compile context?
 
10:36 AM
@MarkR To clarify, is the question whether we can influence tokenization/parsing based on the edition?
 
Yes
 
@MarkR Technically yes. For example the existing encoding declare works by processing it in the parser early and then modifying lexer behavior based on that.
There would be some complications though. In particular we can't really make the parser conditional in any easy way
The parser is generated and the generation can't depend on run-time state. We would have to ship two different parsers or something. Influencing the lexer is simpler.
@MarkR Any particular changes you have in mind in that direction?
 
Attempt #2 at murdering backticks :-) or rather keeping the substitution behaviour / not needing to escape single quotes, but removing the shell_exec wrap around it. But thinking about it, that's done at compile stage which would have the edition available by that time.
 
@MarkR Yeah, that would be possible
Whether it's a good idea is another question :P
I'd rather remove it than repurpose it in this fairly subtle way
 
All in all I think editions are a solid idea. The main thing would be how aggressive to go on them e.g. if we blocked undeclared parameters, would it make sense to also pick a fight again about undeclared variables.

If function autoloading is probably never going to exist, would it make sense to pick a fight about removing functions entirely from namespaces. Things like that.
Naturally the more aggressive editions went, the longer the old style would need to be supported vs a commitment to support say... 3 editions
 
11:11 AM
@NikiC I think the strict operators RFC is a bad example. It's IMHO too controversial to be beneficial for your RFC :-)
 
@bwoebi I think it has some controversial parts and some uncontroversial parts
But anyway, I don't think we should make all of those changes, it's intended as examples
 
I know how it's intended, but that's probably not how people will read it.
Re editions: I think we should give editions a lifetime e.g. they must cross an x.0 (e.g. from 8.0 to 9.0 or from 8.3 to 10.0.)
 
Might editions become something of a policy tool, requiring code is written within certain (tightening) constraints?
I think there's probably an "option #4" worth mentioning, and that's fine grained declares, but with in-built presets.

declare(edition=2020) might activate every flag and new feature, declare_import(declared_vars) might simultaneously activate dynamic property protection + uninitialized var protection.
 
@MarkR I don't like that. This suggests that long term everything will be still opt-in.
if you can toggle everything individually
I want something indicating a clear path where everything will move
Let's not fragment the language unnecessarily.
 
So, in edition=2020, would we make strict_types=1 the default?
 
11:26 AM
No :-P
 
Well that brings back the question of how aggressive and if it's a matter of policy
 
I don't think we should make strict types the default, ever.
 
So that's 2x declares at the top of every file (because at this point most people doing serious engineering use strict types)
 
so editions essentially would be there to say "I am okay with the incompatibilities, gimme the new goodies"?
 
@Ekin yes.
And from time to time, we should merge the oldest edition into the defaults of the language.
 
11:31 AM
I like that. Though then I also want package level declares too :-P
They solve distinct matters
 
IMO Fine grained would have the least resistance, editions would be the best from a language development PoV
 
@bwoebi Why though?
It seems like a reasonable default nowadays, with the option to disable.
 
If there's an option to disable, that's option 4 isn't it? Fine grained controls but wrapped up into packages
 
@MarkR Not really: It's just the strict_types already exists, so that stays as a separate toggle. Option 4 would be introducing more of those
 
@NikiC Because a lot of external data (user input, db) is coming in as strings. Which is the default for any application before you build larger abstractions where your logic gets stuffed away in classes which do not directly interact anymore with external data.
 
11:36 AM
Ah so singling it out, fair enough
 
@NikiC And the default should be something where you can start from without having to take care about types etc. Types are for later when you expand and abstract things away.
 
There's of course also the possibility of making strict_types a really independent option, but that evolves along with editions
For example, edition=0, strict_types=1 is just strict argument types. edition=2020, strict_types=1 is also strict operator types. Not sure I like that tho
 
I must disagree with you there bwoebi, types are for telling PHP not to fuck things up by trying to be clever.
 
Isn't fucking up basically PHP's job?
 
Eh, 50/50. Fucking things up is a specifically listed item on my job description.
 
Did you get a podcast-boner?
 
I started reading
 
@NikiC yes.
@MarkR No
 
nothing useful to say, except we usually pluralize decare as declarables in code, it reads nicer than "declares" ... I didn't get to the meat of the thing yet, just scanned up to it ...
 
@Derick You read what might be the most important document to be written for PHP in several years and didn't get excited about all the discussion episodes you could do on it? :P dude lol
 
11:45 AM
That's a little hyperbolic :-þ
 
my one question regarding editions, could we have a project wide edition setting?
 
I do have a thing to say, though you may not find it useful ...
there's no doubt that the discussion needs to be as complicated as drafted here, it needs to consider so many things and it's being considered by people who aren't really aware of all the moving parts, that I don't think I have much confidence that we can have this conversation effectively and make the right decision ... so it's probably worth avoiding the conversation all together and finding a way to work with each other ... which might seem as difficult
but tackling each problem or disagreement as it comes has worked out so far with varying degrees of success, nevertheless the project functions and makes leaps and bounds forwards beyond what you would expect ...
 
This discussion would seem to be how to actually work together, Joe. If the proposal is to add editions, that would allow a certain degree of longer-term co-existence.
 
it reads like an overview of ways to split the language down the lines we said didn't exist when P
++ was proposed
if the end result, whatever it looks like, legitimizes those groups, we made things worse
 
A Q I would pose with editions, would be how would they be named?

Would it be... edition=8.0, 8.1 or would PHP itself change..... PHP 2020, 2021 etc
 
11:52 AM
@JoeWatkins It doesn't split the language, it eases the upgrade process
As @bwoebi said, and possibly we do need to emphasize that, the end goal is still that you need to upgrade to the new edition at some point
But you can do that anytime in the next five years, you don't have to wait that all the libraries you use have upgraded and you don't force everyone who uses your library to upgrade as well
 
if you get your way, there will be a group of people including you trying to push the language forward, and a group of people including zeev trying to force every single proposal into an edition in the name of bc
then we have those two groups
that's worse
 
@JoeWatkins Which is why we should have a default to not delegating it to the edition.
 
@JoeWatkins That is indeed a danger. It does need to be clear that this is a way to allow breakage we currently don't, not a replacement for existing breakage. I think some of that will fall out naturally, if for example all library changes are excluded from the mechanism by policy
 
And then well-defined criteria when something should be in an edition
@MarkR I suggest the version number, as we probably will release editions alongside versions?
 
There's something to be said for locking certain goodies behind an edition. It is the carrot (get shiny new features, but in exchange you have to update some unrelated parts) to the stick (this edition won't be supported forever).
 
11:58 AM
when there are two things to choose from, we often make the wrong choice
I still like the idea of editions, but when I start reading this I just become overwhelmed with doubt, it's such a complicated topic and we are crap at simple topics ...
 
@JoeWatkins and for what it's worth … every edition should be merged after a few years into what's default. So even if we do make a bad choice, it'll end up a few years later available for everyone…
 
However, if we do make a bad choice in designing things which are in editions, we can just reverse it in the next edition.
No need for a 5 year deprecation, or rather people who still use the old, bad version, get 5 years of deprecation... everyone else bumps to the new edition and gets the better version
 
as for editions, and feature declares, could it be possibl to take from the ecmascript + babel playbook here and have the fixed editions, and then experimental declares for individual features with the explicit definition "this is experimental in edition $x, but it will come in $x+1 and the experimental flag will be removed by then"
 
anyway, I'm gonna read the thing in full properly before saying anything else, that was just my knee jerk reaction to being faced with the subject as presented ...
 
cmb
12:12 PM
@NikiC and that will cause (almost) the same amount of resistance to some changes like we currently have. :(
 
There's probably enough support to overcome that
Might it be helpful if we come up with a list of things that we might initially want to put behind a 2020 edition?
 
@NikiC I thought that was the antithesis of editions? Editions are supported forever (well, within reason), so that problem goes away, no?
@NikiC One thing that may be useful for the doc: A test for when a feature/fix/break wouldn't be isolated to the edition/directive, but would roll out everywhere (ex: security fixes, etc)
 
Within reason = only 4 or 5 years when you only support the product for 2
 
12:30 PM
Also, if Standard Library changes are only allowed in editions, there's a potential challenge:
// Imagine Edition 0 uses function in_array(array $array, $strict = false);. and edition 1 uses $strict = true
edition 0 {
    function curry_right(callable $cb, ...$args) {
        return function(...$leftArgs) use ($cb, $args) {
            return $cb(...array_merge($leftArgs, $args));
        }
    }
}
edition 1 {
    $cb = curry_right('in_array');
    $a = ["1"];
    var_dump($cb($a, 1)); // which behavior is used here?
}
 
How about YOLOing it and moving the standard library to an import?
Not sure how that would play with scalar objects though
 
12:57 PM
@ircmaxell Pretty sure standard library changes would be explicitly forbidden
@ircmaxell No, I don't think so. Editions are about making code with different editions compatible. They don't make any statement (per se) about their own support timeline
The basic mechanism is sound regardless of whether you support forever or not. Both options have their benefits
 
> Editions are intended to be supported forever, and there are some limitations on what kind of changes are permitted in editions
 
@ircmaxell In Rust
 
That's from your RFC directly. I am not against editions expiring at some point, just the clarity around that mechanism confused me
 
The question is discussed in more detail in github.com/nikic/php-rfcs/blob/language-evolution/rfcs/…
 
@NikiC for clarity, you mean stdlib changes limited to an edition? Meaning they are "allowed", but are all or nothing?
 
1:04 PM
@ircmaxell I mean, I think that standard library changes are a bad fit for editions
They should either be made globally or not at all
It's better to introduce a new function than change behavior of an existing one
 
@NikiC I was misled by that as well initially. I think you should clarify (again) at that location that the forever is Rust specific.
 
The externalities are very different for language and library changes
 
@NikiC ah, that feels better (wasn't clear as well)
 
Q following on from my platform version RFC draft. Presumably encountering an edition higher than supported just leads to immediate compile error?
 
And what about introducing a new standard library with object-oriented API? And making it resistance to entropy. Eg. instead of adding argument to functions, rewrite this part as object with interface and pass details into constructor. This should help in evolution of standard library
 
1:08 PM
@ircmaxell @bwoebi I've updated the second paragraph in github.com/nikic/php-rfcs/blob/language-evolution/rfcs/…. Is it clearer now?
 
@NikiC yep, thanks :-)
 
@NikiC much clearer.
BTW, really well done with that RFC. Nicely balanced
 
1:40 PM
Although It's not as interesting as the language evolution RFC, I'd be happy to receive some preliminary feedback about my "final properties" draft RFC: wiki.php.net/rfc/final_properties Did I manage to describe the feature clear?
 
@MátéKocsis First of all, don't call it final properties. Not even as a placeholder
That's going to steer discussion in the wrong direction
 
@NikiC OK, I'll try to get rid of all the mentions then
 
@MátéKocsis The RFC doesn't mention how readonly properties interact with references
 
@NikiC It does, but I admit it's not that visible and clear (it's the very last sentence in the proposal section). I'll add examples too
 
@MátéKocsis oh, true
@MátéKocsis I'd suggest to also add a section that discusses some alternatives to the behavior. The "write once" approach is one possibility, "write until end of constructor" is another. You can be sure that someone is going to bring it up, and it's always better to anticipate this and discuss advantages / disadvantages directly in the RFC
 
1:49 PM
@NikiC Ah, yes, it's a good idea!
 
I think it may also be useful to discuss at some point what a "write" really is here, and in particular that readonly properties still have interior mutability (i.e. you can write $foo->readonly->bar = 42)
You do already mention that in the example, but I think it can be highlighted more
 
@NikiC Roger!
If anybody can see unnatural expressions/words as well, feel free to highlight them :)
 
Morning 11
 
o/
 
2:43 PM
anyone got (alot of) exp with phpseclib?
 
@Naruto You know our rule of thumb :) Don't ask to ask, just ask
 
true, my bad
does anyone know why this works: $ssh->login('login', $privatekey, 'password'); but not $ssh->login('login', $privatekey, 'password'); even though the key authentication is turned of on the server side?
 
Aren't they both the same? :P
 
looks the same to me!
 
Yeah I'm lost
o/
 
2:58 PM
o/
 
sorry, forgot to edit it out
first or second one should be without the private key var
 
What does getLastSFTPError() tell you?
 
nothing
basicly empty string
the login returns a false and I get no errors
 
And getSFTPLog?
 
false
also, I've been checking the source code of the login of seclib, and basicly it says this:
The $password parameter can be a plaintext password, a \phpseclib3\Crypt\RSA object or an array
public function login($username, ...$args)
feels weird to me that If I only pass username and pw it doesn't work but with a empty or (in)valid key it does
 
3:15 PM
getSFTPLog returns false?
define('NET_SFTP_LOGGING', true);
Wait actually
I am not awake
You are just doing plain ssh
 
i can do the $sftp->getLog() if that's what u are looking for? but that just dumps the networking stuff
 
That's what you want if you want to see what is going wrong
It should tell you what happens
Is it ssh1 or 2?
 
Hi
What is the better approach to display a family tree?
 
SSH2
 
Did you follow this example with the logging option? phpseclib.sourceforge.net/ssh/2.0/examples.html
 
3:30 PM
sorry, I am using new SFTP, not new SSH2
 
@NikiC Would you be up for a pair programming session this week to help me get opcache working with instrumentation?
 
@Naruto The solution would be the same. Figure out how to get the log and see what it is doing :)
 
well I can get the log using ->getLog();
but that doesn't make any sense to me whatsoever ^^
 
Can you put it in a gist
 
the log or the code?
pastebin or something fine 2?
 
3:41 PM
how would I assert that a method achieved what it's supposed to? e.g. removing an observer from a subject, does the remove method need to return a boolean?
 
@Naruto gitbuh gist please
@Tiffany That just asserts it returns true not that the observer is detached :-)
 
Make a change and verify that the observer that is removed is not called anymore
 
I var_dumped the subject before and after, and I could clearly see the object was removed
but I'd rather learn how to write code that can be tested with assertions
 
With phpunit you can create a "mock" that asserts how many times it is called
 
3:44 PM
wondering if I need to rewrite the register and remove methods so that they are testable, but I also don't know how I should rewrite them so they can be testable
 
rip I don't use github ><
 
@Tiffany It is already testable
@Naruto You... don't use github? :|
gitlab?
Something else?
 
@PeeHaa You don't use pastebin? ;-)
 
hehe
 
^
 
3:47 PM
@PeeHaa the Great Github Exodus when MS bought github
 
@Tiffany It was not great
 
great as in large :P
 
It was just loud and dumb twitter people as usual
 
anyway, did u want the code or the logs?
 
both would be god I guess
 
3:48 PM
@PeeHaa so I would assert that the removed observer can't be updated?
 
@Tiffany Something like this:
 
@PeeHaa soz but it's going to be a pastebin
 
soz I don't do pastebin
Even if I wanted I cannot
 
It's blocked here
 
3:50 PM
that's the site used
 
oh :P
 
:D
 
shh, I was masking it with a link ^^
 
Any chance you can make it into a non hex log? :P
 
Question... if you have a lot of views that have DI-s, what would be an elegant way to instantiante them? I'm trying to avoid having to type each one out in a factory...
 
3:53 PM
@Code4R7 sounds like a use case for auryn maybe?
 
:-) I think I've mentioned auryn before, but I forgot its name
 
@Naruto any chance you can make that log readable?
 
good question, let me figure it out
 
thanks @Tiffany !
 
3:55 PM
np
 
I'm also tryin' to avoid Reflection.. had a look at how Laravel implemented Views, but I'm not going that way either.. let's see what Symfony has to offer.
 
Pretty hard to avoid reflection if you want auto configuration
Even if it's just at setup
 
What's wrong with reflection?
 
There's nothin' wrong with Reflection.
 
Oh you guys are talking to people I don't see...
 
4:05 PM
@PeeHaa something like? :D
 
getting there
juggling my own code too atm :)
 
ahh, sorry
 
no worries
$stub = $this->createMock(Observer::class);

$stub
    ->expects($this->once())
    ->method('update')
;

^ test it is being registered correctly

$stub = $this->createMock(Observer::class);

$stub
    ->expects($this-never())
    ->method('update')
;

^ test it is being unregistered correctly
there @Tiffany
 
@PeeHaa I'm looking for ways to get that stuff readable, I will get back to you if I ever manage
 
@PeeHaa thanks
 
4:09 PM
Alternatively did you try to reproduce it with just the ssh command on your cli?
If you can repro it there you can just add the verbosity flag and see it
 
I have no access to our servers cli
guess they don't trust me as far as they can throw me with that ^^
 
4:28 PM
:-)
Don't you have a dev server you have access to?
 
😃 wrote my first test in phpunit and it passed
8
it helps that the phpunit documentation is using subject/observer pattern as an example case, and my code is pretty similar to theirs...
 
\o/
 
4:53 PM
yay
 
learning design patterns and how to write proper tests... learning a lot :P
 
I write tests.. but how to write proper tests? I have a far ways to go with that one
 
Who tests the testers?
 
Take a look into infection.github.io
 
@Alesana my "tests" were writing a simple script and calling the methods, then checking to make sure the methods were called
kind of a simple front controller
 
4:58 PM
@MarkR We all do, when we maintain the test suite over time and curse "who the heck wrote this brittle test", only to find out it was us...
 
@ircmaxell pretty much
Although for me it's more like
"I probably wrote this brittle test... annotates - Yup"
 
5:15 PM
'lo all... QQ... Id like to loop through an array and remove each element as needed, essentially removing it from the loop.... but its not working how I wanted.
Ive been searching the stackoverflow site, but not found exactly the details I need
 
You can use array_filter to make a new array that only has the elements you are interested in, then iterate on that.
 
ooh.. Ill look into that.
 
@ircmaxell Benefit of working on my own. Think of all the time I save by not having to dig into git logs to work out for certain who screwed it up.
 
@LeviMorrison Thanks!
 
No probelm.
 
5:33 PM
Perhaps im going about this wrong... I have an Array that is a dataset from a database query. It returns rows that need to be put into groups based on one element in the row. I want to take each "group" and make it its own array that I can loop through.
 
Maybe look at array_column.
 
The group could be 7 records, or 50 records, etc. but I need to break the dataset array into these smaller groups.
I have been able to use array_keys(array_column()) to get just the keys for my group...I then wanted to unset those keys while looping through the dataset... but its not working.
the foreach loop of the dataset, using unset removes it from the array... but the loop still tries to use the removed elements.
I know im trying to remove elements from within a loop of those elements.... I guess thats my problem
 
most likely
 
ah forget array_column exists, such a beauty
 
copy the array to something immutable
 
5:39 PM
@beberlei It has useful functionality, but the API and its semantics are an abomination lol
It should have been more than one function lol
(abomination is a little harsh, but you get the idea)
 
@Tiffany explain 'immutable'
 
@Yourguide does not change
it's like a constant
I should say, "cannot change" instead of "does not", as it's a restriction of immutability
 
@Tiffany sorry, not understanding you... take my dataset array and copy it to a constant? or ?
 
@Yourguide copy the array into another array, the second array is "immutable" in that your code doesn't change it. It's not an actual const constant. It's constant in that you know it will not change.
 
@Tiffany Ahhh... ok I see
 
5:48 PM
@NikiC Sending you an invite for Feb 24th, 10:00 - but let me know if you want to do it the 27th/28th instead.
 
/me waves at @Derick
 
hi hi Antony
wassup?
 
not much, just waving :)
have a bit of FoMo around PHPUK this week, as I'm home, but it's all good (busy with work)
 
FoMo?
 
@Derick Fear Of Missing Out
 
5:58 PM
@beberlei Limiting the stack depth of the exception API means allocating a new array or whatnot if it needs to be limited, and I just haven't bothered yet. On the radar for this week.
 
@LeviMorrison cool! thanks for taking it into account
 
TIL /usr stands for 'universal system resources'
not sure why I assumed it'd be 'user' now
 
that's certainly how I pronounce it
 
> Java Scripting
found on a job post. not sure if related to writing scripts in Java, or writing code in JavaScript ...
 
6:28 PM
@Tiffany Almost certainly they meant Javascript. This is what happens when HR posts the job openings.
@Ekin So what do /var and /etc represent?
 
apparently /usr used to be the user directory indeed, then it became universal system resources as it wasn't just the user dir anymore
so it's a backronym
/etc doesn't have an entry about what does it represent on tldp.org but I saw a comment saying the original contents of /etc were the "et cetera" that didn't seem to fit elsewhere. Another comment mentions it means Extended Tool Chest per some gnome convo
/var is probably variable
> Contains variable data like system logging files...
 
as a joke, I was going to say etcetera and variable...
 
 
1 hour later…
7:46 PM
That's what I assumed etc and var stood for, but I wasn't sure. I also assumed usr was user, seems that wasn't an entirely incorrect assumption.
 
 
1 hour later…
9:09 PM
@Trowski Wait what
usr isn't for User?
Oh I misread your message, nevermind
 
9:25 PM
Does anyone know what happened to PatrickLouys? He hasn't been active on his personal website, github, or here for over a year
 
 
1 hour later…
10:46 PM
This week:
- Days so far: 2
- Miles driven: 286
- Internet connections broken by fallen trees (and repaired): 4
- Phone systems eaten by 15yo failed 2.5" HDDs that have been running 24/7 for that entire time: 1
Unhappy customers: 0
fuck you, universe, I am better than you
 
wanna do my taxes for me? :P
 
I will do your taxes if you pay mine. Fair trade? :-P
annoyingly though, LoC written: 0
kind of extreme circumstances though
not now though, time for $hangovers++ :-P
 
well, at least I don't owe any money for federal...
I'm getting a return of 47 USD ... why I'm getting any money, I have no idea, I only worked January last year :/
 
couple of bags and a vodka chaser, I wouldn't argue
or y'know, some boring shit like food or whatever
 

« first day (3412 days earlier)      last day (1519 days later) »