« first day (1711 days earlier)      last day (3242 days later) » 

6:00 PM
And lo, Jon Skeet answered a PHP question, and it was good
 
It's a dupe of a dupe of a dupe though :P
 
I had to upvote it, tho, because his basic answer, if you read it carefully, is RTFM :P
 
posted on June 23, 2015 by kbironneau

/* by chenkthetank */

 
Can I somehow pass object (class) to ReflectionClass?
 
@PeeHaa I found the dupe, closed :)
 
6:04 PM
@VeeeneX What are you trying to do in specific?
@hakre Thank you fine sir :)
 
@VeeeneX that function is documented - php.net/manual/en/reflectionclass.construct.php "Either a string containing the name of the class to reflect, or an object."
 
@PeeHaa It's a pleasure to me, sire.
 
:-)
 
@Danack I'm sorry I'm missed that part with or an object
@PeeHaa Own DI, with execute() like Auryn has
 
Just been hit by the Rasmus optimization....
 
Anonymous
6:15 PM
@salathe Is there a hidden/pending doc with the new features of php7 in it? If not, when will the contributions start?
 
Yes, IT WORKS!
 
Anonymous
cool ^^
 
I just finished a rousing game of "Where's Waldo for Programmers: Equality vs. Assignment Edition"
 
heheheh
 
6:25 PM
@DanLugg learn 2 static analysis ?
 
@NikiC I think we rather should execute the first few opcodes and stop if opcode doesn't match RECV_INIT/RECV_INIT/RECV_VARIADIC anymore
 
@bwoebi that would be ideal
but more involved
 
@NikiC uh, executor is really minimal nowadays… I don't think it'd be much more complicated
 
maybe I'm missing something. wouldn't we have to insert an opcode after argument recvs. which currently we don't quite have the state for (but could add)
 
@NikiC why?
 
6:30 PM
@bwoebi well how do you want to do it?
 
a while-loop until first opcode isn't RECV* anymore?
 
you mean you want to have a separate executor loop for that?
 
yeah
 
that sounds really dirty
especially considering different vms and stuff
 
@NikiC oh, yeah… somehow just thought about normal-w/o register etc.
@NikiC we basically just need an extra implicit yield null; in there and immediately start executing (instead of delaying until first Generator call)?
 
6:37 PM
@bwoebi something like that, yes
but not an actual yield of course
 
@NikiC why not? a yield null doesn't change state of an uninitialized generator, afaik?
 
@bwoebi it yield a null...
 
yes, but current() is initialized to null anyway?
 
no it isn't
current() returns the value of the first yield
which is generally not null
 
oh… I get it.
In that case I'm not sure if Juliens patch is that bad.
 
6:40 PM
@bwoebi That's why Aerys filter initialization uses ->current()? I think you introduced that yourself there. ^^
 
... (once current, once valid)
I need to play around a bit with Dmitrys patch…
 
Describe the five key phases of software development (via @jcoplien) http://imgur.com/qq2ceU9
2
 
Actually, I thought generators would always be executed to the first yield until that issue in Aerys.
 
@kelunik Yeah, I find that very unintuitive…
 
On the other hand, the other way round isn't that intuitive either, at least not in Tcl, because you create a coroutine context there which automatically executes it until there's a yield.
 
6:48 PM
@kelunik I wouldn't want a generator to automatically begin execution.
 
@Danack Notepad++ and not enough time
 
Just fyi, if you call Generator->valid() it will also execute to the first yield.
 
When you do have time, this is one thing that PHPStorm does quite well - right click on a folder, 'inspect code' and things like that would be found within 10 seconds...
 
@Trowski That's not intuitive. Why should a bool check change the state, but creation / call not do that?
 
@kelunik Unfortunately you can't know if it's valid until the generator has run. It's not intuitive, I agree, but there's also not a lot of choice while being compatible with iterators.
 
6:54 PM
Why does it have to run for that? It should know it's a generator and it's not yet at the end, shouldn't that be enough?
 
@kelunik nope, the generator might never yield
function gen() {
    if (0) { yield; }
}
 
