« first day (1845 days earlier)      last day (3109 days later) » 

6:00 PM
@bwoebi TLS 1.1 is fine, too, just not TLS 1.0
And it doesn't work in production mode, only in debug mode...
 
@kelunik why?
 
@bwoebi ERR_CONNECTION_RESET otherwise.
 
@rdlowrey what was the reason why we don't read on stdout/stderr pipes but on a socket for logging?
 
6:16 PM
If local_cert is read a second time anyway, then there's no disadvantage to use local_pk, right?
 
right.
I am wondering whether one can peek into client hello whether a h2 alpn is there and then switch minimum requirements…
 
Hey Folks. I'm writing a framework for learning and personal sites.
I'm using clean URLs (htaccess removes extension).
My router class determines which file to load based on the URI - eg "example.com/about/" the file required would be "about". I'm currently hard coding as .php (eg "about.php") but I want the router class to be able to dynamically serve different file types - (eg) "about.php" OR "about.jpg", but without the extension in the URL I cannot identify the exact file to be loaded.
Any ideas or pointers in the right direction?
 
@James use a frontend controller using a router like fastroute and serve images and other static files with their extension
 
@James Why are you stripping extensions?
 
@kelunik I do have a basic front controller - everything sent to index.php, but htaccess removes the extension before FC is loaded. Hmm...can htaccess just remove php and leave others (jpg etc)?
@Ghedipunk For clean URLs - example.com/about/ instead of example.com/about.php
 
6:32 PM
Why is that being done by your htaccess rules?
Or rather, why are you modifying the data that your user is sending before you've validated it?
If I didn't have a route for /about.php, then I'd serve a 404, I wouldn't redirect to /about/
 
@Ghedipunk Because AFAIK it can only be done with htaccess - can PHP rewrite URLs?
 
From what you've said so far, what I get is that:
You have an index.php file that routes your requests.
In that router, if it sees the request is for "`/about/`" it will attempt to load the file `/var/www/htdocs/about.*` (currently hard coded to `about.php`
It is also possible to have a file `/var/www/htdocs/about.png` that, under your idealized router, would be a valid but ambiguous target for `/about/`

Am I on the right track?
(Leaving the dead backticks, because at least people will see what I'm getting at, even if the parser doesn't)
 
Huh, @rdlowrey changed from No to Yes on void.
 
user895378
@bwoebi because windows
 
user895378
@Andrea yes I did.
 
user895378
6:41 PM
Yitz convinced me in the office earlier in the afternoon.
 
@rdlowrey how did he?
 
@Ghedipunk Yes (although specifically: index->bootstrap->router) "would be a valid but ambiguous target for /about/" currently ambiguous yes, which is what I'm trying to fix and ID the filetype/extension so can serve a specific file.
 
If any of you are interested in earning some points stackoverflow.com/questions/33529625/…
 
@rdlowrey I see. I'm curious to know their reasoning
 
Hello everyone! Can someone help me with a CQRS matter?
 
6:49 PM
That would break a few things, beyond the issues that you're already having. Apache and a few other web servers use the file extensions as hints for what to put in the content type header, and rewriting the request URI to strip extensions will have unexpected results. It also breaks the least astonishment principle; users are used to having file extensions for static resources, such as images, scripts, and stylesheets, as well as static HTML pages.
And, you're breaking a security principle; you're sanitizing input. You should only validate input, and do not sanitize anything until it becomes output, either to your database, to an API, or to the browser.
 
How come people in stack overflow tell you to read the manual...jesus...if everything was the manual then what is stackoverflow for lol
 
In this case, if someone requests /about.php, and you only have a /about/ route, you should not change their URL, you should let the user know that their request is malformed with a 4xx error, in this case a 404.
 
@Asperger for things that aren't in the manual
 
@NikiC but for example in my case I got lost or missunderstood things so I ask a question and what I get is: read the manual
It feels like some people are exercising their power here
 
@Ghedipunk I'm re-reading through what you wrote, thanks. Surely no-one will request "about.php" because it's not correct, the correct URL is "/about/" In the same vein as requesting "contact.php" and expecting "about.php"?
 
6:54 PM
@Asperger As a rule of thumb, ask on SO if the question is hard.
 
@NikiC but what about starters?
 
@Asperger That's what searching SO is for.
 
Not everyone knows how to ask hard questions
Indeed, but sometimes you simply dont find what you are looking for specifically.
 
@Asperger Okay, let's put it differently. If you haven't worked for at least one hour on a problem, don't ask on SO.
 
For further explanation of broad topics, pop into chat after failing to understand the manual... That's what I do, and why so many people here are tired of me. ;-)
 
6:57 PM
Programming is all about figuring out problems on your own (or rather, with your good friend Google). Popping on SO for basic questions doesn't really help anyone.
 
Ya but why are people so strict in that regard? It gives you the feeling that they are stackoverflow employees. They see you have done a lot of prior work and still well....In my case im on it for nearly a day...typical producer/programmer block
 
When you know that you didn't understand something, you need real time feedback, so that people can get an idea of where your assumptions have gone wrong... Best done in person, preferably with a friend... but in a real pinch, chat might help. After that, a forum might help, since there's at least somewhat of a conversational tone there, but a QA site is likely to be the least helpful.
 
Usually im fine at my own but you know, as understanding OOP in php it is a bit confusing at first since I come from JS
 
@Asperger Sure SO is for asking a question about something you're stuck with, but not really for asking someone to explain the manual - this being Q&A essentially the answer already exists (on php.net). I agree the manual can be a bit terse for something complex, so you need blogs/guide sites (or a forum) which go through the same content in more detail and different words/different approach :)
 
@James oh well, I need to learn to pull myself together :)
@James but you know, the response here is not aggressive or in any way arrogant. It is clear and friendly but in my latest PHP question they were really unfriendly.
My last JS question got 11 upvotes and 140 views though
 
