« first day (1664 days earlier)      last day (3283 days later) » 

8:00 PM
final private: 3v4l.org/QNsfk vs 3v4l.org/3OLNr
 
@LeviMorrison Correct
@ircmaxell Oh weird, final private works
^^ That's the answer then.
 
why weird?
 
@ircmaxell YES YES!
 
why does final private work at all?!?
 
why doesn't it work?
 
8:02 PM
I would've assumed that because the member is private, that it'd be overridable in subtypes regardless of whether it was declared final
 
could you even instantiate that class?
 
you can override a private method, you just can't call it
 
/me adds it to the list of "to do everywhere"
@ircmaxell you mean s/final/private
 
^^
 
8:04 PM
@ircmaxell what's the point of a private final method? final makes sense when having an hierarchy… but private lives outside of the hierarchy… it's class specific
 
preventing someone from making another method by the same name
 
My thinking was, type A has final private method foo, type B extends A and defines private method foo when the type hierarchy is checked, since A's privates are unknown to B, then any private method should be overridable, whether defined final or not ... rather, what @bwoebi said
 
which generally is pretty useless, except for the case of constructors or magic methods
 
PHP's idea of OOP isn't what you think it is. :)
 
^^
 
8:06 PM
@ircmaxell Why the hell would you do that and what sense does it make in OOP a sane class model?
 
Actually....
PHP's idea of _____ isn't what you think it is.
 
Ooh, ooh, can I fill in the blank?
I think we need a longer line though...
 
@bwoebi why would allowing an override make it "oop"?
~whisper~ "oop" ~whisper~
 
All class methods in PHP are inherently virtual, even the private ones.
 
HTML5 OOP SOAP STATIC CRM MAGIC DEBUG TOAST BANANA KEYBOARD
 
8:07 PM
@Ocramius it doesn't make it oop. It just is part of a sane class model.
 
@DanLugg now we're talking
@bwoebi final by default is a sane class model IMO
 
So if I do: $this->someMethod(); and on my current class someMethod() is private, I may still wind up calling my child's protected someMethog()
 
@bwoebi in most cases it doesn't make sense. In the case of constructors tho, it may
 
@Ocramius That's how I feel some people hear me
 
Yes, it's madness.
It's PHP
 
8:08 PM
@ircmaxell Any use case?
 
@DanLugg's
 
Which is faking enums
 
I like
 
to fake enums… Make the enum classes final?
 
Big butts? Bad timing is bad.
 
8:10 PM
hummmmmmm would inline function fn(){} be a thing in PHP? I've seen some crazy annotation based @inline in python and got myself wondering about it...
 
@bwoebi Yes, but I've got a base with a static method defined to get a map of the constants.
 
... and?
 
@Sara wut
 
@DanLugg Then we just end up with having no ctor at all on a class
 
Right, but for the sake of being an asshole, I'm making them uninstantiable
 
8:11 PM
@DanLugg no, that doesn't work?
to make them uninstantiable you need a private ctor on that class
 
Well, it does with a final private function __construct() { } on the base class because PHP's in-sane class model checks up the tree for private members.
 
no, it checks up the tree for final members
 
^^ ... and private doesn't exclude it from the check.
 
as it shouldn't
 
oh wow.
 
8:14 PM
@ircmaxell I disagree with that, honestly. Despite it working to my benefit.
 
> error: initializer element is not constant
Oh dear. I don't want to fix these.
We should move to C99
lol
 
... if a function has no state, static variables, it's not hard to have inline
 
@LeviMorrison where for example?
 
Tons of these:
/tmp/php-src/ext/spl/spl_directory.c:1914:2: error: (near initialization for ‘spl_SplFileInfo_functions[0].handler’)
/tmp/php-src/ext/spl/spl_directory.c:1915:2: error: initializer element is not constant
  SPL_ME(SplFileInfo,       getPath,       arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
 
@marcio I'm planning on working on it
 
8:16 PM
I have some like this too:
/tmp/php-src/ext/spl/spl_directory.c:1755:13: error: invalid storage class for function ‘spl_filesystem_tree_it_current_key’
 static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key)
 
@LeviMorrison what does that error even mean?
 
@NikiC Never mind, I appear to be full of crap.
 