To be compatible with iterators, if valid() is true the generator has to yield.
 
Here valid() must return false on first call
 
Yeah, what @NikiC said :)
 
need to think of how to represent a try/catch in a CFG block as well...
 
6:56 PM
@ircmaxell yeah, exceptions are a bit a mess here because it's like a conditional jump after every instruction…
 
@NikiC Oh right. But I think I'd prefer it to happen upon creation.
 
@kelunik What if the generator throws an exception right away? Throwing on creation wouldn't match behavior later.
I would appreciate comments/suggestions on trowski.com/2015/06/23/throwable-exceptions-and-errors-in-php7
Finally getting around to starting a blog :)
 
7:12 PM
@Trowski Is "fix your TLS setup" a valid suggestion? :)
Sorry three pings I'm stupid
 
Yeah, it's on my todo list.
I just used the defaults, but apparently the defaults are TLS 1.0 :-P
 
Yeah I just looked and those are the stupidest defaults I have seen :D
Well at least it's not ssl :P
 
TLS 1.0 was fine until recently, and I'm guessing the defaults wanted to support as much as possible.
 
I think my setup supports the exact same platforms
 
Any comments on the content though?
 
7:26 PM
Going to grab a beer first after that I will read it :)
 
Thanks.
 
@Trowski The sentence "Fatal errors still exist for certain conditions" has the important bit at the end, and so requires quite a bit of parsing.
"if Exception is used as a type declaration on a function parameter, the type declaration will need to be removed to support both PHP 5 and 7" - I guess you mean the type declaration needs to be changed to Throwable?
If I was writing the article I might use the E_ERROR, E_RECOVERABLE_ERROR constants to disambiguate 'errors' from 'errors'.
 
@Danack I was speaking of supporting PHP 5 and 7 with the same code, I could clarify that.
Using E_ERROR and E_RECOVERABLE_ERROR is probably a good suggestion.
 
7:46 PM
@Trowski First sentence :P
> Handling fatal errors the past has been next to impossible in PHP
You a word there
 
@Trowski The average PHP developer does not know what 'User space code' is...
 
@PeeHaa haha, yep
@Danack Good point.
 
> Since Throwable specifies methods identical to Exception PHP 5
What's an "Exception PHP 5"?
 
:-P Exception in PHP 5. It's so easy to fill in words like that. Biggest problem I have in writing. I can proof read it and I still don't see it.
 
8:01 PM
@PeeHaa Trick question. PHP 5 has never been exceptional
 
@Trowski :)
@Machavity lol!
 
Anonymous
@Danack what is a "user space code"?
 
@samaYo not internal.
 
The last heading and the paragraph following that are straneg, but that is mostly because of the use of Error I think
Now if it would have been ErrorException... / me ducks for cover
> User space code in PHP 7 is free to create Error
Oh boy I can make errors \o/
:P
 
8:03 PM
@marcio nice… what's your test.php?
 
@bwoebi Tets or GTFO
 
:>
 
:-)
 
@bwoebi @PeeHaa GTFO ^^ it's gone with a rebase
 
bugs.php.net/bug.php?id=69906 … errr … is Anatol trying to fuck up my code which relies on chr() implicitly doing a & 0xFF
 
8:06 PM
@bwoebi The __toString change turned out to be rather involved
 
@NikiC hmm, why?
 
a) updating tests and b) exception safe code is not always so simple ^^
 
@Trowski Which behavior later?
 
@NikiC not sure how many tests test that^^
 
@kelunik Exceptions thrown from the generator are thrown from methods on the generator.
If an exception could be thrown on creation, then you'd have to also handle potential exceptions at that point.
 
8:11 PM
@bwoebi there are a number of tests passing new stdClass to zpp
well, I also changed the current recoverable fatals to exceptions
that's where the test changes come from
 
ah okay… ^^
 
@Trowski Yes, sure, but I think that's a good thing. If you have argument checks that throw exceptions, you want them to throw upon creation, because that's where the error actually happens.
 