7:07 PM
terse/to the point != "unfriendly" ;)
 
@James actually you are right.
But they give off a sense of "I am an employee"
Hard to explain.
 
@Asperger I think you got a particularly bad response there, because your code contains syntax errors
Syntax errors in the code usually means that the poster hasn't put any effort at all into the question.
 
I'm writing a library that is meant to be open sourced. I'd like to introduce events for pluggable behavior. Default choice for that would be Symfony's EventDispatcher, but I'd like to hide it behind library code and provide as one of the implementations. Should I do that or am I overengineering?
 
@NikiC believe me, I spent over 5 hours on this. Hard to believe, but ya.
 
@Andrea for what it is worth, though I am voting no it's not like it's a big deal. It's a small deal that I wish you would have actually listened to me on, or at least worked with me and waited so I could propose union types.
I honestly think we'll end up with null and void, and I don't think that's good. It's not end-of-the-world bad, though.
 
Anonymous
7:16 PM
@NikiC how hard is it to use your AST library to create code quality analyzer?
 
Anonymous
I can't find a better alternative
 
@TomaszKowalczyk Depends on who your target audience is. If it's for developers, then you want interfaces, not layers of obfuscation. If it's for designers who might get hurt by thinking about bubble sort too hard, then hide every layer you can.
 
@samayo What kind of "code quality" are you thinking about?
 
@samayo Several code quality analyzers already exist for PHP; can it simply be done with those tools?
 
@NikiC for example checking the intro and basics section the manual never mentioned the difference between :: and ->
 
Anonymous
7:18 PM
@NikiC to start out, a simple syntax based analyzers. Checking for class naming conversions, class-per-file, no closing tag ... simple things
 
@samayo Those sounds pretty simple
 
@Ghedipunk it's a library for developers (take a look at the library and prototype of what I want to achieve: github.com/thunderer/Shortcode/compare/runtime-events ), but I'm worried about wiring Symfony's code as the hard dependency. I'm torn between saying "it won't change, KISS" and introducing my own EventListenerInterface, EventDispatcherInterface and creating a SymfonyEventDispatcher which will be a default implementation and will allow to provide different impementations.
 