@ircmaxell you mean a userland explicit inline or a general AST optimization pass that inlines functions automagically when possible?
 
@bwoebi I think it might have to do with the static keyword. I don't know yet, really.
 
@marcio both
 
8:18 PM
very cool :)
this might fix the "functions are too expensive" cry
 
@Sara Just tried it: 3v4l.org/rOtPn Yeah, still calls the one in the same class
 
@NikiC is that correct? :o
 
Citation style guides suck. They should just say that it's "whatever their bibtex template spews out" rather than trying to describe things in words.
 
@NikiC Yeah, I don't know how to write PHP code. :p
 
how goes it, folks
 
8:24 PM
@Sara :-X
 
@bwoebi All of the research I've done points to a type of error we don't have :/
 
@Worf that's the only I'd ever expect
@LeviMorrison wat … :-D
 
Everything I find on it looks like this:
static void foo();
In a local block (not a forward declare)
That is not what any of these are.
:/
Ah! I found it!
 
@bwoebi yes, at a second thought it looks fine
 
An error when removing a // comment
 
8:30 PM
@LeviMorrison Please don't make the code C89 compatible
The bit about us already using a bunch of C99 stuff is a very nice argument :)
 
@NikiC I'm not… not exactly.
I'm actually make a case for C99.
 
@NikiC And now use struct initializers for zend_string * ;-)
 
And to be honest we use a lot of C99 stuff.
By the way, Dmitry is the culprit for all these // TODO: ??? comments.
shakes fist
 
yeah the ??? comments are from phpng porting mainly
Stuff that needs to be checked to make sure it's actually correct
 
They are all over.
It's amazing there aren't more bugs.
 
8:35 PM
@LeviMorrison There's a reason why we have a testsuite… but yeah… I'm sure we'll still have some missing DEREF bugs upon release
 
@LeviMorrison To a large part it's also about potential optimization opportunities and particularly ugly bits of BC code
 
8:52 PM
@LeviMorrison "It's amazing there aren't more bugs" found yet.
 
…what is this file ext/standard/var_unserializer.re?
…and I have tests running now for PHP built with -std=c89 \o/
No new failures \o/
 
9:08 PM
@LeviMorrison I wish we were forced to use c99 /°\
 
@LeviMorrison It's the source code for the c file - You haven't crossed re2c.org before?
 
@Danack Just never seen the .re before I guess
 
… I just still haven't understood the difference between .re and .l …
 
Or blanked it out from your memory....
 
@bwoebi I nearly have a patch that compares going to C89 and C99
(Spoiler: C99 is way easier)
(And then we can use zend_string* at compile-time!)
 
9:09 PM
@LeviMorrison you even need a patch for C99?
What's not C99 compatible in current code?
 
Yes.
Namely uint doesn't exist.
Neither does u_char
That's pretty much it.
(those have to be done for C89 as well)
 
well, that's not related to C99 but rather to some headers
 
No, that's not headers.
Those types do not exist
 
How does it then even compile?
 
@bwoebi gcc itself defines them, but not when compiling against any standard.
 
9:12 PM
 
The real facepalm is why these types are even used.
 
[That was a double facepalm for both, btw.]
 
Size of the C89 diff: 141K
Size of the C99 diff: 96K
Additionally C99 compatibility was done completely by sed and grep
 
9:24 PM
G'night, sweet princes.
 
I wish we could use anonymous structs and unions.
 
this is just perfect
 
9:41 PM
hello
these book about that is?
 
10:03 PM
What can I do if I want to use something like a $_session, that I want to stay on the server?
 
Anonymous
10:26 PM
@phpPluginMaster paraphrase your question
 
@phpPluginMaster Session data stays on the server. Only the cookie that stores the sessions ID gets sent to the client.
 
@Danack are env variables unique to each user, but kept on the server?
 
@phpPluginMaster environment variables aren't, but they're completely separate from session data.
 
how can i keep a session var on the server?
 
@phpPluginMaster Why not read the manual in particular the examples of sessions usage: php.net/manual/en/session.examples.php
 
10:37 PM
i'm tying to figure out how to use a variable type that doesn't touch the database, is unique to each user, and lives on the server
no database - if a lot of clients, too fast
unique to each user - doesn't ruin the site vars for other users
lives on the server - won't be edited by users
 