@Trowski btw this isn't something to correct, but I disagree with the paragraph "Error should be used to represent coding issues that cannot be solved at runtime" I think the difference is that the things under Error represent things that require a programmer to fix. A lot of the things under Exception are things that a sysadmin should be looking at. And yes, there are probably exceptions under Exception that should be moved to be under Error for that schema to be consistent....
 
@Danack I think we're on the same page. I could rephrase that to "Error should be used to represent issues that require a programmer to fix."
 
8:24 PM
There are a lot of Exceptions should be Errors now... like most of the LogicException branch.
@PeeHaa Hmm... seems the install of openssl doesn't support TLS1.1 or 1.2. I'd have to recompile a lot of stuff. The implementation isn't vulnerable to POODLE, so maybe I'll just wait.
I really don't have the time to play sysadmin right now.
 
and a wooly mammoth taking away its hat
now I am unsure about supporting that kickstarter campaign for a wooly elephpant
 
@Gordon flash required, stap
 
@Danack how about "error conditions that are predictable and therefore avoidable by changing the code"
 
Anonymous
 
Anonymous
Can someone star that ^^, it's worth sticking it here
 
8:36 PM
also, evening all
 
@marcio Flash sucks, but surely you do still have it? A whole bunch of internet doesn't work without it, it's not like it's Java...
 
Anonymous
evening @RonaldUlyssesSwanson
 
@samaYo Seems to be a blog post formatted as a git repo... sort of weird
 
@RonaldUlyssesSwanson meh......flaky network connections are predictable.
 
Also... while that guy seems to have spent a lot of time on that and done a not-bad job, I wish he'd put that time into doing it in the docs...
 
8:38 PM
@Trowski hmmmm wat!?
That can't be right?
 
Anonymous
@DaveRandom Yeah, I keep seeing lots of these. Very weird ... Next thing someone will post their biography :D
 
@PeeHaa It's running on OS X.
 
@Danack error conditions that ideally should not be handled but rather fixed by changing the code
 
@DaveRandom I uninstalled flash from all my computers. At first I felt like a vegan of the internet, but now most good stuff doesn't require it.
 
@Trowski PHP before 5.6 didn't support TLS>=1.1, OpenSSL has supported it since forever (effectively)
 
8:40 PM
@Trowski on os x I have 1.0.1j … what's your openssl version ?
 
> represent defects in the program (bugs) - often invalid arguments passed to a non-private method. To quote from The Java Programming Language, by Gosling, Arnold, and Holmes: "Unchecked runtime exceptions represent conditions that, generally speaking, reflect errors in your program's logic and cannot be reasonably recovered from at run time." (javapractices.com/topic/TopicAction.do?Id=129)
 
PHP didn't have bindings for it until 5.6, which Mr Lowrey sorted out pretty much single-handedly
 
@bwoebi The system one is 0.9.8zd, the brew installed one is 1.0.1j :)
 
@Trowski indeed, stupid brew
 
@RonaldUlyssesSwanson I really hope that is your real name because if it is then it's the best name I've ever seen
 
8:41 PM
I tried adding +TLSv1.1 +TLSv1.2 in the apache config, but that didn't work.
 
@DaveRandom :P
 
With the possible exception of Magnus Augustus Dewsbury, who was a guy I went to school with
 
@bwoebi I tried replacing the system-wide openssl once... had to reinstall OS X.
So... what am I doing wrong with apache then?
 
Also there was a kid in the year below called Drew Peacock, but that's just childish
 
Wes > Mario > FrontpageExpert > Worf > always me
 
8:43 PM
@Trowski putting in a lib with a different ABI is always a bad idea ^^
 
@Trowski Why didn't you take the opportunity to install a better OS? :-P
 
@RonaldUlyssesSwanson "things under Error represent things that require a programmer to fix. A lot of the things under Exception are things that a sysadmin should be looking at. " - I'm going to stand by that. That quote might be correct - but things like 'wrong username/password' is not recoverable at run-time, but doesn't require a programmer to look at, it requires a sys-admin
 