Anonymous
@LeviMorrison Yes something like this squizlabs.github.io/PHP_CodeSniffer but I want to make my own with much fewer topics to inspect.
 
@samayo Just for fun?
 
Anonymous
@LeviMorrison Yeah.
 
7:26 PM
they write about inheritance but not how to extend a new class
like extending x = new y(parameters)
 
ThW
7:38 PM
@Asperger in PHP (and many other language you define and extend classes), after that you create an instance of them - an object - and use them. The class is an blueprint for the object. In Javascript you define and extend prototype objects, then you're using the defined object as a template and create the actual instance/object that you work with.
 
I have no idea why but this query doesn't fail but neither does what it shall do:
however copy pasting the query to PHPMyAdmin and running it works.. yet then activating a customer on the page using that call also works.
it just only doesn't "deactivate" a user.
 
So I've been having problems configuring the ZfcUser module in ZF2 on IIS. Is anyone familiar with the ZfcUser module?
 
@MikeM. why don't you use "real bool" in your conditionals?
 
Because the runQuery returns either false or true and will not return an exception.
 
if (false !== foo()) { ... }
 
7:46 PM
But there is no check for false required.
 
and why so many static things there? Why not just use a \PDO object?
 
That's fluently off-topic.
I am trying to play a bit with classing and PDO Wrapping.
This is actually just a PDO wrapper I made and play with.
But that has nothing to do with why :status => 1 works and :status => 0 "fails" - not updates yet passes without errors.
 
does anything else change except the status column?
 
btw: /klant.php?id=4&o=switchStatus&c=0
is how the request is being made
Nope
 
show var_dump(DatabaseConnection::getHistory()) from when status is 1
 
7:51 PM
btw I removed the '`' to check if that could be an issue.
but nah.
weird shit :P
 
you removed two backticks and the number of characters dropped by 4
 
ye
both backticks will be automaticly be removed in ORGIGIONAL and FILLED index.
so 2 * 2 = 4 :-)
 
bytes != characters.
 
@ThW here is the thing, I know how to extend classes but extending a new instance of the class to be extended
not sure how to do that
 
I'm having a charset problem (I think) tranforming markdown into html with michelf\php-markdown. the [github page](https://github.com/michelf/php-markdown) doesn't seem to indicate how to use a specific charset, but the transformed html source code shows &lt and &gt instead of < and >. Am I on the wrong course? Should I really be transforming .md files into html code manually?