@phpPluginMaster Yes, that is what session data is used for.
 
do you have to preserve state between requests for particular user?
 
so sessions don't get put in a cookie?
some data, yes
 
yes
session is not put in cookie
 
@phpPluginMaster Please; just read the manual on them?
 
10:41 PM
i read somewhere it was
 
@Danack do you have an opinion when it comes to controllers and the amount of actions in them?
 
@ziGi Not a strong one. I have actually been thinking about that a little - I think the problem we're making for ourselves in PHP is that what we're doing is:
 
$_session is kept on the ram also :D
 
Fuck it. No C89, no C99, no C11. C++14, bitches.
 
i) pipping everything through a front controller, which does some routing
ii) Dispatching the route to a controller.
iii) Feeling 'icky' when the controller is 'doing too much'
 
10:44 PM
Hell, C++17, because YOLO
 
@Danack ?
 
@Sara Nah… if it were YOLO, then you'd use your own C++ fork :-)
 
@Sara Why not use Rust? :)
 
If we turned it around and made each endpoint on the server be a separate application - the front-controller would disappear, and the controllers that before appeared to be doing 'too much', would just be normal programs, that are free to do as much as they want.
 
@Danack you mean piping?
 
10:46 PM
i'm looking to put a note in the user manual of:

The best way to understand $_SESSION is:
no database - if a lot of clients, too fast
unique to each user - doesn't ruin the site vars for other users
lives on the server - won't be edited by users
Kept in the RAM - quicker access by the server
 
To be honest I think writing a VM in Rust is probably nice.
 
@Danack yes, if you are masochistic enough, you could even put different routes on different servers, so for example when you read the users it goes to server A, if you read some list it goes to server B if you delete a user it goes to server C
etc
 
@ziGi Unix piping? no...I just mean dispatching/routing to a controller hides the fact that what is in the controller could be considered a separate program.
@ziGi s/masochistic/need to choose a different programming language. e.g. php is not a good language for and end point that accepts video files.
 
@Danack I guess so
 
@Sara Surely C++2x ?
The x makes it sound cool.
 
10:49 PM
What's your opinion on Go?
 
would it be incorrect to refer to the perceived order of described events seeming out of order as an anachronism or form thereof?
 
@ziGi And I definitely think it's a mistake to try to avoid controllers 'doing too much' by combining lots of services together to reduce the amount of code called by a controller, example incoming....
 
Routing should be by the server or SAPI.
 
As in, the perceived story has chronological inconsistency; and as such when reconstructed becomes impossible.
@LeviMorrison I can get on board with that
 
@LeviMorrison I disagree. About calling that an unpopular opinion.
 
10:51 PM
^^
 
Oh how nice. It seems it's less unpopular this time around ^^
 
I would say how it's implemented could go either way though, from popular to not
 
The only thing that sucks about the server or SAPI doing it is that it's harder to switch to other servers or sapis.
 
It would need a solid user land API
 
I don't think anyone has demonstrated a FastCGI impl in PHP that let's you call FastCGI::accept() in PHP-land.
 
10:53 PM
I dunno, if PHP had a core fallback implementation, which could otherwise dispatch to the SAPI when able, that'd be nifty
When able being ini dependent or somethibg
 
It'd be lovely if you could set up all the routes for all requests at daemon startup. All that router overhead would significantly reduce.
 
Especially when you write bloated routers like me
 
It's not uncommon to spend a decent portion of your overall response time routing if you do it in PHP-land.
 
@LeviMorrison The only issue is when the SAPI or server routing suck.
 
I am still wondering why Laravel is considered the best framework for 2015
 
10:54 PM
@ziGi To be honest the bar is quite low for best frameworks.
 
Because 2015 is just as shitty a year as 2014
 
Ahaha, such springing optimism :D
 
@LeviMorrison really… with Apache SAPI doing you're nearly forced to do your own routing :x:x:x
 
I need a belt with pockets; I need to clean my apartment, but it's far too warm for pants and I work better with headphones.
I could tape my phone to my buttock...
 
Any shirts with pockets?
 
11:38 PM
@ziGi This is actually not a great example, as it's too abstract - But I think it shows what not to do: gist.github.com/Danack/4b973ddec0d641b0aecc
 

« first day (1664 days earlier)      last day (3283 days later) »