@DaveRandom in case you're wondering why: I did it on the week we saw adobe doing almost one security disclosure per day and a flash banner managed to open the developer tools from my browser and tried to execute javascript.
 
@RonaldUlyssesSwanson Ugh, you change the avatar as well, that's what gets me
 
FWIW The wes finder user style
.user-4251625 .username { color: red; }
.user-4251625 .username::after { content: '( AKA Wes )' }
 
8:43 PM
i'm sorry for the confusion but the fact this chat is so perfectly indexed by google is annoying
 
^^
@RonaldUlyssesSwanson it's nice… then you find things when you search them
 
@marcio Any specific reason why you starred that many repos on GitHub the last two days? My news stream is full of that. ^^
 
@marcio Meh, one sec disclosure per day just means they found them. Everything has those issues, you just don't hear about them until (nice) people find them. I bet you still run a million things based on OpenSSL...
 
@bwoebi Yeah, we'll call it a learning experience.
 
8:45 PM
why is this moving the function to a completely different section:
echo"<td>". make_link('Home', 'body_div' , 'other/page_loader.php', '?') ."</td>";
 
So... if I use the system installed version of apache, can I not use TLS 1.2?
 
@PeeHaa lol, actually might add that to TM
 
@kelunik starred ~12 repos in two days, is that too much? :3
2
 
@DaveRandom TM?
 
TamperMonkey
 
8:47 PM
Ah. Didn't know TM also did styles. I have installed Stylish for that
 
@marcio There are some others, but it fills a screen :P
 
Is alpha2 likely to land tomorrow or not?
 
@kelunik go follow more active people so you will see other stuff too ^^
 
ow wait no it's 3 days, my brain isn't working
 
8:49 PM
@DaveRandom At least it's already branched
 
@php_purest My guess is that make_link() produces output, and you have output buffering issues
 
@marcio @rdlowrey and @bwoebi were not active during the weekend, no aerys changes to review. ;-)
 
Is that Wordpress or something?
 
@kelunik I was… just not working on Aerys^^
 
@NikiC Yeh I was looking at the alpha1 pin and somehow came up with 23 - 12 = 13, I probably shouldn't be in charge of a computer
 
8:50 PM
@DaveRandom it's going to div box that refreshes every few
 
@DaveRandom you mean 2 days?
 
@Danack it's close. but i would avoid using "sysadmin" because its definition is very generic
 
Well, I forgot that only comments are shown in that steam, no commits.
 
ah well^^
 
@DaveRandom it's not meh, the javascript console opened by itself because of a flash advertisement served by google ads, it was scary. And judging by the flash disclosure history it seemed to be the best attitude to simply drop it :P
 
8:51 PM
@RonaldUlyssesSwanson No it's not.
 
@marcio Fair enough, but right now it feels sort of like disabling JS, which I know some sadists do, but I like to live dangerously, by which I mean I trust that UAC is not going to let anything really bad happen. That might be foolish but after several years of not getting bitten by this approach I'm going to keep doing it.
 
@kelunik I won't reduce my starring frenzy on github, sorry, but I promise to only stare relatively useful stuff.
 
@marcio It's fine as is, there are useful things in there. :)
 
eww, @kelunik uses the horrible way of italicising things
:-P
*italics* ftw
 
@NikiC thanks :-) I like these changes :-)
 
8:54 PM
this is a weird looking blue elephant: armorgames.ecwid.com/#!/Blue-Elephant/p/48323148/…
 
What the shit is that???
 
@DaveRandom No, rather *_italics_*, just to emphasize it even more.
 
It's staring into my soul...
2
BOLD CAPITALISED ITALICS LET EVERYONE KNOW YOU ARE WORTH LISTENING TO
7
 
Anonymous
the amount of time @DaveRandom's comment gets starred in this room is .. just insane.
 
@DaveRandom only flash stuff I used was youtube and a few other things that have great HTML5 support in place, so no regrets here. Mileage may vary, as you said it's very necessary for you.
 
9:00 PM
@samaYo yeah… let's add a star :-)
 
@Danack then maybe is not that known. every person that identifies itself as "sysadmin" i know does a great range of tasks
but the point is valid
 