Setting no_entities to true as hinted [here](https://michelf.ca/projects/php-markdown/configuration/) actually doesn't transform the entities.
 
7:59 PM
@LeviMorrison we should end up with one or the other, not both
and the decision is up to you. Don't allow null standalone
 
I am so freaking confused...
 
@MikeM. var_dump("UPDATE customers` SET active = 1 WHERE customer_id=4;"); \\string(56) "UPDATE customers SET active = 1 WHERE customer_id=4;"`
 
/me is using stream_socket_recvfrom() with MSG_PEEK to analyze raw TLS traffic and has probably no idea what he's doing………
 
Ok guys, please bear with me: pastebin.com/3GweXKkZ
Here is what utterly confuses me and I simply cant find any info on this
 
huh?
 
8:03 PM
or im searching wrong
 
@MikeM. strlen on your query returns 56
 
@iroegbu ye...
 
why is it 54 in your var_dump?
 
@Asperger it's not how it works. once created, an instance can't be merged with another one. unless you assign it to a property of the other class
 
because as I said, I removed 2 backticks to test if that worked.
56 - 2 = 54 as the query says String (54)
 
8:05 PM
@FélixGagnon-Grenier it works with JS prototypes
 
yeah, but not in php :)
 
Damn, thats bad news for me : (
 
Morning guys
I have a WP question
 
@FélixGagnon-Grenier well im honestly lost there and I cant find any examples online
 
even when I return the execute it returns bool(true)
 
8:07 PM
what are you trying to do. what is the logical application of trying and extending an already existing object? @Asperger
 
@MikeM. if you run 'UPDATE customers SET active = 1 WHERE customer_id=4;" in DB console what's the result?
 
@FélixGagnon-Grenier here is the code I submitted eval.in/463098
well for example, I know this is rarely used but, I want to create two instances of Main with two different connections
 
basic idea is pastebin.com/Y9HBxwaf @Asperger
hum... heard of dependency injection yet? You should be passing the connection object to your Main
that way, you can create many Main's with different conenctions if need be
 
Ya I thought about that too
 
if I run:
"UPDATE customers SET active = 1 WHERE customer_id=4;" it won't edit anything because active is already set to 1
"UPDATE customers SET active = 0 WHERE customer_id=4;" (WILL SUCCEED IN THE DB CONSOLE) where it "fails" in the script itselves will update it in the database, and will show a button towards:
/klant.php?id=4&o=switchStatus&c=1

When I click on that query with status 1 successfully runs and updates the database.
Now the customer is active, when clicking on the deactivate button
I actually think it's the bit(1) column whose having issues with the 0 value
or so being allocated by a PDO connection
Because my advanced editor neither works on bit values.
 
8:17 PM
what is the column type?
 
bit(1)
but wait, shouldn't it fail in phpmyadmin aswell then?
because the number 2 also fails
hmm it fails on editing int & bit values but not on string values.
it neither fails on my timestamp value
 
@salathe Any word on the OSS license for PhpStorm?
 
this is some weird shit.
so I can change my dob timestamp
I can change in-active customers to active but not back.
I can't change customer subscriptions and I can't change their payment method...
 
am I the only one finding the new code coloring of phpstorm 10 somewhat random? some variables white, some purple, as far as I can guess based on wether they're strings or classes...
 
it's really just the 0 - 1 - 2 part that gets messed up.
 
8:24 PM
@MikeM. use tinyint(1)
 
I will try that but then we still come to a point, why does it mess that up.
yup it fails on the BIT() datatype.
but then still why.
it neither updates my subscription_id hmmm, gotta look into that aswell xD
 
1 => 10000000 I guess
0 => 0
 
Could be ye.
but then still, it shall errors on phpmyadmin aswell, while it didn't and just pushed it correctly.
well atleast it helped me forward a bit thanks for that :-)
 
@ircmaxell I realized in the zend_type refactor I was doing that for the chain we don't need to do a linked list – we can simply use the new padding space that is there (presently a lot of it).
This would improve memory layout and locality.
 
never mind
it just doesn't select the option on the page ^_^
 
8:34 PM
typedef struct _zend_type {
	zend_uchar tag;
	zend_bool allows_null;
	// there are 48 bits of padding here on 64–bit and 16 bits on 32-bit
	zend_string * name;
 zend_type;
 
fixed finally
 
Given that this is a new construct we can limit it to a single byte and restrict the length of a union expression accordingly.
 
Thanks @iroegbu again for your time and your help o/
 
@Andrea Whether we allow it standalone or not we still have them both.
And no, it is not up to me.
Don't you dare play that card.
 
8:37 PM
It would full well be at least half your fault if we end up in that situation, perhaps more.
 
oh well. twig was actually trying to protect me from myself and encoded < characters in harmless &lt
 
Which is why I keep trying to get you to change your mind and see the sense. There is no need for void when we will hopefully have null for union types anyway.
Which is why you should have waited for union types.
I still don't know why you couldn't just wait.
There was absolutely no rush for this.
 
@LeviMorrison use an inline zend_string here maybe?
 
I should write a framework that obfuscates everything to the point where nobody can figure out the assumptions being made behind the scenes, and market it as a "pretty" framework. Oh wait, I think I just invented Laravel again.
 
If union types didn't pass then practically all resistance of the current RFC would be now be on your side.
It was in everyone's best interest to just wait.
Why wouldn't you do that?
It seriously irks me.
 
8:39 PM
@Levi well… they want nullables, not union types…………
 
And if union types fails then so would I.
 
so, from that perspective it make some sense.
 
This is my point. If union types fail then we can rally on the remaining RFCs.
 
@Levi just be quick on unions, before nullables RFC pops up.
2
 
It's not so simple.
Furthermore we are not in a rush.
 
8:42 PM
We aren't. But I'd really like large features like these to have the RFC in discussion still in 2015.
 
Which is probably doable.
 
It's up to you… and if you need help, you just have to ask for it.
 
@bwoebi What do you mean inline?
 
well, not a pointer.
 
It's going to be a union with a chain, so it wouldn't matter.
The padding will be there once the union is introduced.
 
8:44 PM
ah okay
 
typedef struct _zend_type {
	zend_uchar tag;
	zend_bool allows_null;
	// there are 48 bits of padding here on 64–bit and 16 bits on 32-bit
	union {
		zend_type * children;
		zend_string * name;
	};
 zend_type;
 
But there definitely are other places where 3 bytes are more important to save.
 
9:00 PM
> error: cannot initialize a member subobject of type 'int (*)[]' with an rvalue of type 'int (*)[4]'
Bummer.
 
posted on November 04, 2015 by nlecointre

/* by The coding love */

 
9:26 PM
Hi, I have a php code multidimensional array to upload files to wordpress user account. But the issues is it is accepting only 139 file not more.
 
ThW
That sounds like you run into memory or time limit problems
 
@LeviMorrison I mean that null doesn't exist as a type hint and it will probably be you who adds it
@LeviMorrison void and null are similar but different
 
null is a nothing. void is there had better not be something, right?
 
@bwoebi nullables is Levi's
I'm not sure if it would've been appropriate for the union types RFC to make null a standalone hint anyway
 
9:44 PM
it is because currently union types and nullable types together create ambiguities
 
like, the union types RFC should definitely add int|null but not standalone null, that would be contentious given void
 
and that's why he is upset, he thinks things could have been planned more before voting
 
Hmm
 
Abe
^ that
 
Yeah I see the problem now, I didn't before
 
9:48 PM
we already knew everybody would want a way to specify "empty" as a return type ^^ so basically, voters will take the first option put to vote
 
the problem, if it is one, is that whoever goes first here will win
 
yes, precisely :P
 
if union types had gone first we would have standalone null and any effort to add void would be defeated
 
Which is why I'd preferred some vote between both,
 
Yeah that would be ideal, I see that now
 
Abe
9:51 PM
a RFC to explain that? something like "keep the void rfc | change void to null | don't do anything"
 
wow, this discussion again
 
Hmm. What is the fair way to do a two-way vote?
 
Abe
@NikiC honestly i don't really care anymore :B
 
the fairest might be to hold a follow-up 2/3 vote to replace void with null
this way whatever solution wins has a 2/3 majority
 
@NikiC we are just a real time version of the mailing list D:
6
 
9:53 PM
but that would give void an unfair advantage probably
 
@Andrea It follows protocol
 
You know what? I don't think you can fairly have a two-way vote and satisfy 2/3 requirement
 
I was thinking about union types changing void to null, so we don't waste time with an intermediary RFC. But it puts union types into rush.
 
there's no rush
 
Or we can just admit that nobody wants that damn null.
 
9:55 PM
@NikiC s/null/void/ :-D
 
We're all aware of the interaction with union types and yet the result is as it is
 
also I'm not sure if two-way votes are good anyway. Make a good proposal and be opinionated
 
"We're all aware of the interaction with" < I have my doubts
 
Abe
@NikiC what if ..... everybody is wrong?
 
Of course everybody is wrong... The question is, who's more right, and who is willing enough to admit that they're wrong to be able to look at reality objectively?
 
9:57 PM
@marcio Did it come up on the mailing list?
 
It came up on the ML
 
hmm. I think I may have figured out how to do a fair 2-way vote
two simultaneous 2/3 votes and a 50%+1 vote
 
@Andrea To do a fair three-way vote you actually have to do a five-way vote
 
@Andrea first vote what people prefer and then vote for the preferred one.
 
There's basically the cases: "No", "Want void, okay with null", "Want null, okay with void", "Want void, not okay with null", "Want null, not okay with void" ;)
 
9:59 PM
or that, yep.
 

« first day (1845 days earlier)      last day (3109 days later) »