« first day (1749 days earlier)      last day (3203 days later) » 

5:05 PM
I get the feeling it would be the best idea to create an account and then let the user add his email address when he solved the tutorial or whatever.
 
I want to get information out of a json-variable like that: $resJson->answer[0]->somename[0]->value; This already works, but now I want to use a variable for "somename" and it doesn't work if I try it like this: $resJson->answer[0]->[$optStr][0]->value; Is there a special trick I need to do?
 
@Algram decode it as an array and then you can do $resJson['answer'][0][$somename][0].
Or use the variable syntax of $resJson->answer[0]->{$somename}[0]
 
@Danack the variable syntax worked, thanks again!
 
5:46 PM
Greetings
Here's something I've never seen: ideone.com/tsfl50
Can someone quickly explain what the living fudge is going on?
I can't make sense of it
 
@IsmaelMiguel It appears someone has written some stupid code that is really hard to read, that is what is happening.
 
I wrote the stupid code to understand the stupid behaviour
 
Then you should rewrite it, so that it's only doing one thing on a line, rather than trying to confuse yourself.
 
It's better now
Nevermind, found the bug
Thanks for the help
 
hey all
 
5:55 PM
ev'nin'
@PeeHaa y u flag??!!
 
@Danack ?
Did I miss something?
 
Nah - apparently someone thought that calling some code stupid was a flaggable thing.
 
Oh :)
I see now why Ismael is feeling bad for flagging :p
Holy shit. I just had another look. WTF
 
Yes.
 
@PeeHaa are you in my game and can you open a door for me? ^^
 
6:04 PM
@chozilla Does your game involve drinking beer? In that case the case the door is always open :-)
 