@DaveRandom I think it's good you're not allowed to use headings here. Maybe I should remove them from amp-chat. :P
 
Does one-boxing of gists work?
The faq says it does...but it doesn't appear to.
 
They may have nuked it, it tended to render as 2 screen heights
 
Well, I certainly wasn't planning to do that....
 
9:07 PM
yeh, they seem to have killed it
Unless the gh API is down
 
Anonymous
@kelunik kill it with fire Also, I don't see any templa-THING there, just caching ...
 
@marcio I just checked and my work machine doesn't actually have flash on it and I just never noticed so... yeh. Might disable it and see how I get on.
 
@PeeHaa :( also @salathe could have looked at it, iirc?
 
@kelunik Yeh that sounds like a recipe for people breaking shit. Although @MadaraUchiha has found all sorts of weird and wonderful ways to break SO chat in the past so might not help anyway
 
@samaYo I won't kill it. :P
 
9:11 PM
/me goes to do some washing up
 
Who hath spoken my name?
 
@PeeHaa i still have to update the pr. it's like 2931120 commits behind
 
@kelunik indeed… kill that line with fire… you should cache the compiled code, not the raw text.
like… wrapping it in a Closure.
 
@bwoebi That's your code. :P
 
@RonaldUlyssesSwanson Well technically everybody can look at it ;)
 
9:16 PM
@kelunik yes… for web SAPI usage.
where you never re-run the code
 
@bwoebi It's just the same with a include in a for loop in the web SAPI. ;-)
 
Anonymous
@kelunik I'm curious, b/c I've been searching for a templating library with inheritance support which is neither Twig nor Smarty ... Is that what you have in mind for that repo?
 
@kelunik include in a for loop? I'm scared.
 
@samaYo Nope, it's just using plain PHP template mode.
@bwoebi If you want to use something like a result template in multiple places, that's probably the way to go?
 
@kelunik result template?
 
9:21 PM
@bwoebi "result" was just some example.
 
Can we please deprecate that shit named create_function?
 
@bwoebi that's a nice idea for a cleanup RFC.
 
blah
 
@bwoebi totally
 
without RFC in 7.0?
 
9:31 PM
nah
 
(well, we'd mail internals and wait for opinions first… but without formal process)
 
improbable
while you're at it, deprecate static closures too.
 
we need a list of things which still need depreciation
to do a batch RFC deprecating them in 7.1
 
Anonymous
imho if there really is a good time to deprecate anything without worrying of BC breaks, it's NOW.
 
Anonymous
+ I would get rid of spl_autoload() & phpcredits() :)
 
9:44 PM
i would also start deprecating certain features of sessions, like urlrewriting
 
@RonaldUlyssesSwanson just ping Yasuo, hehe
 
and calendar which i only know because once i did var_dump(get_loaded_extensions())
i lol every time
@bwoebi i believe someone in here started looking at it, but i don't remember who
 
... I believe Bob is playing horrible games with you
 
@marcio o_O
 
9:48 PM
do you guys use the session ext?
because i've always used cookies, literally always
 
@RonaldUlyssesSwanson ?
 
@RonaldUlyssesSwanson It's been some time… as I haven't started a web SAPI project for some time…
 
but yes, I usually use ext/session.
 
4 mins ago, by bwoebi
@RonaldUlyssesSwanson just ping Yasuo, hehe
 
9:49 PM
Why wouldn't you use session ext?
 
@marcio Just indicating that Yasuo seemed to care a lot about that ext
 
it looks fragile because it has in it stuff that is very old
 
O.o
 
and also i find the api confusing. or not as simple as just handling the session myself
 
And how are you handling the session yourself (including the data)?
 
9:54 PM
i guess exactly the same of what the session ext would do, using a cookie
 
That is not how sessions work ;)
The cookie only stores the session id
 
yes, that
data is not handled by the session itself but rather stored in the database where it belongs
 
Ah so you are talking about a custom session handler?
 
yes, i guess :P
i don't store sensible data in cookies, if you are wondering
 