@PeeHaa beer is a 2.0 feature, :(
 
:-(
 
6:16 PM
Ugh, naming things sucks.
When naming subpackages, what's the best practice for naming common stuff, and as well an aggregate package? So..
Following <vendor>/<product>.<package>
<vendor>/<product> would be a placeholder package that has all subpackages as a dependency, and <vendor>/<product>.common would have common, top-level definitions.
Or should <vendor>/<product> contain the top-level definitions?
The issue I have with <vendor>/<product>.common is that the namespace doesn't map the same, as the NS is <vendor>\<product>, not <vendor>\<product>\common.
Thoughts?
 
@SebastianBergmann I am not aware of open issues... I guess pushing a beta to get some more testers would be great
 
6:33 PM
morning
 
Morning @Orangepill
 
Greetings. Guys.
 
o/
 
how do you add two values to a key value pair ex:: geo.position => 'latitude', 'longitude',
 
@DanLugg The composer name, the repo name, and the namespace don't have to be the same thing.
 
6:48 PM
@Charles I know, but as is my mantra: uniformity ftw.
 
anyone?
 
@Tsea Dude, if someone knows your question, then they will definately help you out. Just have patience or try something of own in meantime.
 
7:03 PM
@Tsea ['geo.position' => [$latitude, $longitude]] ?
 
Is there any ElasticSearch room
haha.
 
user895378
@Tsea There's no need to be rude.
 
sorry
 
@Tsea btw, Burn its for me.. I am just humorous..
 
user895378
1 message moved to Trash can
 
user895378
7:08 PM
1 message moved to Trash can
 
 [InvalidArgumentException]
 Command "satis.json" is not defined.
dafuq? php bin/satis satis.json web
 
I need to go and sit down and figure out if my "PHP is awful, but PHP 7 is a tiny bit better" CFP talk concept can actually be done in 50 minutes
 
^ /cc @Danack @rdlowrey @Jimbo
Y U NO WORK SATIS?
 
user895378
I don't know anything about satis -- that's @Danack's area IIRC
 
@Andrea where' the conference?
 
@DanLugg 'Command "satis.json"' - it's telling you it's not a command....which is likely to be true.
 
anywebcast?
 
@Danack Fair, but I followed the manual :-/
 
@DanLugg do php bin/satis to see the list of commands.
 
don't think so
 
7:15 PM
Oh.
Wow, derp.
 
damn..
now worries
 
Thanks @Danack, I apparently have a case of Idontgiveafuckbecausefridayitis
 
@Andrea All you efforts with you the BEST.
 
uh, thanks
 
Does anyone know what the entity &#143; is supposed to be?
 
7:29 PM
@Orangepill fileformat.info/info/unicode/char/8F/index.htm sounds like a bad character set issue.
 
@Danack yeah that's the way I was leaning but wanted to make sure I wasn't being dumb before filing a bug report
 
Hmmm.
Okay, yeah, I thought so. My talk concept is flawed. There's no way in hell I can fit every change into 50 minutes
PHP 7 has a lot of stuff
So maybe I could just talk about big things
I could cover a lot by giving passing mentions to smaller things
hmmmm
(can you tell I don't ever give talks? ;p)
 
you can start the talk by explaining that you intended to talk about all of the new things
and then do a showy scoll of alll the features
 
heh
 
7:40 PM
then admit that you overestimated
 
I could do something arrogant.
Talk about everything that I care about
 
@Andrea you can fill 50 minutes with stuff you did :)
 
@Andrea that would be a nice followup
 
the other thing is I want this to at least partly be a rant about how bad PHP is
 
that's another thing you really cant fit in 50 minutes
 
7:44 PM
There is enough of those from outside the community.
 
@Orangepill hah, yes
 
@Andrea well… what about not talking about the big things everyone knows and will have heard a thousand times before you give your talk?
 
8:20 PM
@Andrea @NikiC Thank you
 
@bwoebi Oh, there's an idea
 
It's nice to get "fanmail": http://pastebin.com/hTEvNuTn — I prefer constructive feedback. It's often the IDEs that makes things difficult :-/
THAT'S WHY WE'LL NEVER HAVE HALF-LIFE 3
 
@marcio da fq ?
I have never had issues setting xdebug up, even with the step-by-step debugging
 
@marcio I suppose that is an eclipse issue rather than xdebug?
 
Neither do I, only once with sublime but it took ~15min and was entirely my fault.
 
8:28 PM
Currently unemployed :-D
4
 
@tereško me neither
 
@ircmaxell welcome to the club
unfortunately you will be employed soon again
no free time for you]
 
Hi, everybody this is the first time I gain access to chat after completing minimum required reputation
 
I am new to Xdebug.. so. i visit the page.. i downloaded a .dll file..
I am now windows xampp.
@Simohammedhttc Welcome.
so, do i need paste in php bin and restart the apache?
 
@Rafee why? You just need to enable the extension in php.ini IIRC
 
8:31 PM
thanks @Rafee how is it organized everyone post questions and everybody can answer ??
 
and how does it will. work.. any idea
 
@Andrea you could talk about this "special" kind of feedback towards FOOS volunteers ^
 
@Rafee do not paste something you don't understand
 
well, i didnt do anyting..
 
@marcio hm
 
8:33 PM
@Rafee so why are you trying to use something that you do not understand ?
 
@Andrea or at last mention it, as it was a huge wtf during the scalar type hints approval (the biggest change we had on PHP lately).
 
i heard it for first time.. just curious..
to know more..
 
well .. then maybe you should begin by learning WHAT it is
 
and then find a tutorial
@ircmaxell is that a good thing? I just quit my job today, but I'll be there for another two months ^^
 
@PeeHaa no idea what this guy is talking about, but I never exposed myself to Eclipse for prolonged time.
 
8:37 PM
@PeeHaa well he mentions eclipse in his pastebin-rant so I assume it's eclipse's fault
(eclipses or eclipse's?)
 
eclipsi :)
 
I still use eclipse
at work
 
I never really liked it
 
I don't particularly like it
and I will switch to phpstorm soon
but I've been using it for years (some of them with java)
 
@MarcelBurkhard \o/
 
8:40 PM
atom.io is quite nice
 
Haven't seriously tried it yet
 
but I don't get php codecompletion (other spl stuff) to work, like typing RequestCTRL+SPACE and it goes to \Symfony\HTTPSomething\....
@PeeHaa i'ts more geared towards javascript and node development imo
 
@MarcelBurkhard I dislike code completion very much so that's ok
 
ThW
I used Eclipse for 4 - 5 years. Worked, but PHPStorm is much better.
 
@MarcelBurkhard atom is really nice but I tried to edit large c files > 2.000 lines and it tends to become laggy after some time.
and the font rendering still has a lot to improve
 
8:43 PM
just F haha..
 
ThW
@marcio that sounds like the highlighting parser problem
 
well, its start good with php_xdebug.dll
 
ThW
if they do a full parsing for syntax highlighting it slows the editing down on large files, the limit seems about 2000 lines. Early Eclipse versions and other editors had the same problem.
 
@ThW yes, it is. That and the cost of having everything in a DOM, this will take a while to get efficient enough. But the flexibility and the plugin ecosystem are amazing.
 
8:52 PM
@staabm one that generates PHP code to test the Zend Engine
 
ThW
@marcio changing the highlighting parser, so that it only parses the needed lines is really complex. been there done that.
 
@Andrea We regularly get bug reports for AFL crashes
Though it's probably not exactly the best way to fuzz programming languages...
 
huh!
I had no idea afl-fuzz would actually work on PHP
I'm thinking of something like jsfuzz
 
3v4l.org/7PZip *RECURSION* ?
hmm hm, what's going on here... maybe $this is being garbage collected before __invoke is executed?
works with an assignment 3v4l.org/deLUQ, so maybe it's refcount.
 
Guys,

I just followed this

https://wiki.eclipse.org/Debugging_using_XDebug

and
created this.

<?php

$a = array("hello", "world");

echo "<pre>";
print_r($a);
echo "</pre>"

?>
hahaha
 
9:05 PM
@NikiC do you know about any recent change that could cause this chat.stackoverflow.com/transcript/message/24809642#24809642
 
@Rafee Did you notice that link uses var_dump?
 
yeah..
 
So, hmm
 
@marcio As it's starting with the earliest php 7 version 3v4l has, might be not so recent
 
To recap: I wanted to submit to PHPNW15's CFP a talk about how PHP is awful and PHP 7 makes it better in many ways
But, the concept itself wouldn't work in 50 minutes
 
9:08 PM
@marcio It valgrinds all over the place, so yeah something is broken there ^^
 
Now I need to figure out what else I should talk about. Or if I should at all, I guess
 
Proceed under the assumption that you should.
Talk about type annotations.
And the tradeoffs that went into it
 
Ooh, actually, I could spend 50 minutes talking just about that journey
That could work.
 
Absolutely
And you could bring in lots of snark about how the PHP development process sucks, if that were to your liking ^^
 
9:11 PM
@NikiC Yep
 
@Sherif True for me.
 
Problem: By October it'll have been more than half a year since I quit. I'm not as bitter about as internals as I was, now
 
@Rafee Me too!
 
@marcio I could imagine that it is related to some $this refcount increment elision that was implemented at some point
Best submit a bug report
 
@Andrea is that a problem?
 
9:13 PM
@marcio eh, I'd be less passionate about it
Hmm
 
Passionate talks are overrated, anyway. The journey to bring more types to a language like PHP is interesting enough.
 
It'd be nice to cover both the story and how to use the end product. Don't know how well that would fit. Might work.
 
@Rafee not this kind of type annotations :P
 
oh.. but i like it.. haha..
 
9:17 PM
interesting talk, however
 
@NikiC ok
 
ooh, ooh
I should totally do this talk
it means I can make statements like
"Weakly-typed is a poorly-defined programming term primarily used to describe type systems you don't like."
(okay, but I'm only half-joking)
 
:)
 
@Andrea It would be interesting to ask the audience "Who is planning to use strong types? and who is planning to use weak types? And who won't use either?"
 
@Danack ooh! a show of hands!
Yes, that would be interesting, I could do that at the end
 
9:19 PM
@Andrea Just make sure it won't end up like that townhall...
 
I've got an inkling that basically no-one will actually use weak-types....
 
@Danack I'm not sure
It's very hard to gauge these things
 
@Danack Hah, I would have thought the inkling would be the other way around
 
I'm pretty sure it is.
 
@Danack I nearly abolished weak types from my code already
(new code, ofc)
 
9:21 PM
I know only one person who says they will be using weak....and I don't value their opinion much...
 
I can't wait to be able to actually merge the PHP 7 branch of my note-drawing site
The one I created as a test of the proposal
 
When you think about it, the majority of bad PHP code isn't bad because of weak typing. In fact, that's rarely the most troublesome defect in bad PHP code. The worst PHP code is bad because it's either poorly abstracted or over engineered. Whereas the majority of good PHP code rarely relies on strong typing in order to be objectively good.
 
Oh, sure
We'll see good weakly-typed code, and bad strongly-typed code
 
So it's very hard to see someone making a strong case for weak typing is really that bad.
 
I still have to add declare(strict_types=1) to all my PHP 7 code. Not sure why I didn't do it immediately.
 
9:24 PM
Type hints are helpful, though, because it means the language can catch what you don't
 
@NikiC I doubt any major framework or library will use weak types. They're already overwhelmed with bug reports. Turning on strict will reduce the number of bugs by a useful amount.
 
The worst part of PHP 7's scalar type hints is it allows implicit conversion of return values. And that's my fault.
– Me, just now
 
@Andrea The problem I have with that statement in a language like PHP is that strong types still don't catch anything serious that you'd normally run into. For example, passing around input variables GPC/etc... are always parsed as strings. So if you're not already using something like filter_input or filter_var, you actually just shot yourself in the foot. You didn't improve.
 
@Andrea Yeah, I actually dislike(d) that. IMHO, return types always should be exact-match
 
@bwoebi yep
I sided with allowing conversion both ways because I expected consistency complaints if I didn't
 
9:27 PM
I'm sure I've said things like "weak input, fixed output" back then
 
yeah
In computing, the robustness principle is a general design guideline for software: Be conservative in what you do, be liberal in what you accept from others (often reworded as "Be conservative in what you send, be liberal in what you accept"). The principle is also known as Postel's law, after Internet pioneer Jon Postel, who wrote in an early specification of the Transmission Control Protocol that: TCP implementations should follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others. In other words, code that sends commands or data to other...
 
@Andrea consistency is a nice thing to have, but not the holy grail… sometimes people get that wrong.
 
Am I missing something or is this non-trivial?
I've been looking at this code for five mins and feel like I must be missing something obvious
 
@andrea why is conversion of return types bad?
 
$input[1] = md5($input[1]); ...?!
@Orangepill masks bugs in code
 
9:31 PM
@andrea gotcha... should error not cast.
 
@NikiC That's a serious challenge?
Is it for people who just discovered how HTTP works?
 
So, how do you solve it?
I must be missing something obvious here
 
@NikiC send a cookie
 
Yes. But with what in it?
The check is done with a === comparison, which is relatively safe normally
 
name "0", value is something matching the md5 hash
 
9:33 PM
hint $uid = $input[0] + 0;
 
@NikiC Can cookies be arrays? get/post can, but cookies?
 
@bwoebi sure
 
Is the comment at the beginning of a file with license and copyright info suppose to begin with /* or /**?
 
@NikiC never seen that…
 
@Sherif hex abuse???
 
Abe
9:34 PM
@Trowski were the Error* classes you wanted to implement added, eventually? NoSuchMethodError IllegalAccessError etc?
(p.s. Ron Swanson here, previously Worf :P)
 
@Andrea yes, but you don't immediately have something matching the hash
 
@Andrea No, he's trying to cast it to an int
Problem with that is, what if it's an empty string?
 
@Sherif the === wouldn't have matched
 
@Abe Eventually they became just AccessError and IdentifierError, and no, they weren't.
 
Sure, but it's still 0
 
9:36 PM
this code is confusing, I'll refactor it until I can think clearly about it
 
@Sherif but $valid_user isn't set either.
 
Abe
@Trowski will require a rfc, rite?
 
@Andrea Think about it. $_COOKIE['user'] = ""; $input = $_COOKIE['user']; what does $input[1] equal?
 
@Sherif yeah, then it's converted to an array
 
@Abe Yes, and I'm not sure how well people would receive an RFC targeting 7.0 right now.
 
9:38 PM
@bwoebi How's it converted to an array?
$user is an array, maybe, but $input isn't if I have an empty string.
 
@Sherif $input[1] is an empty string… and after $input[1] = …; $input ends up as array
 
@Abe I still have the branch here: github.com/php/php-src/compare/…
 
hmm
It's just an associative array
 
@bwoebi hmm... How does $input end up as an array?
 
@Sherif because empty string?
 
9:40 PM
No
 
Abe
@Trowski it's not a big change tbh, and they are pretty standard and well defined in a lot of languages. so you aren't adding anything prematurely imho.
 
php > $input = "";
php > $input[1] = md5($input[1]);
Notice: Uninitialized string offset: 1 in php shell code on line 1
php > var_dump($input);
array(1) {
  [1]=>
  string(32) "d41d8cd98f00b204e9800998ecf8427e"
}
@Sherif ^^
 
wait, so they're just hashing... an empty string
?!
no, they're hashing ONLY THE SECOND CHARACTER?
 
@Abe Right. I was thinking I could make an RFC and make a voting option "Target 7.0 or 7.1". I assume most people would pick 7.0.
 
@bwoebi o.0 Why would that cause it to become an array. Assigning to a string offset results in array?
 
9:41 PM
@Andrea It's obviously expected that cookie[user] is an array...
 
@NikiC I guess
 
@Sherif you gain that knowledge when working with the engine…
 
But it's not outright specified
 
And using a string instead is first thing I considered, but I don't see how it would actually help
 
I mean, even more shockingly, assigning a string to a string offset results in an array.
 
9:42 PM
At the end you're still up against a === comparison
 
Because the actual result of the assignment is a string
 
@Sherif only if the original string is an empty string though.
 
@Sherif falsy values are promoted to arrays
 
Well that's what I'm saying. You send a cookie with an empty string.
 
@NikiC oh god...
 
9:43 PM
@NikiC Ahh, right now I remember
 
why, PHP
 
derp
 
;_;
 
Abe
i would also add NotImplementedError so that IDEs can generate stubs that warn you upon usage:
function callMeMaybe(){
     // TODO implement the callMeMaybe() method
     throw new NotImplementedError("The callMeMaybe() method is not implemented yet");
}
 
PHP semantics ftw?
 
Abe
9:44 PM
@Trowski ^
 
In PHP s/ftw/wtf usually.
 
OK, so you send multiple cookies to cause $input == $user?
Now I'm confused.
How's that even XSS though?
 
The idea, I think, is that you send something like this:
Set-Cookie: user=0
Set-Cookie: user=mysecurepassword
 
@Sherif the point is that it is not XSS.
 
There are ways to fool a === comparison, but I don't know anything that applies here
 
9:45 PM
@Andrea I believe it must be called user[] then (???)
 
@Abe That seems like something the language should not be concerned with.
 
@bwoebi not necessarily
I'm not sure how PHP handles multiple cookies
overwriting I guess?
 
yes
just like with get/post
 
Ah
 
Abe
@Trowski well, that Error would be thrown also when running the code. most of languages have that, afaik
 
9:46 PM
oh yeah, people rely on this :/
 
Well, it depends on GPC order also
Doesn't it?
 
only for $_REQUEST.
 
@Abe Just throw a generic Error, that would work.
 
I wonder if you send a cookie with brackets will it behave like $_POST/$_GET?
$_POST/$_GET parse those into arrays
Set-Cookie: user[]=0
 
thats what @bwoebi's saying
 
9:48 PM
ahh, right
 
Set-Cookie: user[]=0
Set-Cookie: user[]=mysecurepassword
 
heh
 
let's look up what password 9b5c3d2b64b8f74e56edec71462bd97a is...
 
@NikiC are there? I don't see anything obvious here…
 
Abe
@Trowski but with that you wouldn't be able to search for not implemented things. clearly it's trivial, but nice to have, imho
 
9:51 PM
WAIT
does md5() have error conditions
I think that might be the trick...
 
@Abe It could be done, but I would say that could be a separate RFC. Keep things simpler at first.
 
no, that wouldn't fool ===
 
how should it? that'd just put false (or null) into $input[1] … does that help?
yeah
 
let's think outside the box
 
If there were ==, okay…
 
9:52 PM
the author doesn't seem to know all that much about PHP
they didn't use [] array syntax
they didn't know you could nest arrays
 
@Andrea The author does know much about PHP ;)
@bwoebi There are. But as said, I don't see anything that applies here
 
@NikiC really, what are the ways to foo is_identical? I see nothing obvious in source…
 
@bwoebi bugs.php.net/bug.php?id=69892. That's not fixed in 5.4
But that allows you to get equality with differing keys
We're interested in values
 
if we assume register_globals, you can add ?uid=0
valid_user is trickier
 
@Andrea PHP 5.4
 
9:55 PM
@NikiC Oh.
:<
let's see
checks md5() sourcecode
hmm
 

« first day (1749 days earlier)      last day (3203 days later) »