*sensitive
Although in your case it might as well be sensible :P
:D
 
9:57 PM
although the login system i'm using is probably not the most secure
:P
 
As long as your cookie is super-duper secure, by encrypting a cookie and bloating your response/request headers, you're fine ;)
 
i use a remember me cookie. occasionally i change the session id (like each 30 page views)
 
Oh, yeah, you've just added at lest 30 iotas of security with that :p
 
@SebastianBergmann TypeError: Argument 1 passed to PHPUnit_Framework_TestCase::onNotSuccessfulTest() must be an instance of Exception, instance of ParseError given, called in Framework/TestCase.php on line 851. That type hint may have to be dropped, class alias of internal classes is unfortunately not allowed. :/
 
10:00 PM
@Sherif Let's use UDP for HTTP :>
 
@RonaldUlyssesSwanson Why would you do that? You are running on tls right? :)
 
@bwoebi Let's. Who gives a shit if you get a response back or not. Half of the Web is broken anyway.
 
@RonaldUlyssesSwanson https
 
nope, http. i suck with this kind of things
but luckily i mostly do intranet stuff
 
10:01 PM
Client UA implementations should just make shit up if the datagram doesn't come back.
It's 50% likely to be more useful than what would actually come back at least 50% of the time.
 
@Sherif yeah, no. We merge the fundamentals of the TCP protocols into HTTP to use it via UDP and have stream integrity.
 
Is there a generics RFC in draft somewhere?
 
@Danack can we please postpone anything such until we decided about union types etc.? Thanks.
 
...
 
Anonymous
@RonaldUlyssesSwanson By contrast, I have never ever used cookies .. I wouldn't know how store anything in a cookie, if the world's fate depended in it. :/
 
Anonymous
10:04 PM
I distrust sessions LESS
 
@samaYo bad choice, hahah
 
Anonymous
:)
 
If you've used sessions, then you've more than likely used a cookie. Otherwise how would you keep track of the session state on the client. Unless you're talking about client-side session storage (i.e. HTML5 storage).
 
JSESSIONID=123456789
 
10:23 PM
@kelunik youtrack.jetbrains.com/issue/WI-26069 this ain't gonna get fixed, is it? :(
 
@RonaldUlyssesSwanson I don't know.
 
not for phpstorm 9, at least
 
10:41 PM
 
@salathe great! :D
i hope i didn't break anything :P how much will it take it to propagate to live site?
 
@RonaldUlyssesSwanson in theory, mirrors should update within an hour
 
ok, will monitor it then
 
@salathe <3
 
our visitors are pretty good at pointing out when things are broken :P
 
10:49 PM
/me prepares finger poitning to @RonaldUlyssesSwanson
 
works for me
 
Let me open in pron mode
 
maybe different mirror?
 
10:51 PM
yeap cache
php.net/manual/en/… was the worst because it hid the entire directive under the header
\o/
 
/'\
 
^:)
 
dammit, spoiled my ASCII art
 
Should be /|\ though ;)
 
10:53 PM
lol
 
hahaha
 
i'm preparing another pr @salathe :P i can improve it now that i see it live
 
hahaha - convicted child molester
 
Finally, habemus stable Maybe monad in PHP. :3
https://packagist.org/packages/haskellcamargo/php-maybe-monad
 
10:59 PM
@RonaldUlyssesSwanson coolio, this one might get merged quicker :P
 
@Danack Nobody is perfect
OMFG How did I mess this one
PHP 7 - FIVE THINGS YOU NEED TO KNOW: 1. IT’S COMING THIS YEAR 2. IT’S STILL PHP 3. THINNEST LIGHTEST PHP YET 5. WE CAN’T COUNT
11
 
@kelunik \o/
 
LOL
 
Goddamn I love that twitter account
 
11:23 PM
WE SPENT 18 MONTHS MIGRATING FROM A MONOLITH TO MICROSERVICES RESULT: - GITHUB GETS PAID FOR MORE PRIVATE REPOS - FIND/REPLACE IS HARDER
 

« first day (1711 days earlier)      last day (3242 days later) »