« first day (1476 days earlier)      last day (3465 days later) » 
02:00 - 15:0015:00 - 23:00

3:00 PM
@JoeWatkins Really? I don't think so.
Definitely a real photograph.
 
strange, only thing that hints it might be fake is the sword, looks like it's out of proportions
 
I call bullshit on the flowers. They're far too small in comparison to the spider.
 
Actually, the reflections on the skulls on the abdomen of the enormous spider are slightly warped -- I'm calling Photoshop.
 
posted on October 31, 2014 by kbironneau

/* by steve steve */

 
When isn't Ballmer fired up? :P
Scares the crap out of his kid though :P
 
3:15 PM
I really wish I could do this without a warning: return include $path;
Now I have to do an if (file_exists) :/
If I wanted an error of some kind I'd use require :/
 
@LeviMorrison return @(include $path); </jk>
 
IIRC that actually mutes the entire file.
 
Fridays are definitely the worst days to post links. No one trusts anything.
 
This is the most complex autoloader I've ever written; want to see it?
I'll just post it; I'm sure you want to see it:
function autoload($class)/* : bool */ {
    static $collection_namespace = 'PHP\\Collection\\';
    if (strpos($class, $collection_namespace) === 0) {
        $unprefixed_class = substr($class, $collection_namespace);
        $normalized_class = str_replace('\\', DIRECTORY_SEPARATOR, $unprefixed_class);
        $path = __DIR__ . DIRECTORY_SEPARATOR . "${normalized_class}.php";
        if (file_exists($path)) {
            require $path;
            return true;
        }
    }
    return false;
 
3:21 PM
lol
 
oops; missing a strlen in there
 
No Composer + PSR-4?
 
Nope.
 
Why so?
 
I get too many files in one directory for my liking if I use PSR-4
And I'm not putting iterators in their own namespace just to avoid that.
However, for now this is technically PSR-4 compatible ^^
Also, as good as composer is many people don't like using it, myself included.
 
3:25 PM
Hey @LeviMorrison it's a while now since you threatened to open the voting on return types, are you going to go ahead and do it?
(I noticed you "used" it above)
 
No. I need to decide on type vs kind.
They can't all be types because it is ambiguous. I don't mean "might be an issue", I mean "actually is an issue".
 
Ohi
@LeviMorrison Just go with type, please.
 
@LeviMorrison Related: IS_OBJECT is a misnomer (should be IS_CLASS)
 
Yes it's repetitive, it's not really that big a deal.
 
if ReflectionType::getType() returns a ReflectionType::TYPE_* constant then we have a return type oddity when you give ReflectionParameter::getType() a return type of ReflectionType.
^ That's a big deal to me, @AndreaFaulds
So no, I will not use type for everything.
 
3:27 PM
hmm
ugh
 
@LeviMorrison TYPE_IDENTIFIER_ARRAY --> getTypeIdentifier()
 
Better idea.
ReflectionType::getConstant()
Then have ::IS_*
Except, wait, that's confusing
ReflectionType::getTypeType(): TypeType
TYPE_TYPE_STRING
 
@AndreaFaulds PleasePlease NoNo ;-)
 
lol
I'm lobbying for kind for the constants, because that's what internals does.
 
It... is?
 
3:30 PM
But that's the best I've got.
Yeah, we have stuff like ast_kind
 
// @todo refactor is not acceptable 2 years forward when it hasn't been touched and it's now legacy spaghetti
 
"category"?
 
@LeviMorrison No, that's not quite the same
For types, we just call them, well... types.
Oh, I know.
@LeviMorrison ::getTypeConstant()
 
Yeah, there's that too.
 
@LeviMorrison no, internals definitely does not use kind for this ;)
Don't lobby for it on that reason
 
3:32 PM
ast_kind is not that dissimilar
And 'lobby' wasn't the right word.
I meant it was the next best I could think of ^^
 
@LeviMorrison We never use "kind" to talk about types
I think $type::getTypeConstant() == ReflectionType::IS_ARRAY works, right?
Go with that.
 
I'm not doing IS_* either.
 
@AndreaFaulds getTypeTypeTypeTypeType().
 
TYPE_ARRAY works though
 
Actually, the real problem is that ReflectionType doesn't represent a type.
It represents a typehint.
 
3:34 PM
We don't say that word anymore.
 
OK, type specifier. Type whatever, but not a type.
There's no such thing as the nullable integer type. There's only the integer type and the nullable integer typehint.
 
Eh, theorists may disagree on that but I understand your point.
They'd say a nullable integer type is a union of two types: null and integer.
 
ReflectionTypehint::getType() should work, right?
Though
aaaargh
 
No.
Absolutely not doing hint ^^
 
Actually, getting a type const-
 
3:37 PM
"Declaration"?
 
I put forward Decl but people didn't like that either ^^
 
wait, argh
You know what's stupid?
 
Lot's of things? ^^
 
David Cameron?
 
->getType()->getType(). In any form. Even if the former is "getTypehint" and the latter "getTypeConstant"
ReflectionType is the type, no? Why should you have to get the type from it?
 
3:38 PM
Yeah, which is why I'm not using getType for a method name for one of them.
 
->isArray() is fine. ->isCallable() is fine.
 
@AndreaFaulds It's the sub category of the type that it returns though
 
The RFC goes over this.
 
Yes, but it misses something.
 
ReflectionParameter->isArray() might make sense, but ReflectionFunction->isArrayReturnType()..?
 
3:40 PM
switch (true) { case $type->isArray(): ... break; case $type->isCallable(): ... break; }
 
Yeh but that's horrible
 
Those kinds of switches are an abomination. I am not trolling.
Good, glad others agree ^^
 
OK, use if/elseif
 
Also I'm guessing the plan is to make nullable bit maskable?
 
But it still doesn't make the API for return types make any sense, Andrea.
 
3:41 PM
@LeviMorrison How so?
 
You are saying ReflectionFunction->isArrayReturnType() is acceptable?
Or something similarly horrible for a method name?
 
Nope.
 
Then I have to do something else.
 
$function->getReturnType()->isArray()
 
Methods are inferior to the constants.
 
3:42 PM
Not at all.
 
Yes, they are.
 
No, they're limiting
 
Your switch(true) argument I don't consider valid. Given that premise, yes, the methods are inferior.
 
OK, use if {} elseif {}
 
Switch statements are more clear in every case they can be used.
 
3:44 PM
It's less typing for starters
 
Less typing does not inherently make anything better.
If you want something like is(ReflectionType::TYPE_ARRAY | ReflectionType::TYPE_NULL) or something that could maybe work if you really want methods.
 
No, I'm just unconvinced we need type constants
 
I'm done guys, Happy halloween! And have a nice weekend :)
 
I don't really see what's wrong with the current approach of using methods for each type
 
@DaveRandom They're only horrible because you have to explicitly state switch (true) ;-) If it were just switch { ... } it'd be glorious.
 
3:47 PM
Also, there's nothing you can do in a switch you can't do with if
 
I don't buy that, as already mentioned.
 
Why don't you buy it?
I mean, it's true.
 
8 mins ago, by Andrea Faulds
switch (true) { case $type->isArray(): ... break; case $type->isCallable(): ... break; }
^ That is horrible
 
Yes, that's not what I'm talking about
I'm saying there's nothing wrong with an if/elseif here
Nor does using an if/elseif prevent you from doing anything you could do with a switch
 
Okay, I'll think about this more.
 
3:57 PM
hi..
Can we do phpunit testing for image uploading?
 
@AndreaFaulds o.O Sherif is getting testy.
 
@LeviMorrison How about i) Deprecate ReflectionParameter::getType() ii) Replace it with ReflectionParameter::getReflectionType() iii) Happily use ReflectionType::getType
 
@LeviMorrison re: Http interface?
 
@LeviMorrison He was in here last night - acting very oddly: chat.stackoverflow.com/transcript/message/19704136#19704136
 
4:02 PM
@Danack Dunno; maybe. What do you think, @AndreaFaulds?
 
That is the real problem - the existing code has the wrong name.
 
To be clear, ReflectionParameter::getType() does not exist.
Not yet.
Sara has an RFC pending that would add something like that to mirror the API I'm working on now.
For reference, HHVM calls these TypeAnnotations internally.
She's not necessarily proposing that; it may just be helpful to know.
 
@LeviMorrison It's slightly less bad, but still bad.
 
posted on October 31, 2014 by Anthony Ferrara

Recently, a severe SQL Injection vulnerability was found in Drupal 7. It was fixed immediately (and correctly), but there was a problem. Attackers made automated scripts to attack unpatched sites. Within hours of the release of the vulnerability fix, sites were being compromised. And when I say compromised, I'm talking remote code execution, backdoors, the lot. Why? Like any attack, it'

 
OK, uh
I officially don't "get" Sherif's proposal. Like, at all. It makes no sense.
It's... just a set of interfaces. What's the point of that?
 
4:08 PM
I decided that I wouldn't get it in advance and didn't bother reading it ;)
 
@ircmaxell seeing your recent blog post, do you (or anyone else) happen to have a linkable that sort of explains why it's never a question if you get hit but rather when? I recently had a debate where one guy said "we havent been hit for vuln XY in a month, so we wont get hit at all". IMO, this is plain wrong and Optimism Bias.
 
@AndreaFaulds I haven't read (only skimmed) but I think the SAPI provides an implementation but the user-land only sees the interface API.
Pretty classic use of interfaces, actually.
 
@LeviMorrison I've skimmed it again, and no, it's not really that.
It's allowing userland folk to implement request parsing in userland. Which they can already do.
 
Yeah, then we're definitely breaking BC and not even giving feature-completeness.
 
No, no, no BC break
This just adds an interface you can write request-parsing classes to. Or something. Er...
I don't see how it's substantively different from PSR-7, which the PHP-FIG is working on.
 
4:12 PM
If it's true SAPI's don't give an implementation and superglobals aren't populated, then how are you supposed to get the info to build the implementation of either?
 
Oh, I finally get it now.
 
The SAPI would have to build it, ergo the previous logic.
 
It's an interface for request-parsing classes. It lets you get the raw body/header.
Which actually is useful.
 
You cannot call an interface; only an object which implements an interface.
 
No, no, your class implements the interface, and it gets passed the raw body/header
I think.
 
4:14 PM
@LeviMorrison You're kidding!? So that's what I've been doing wrong all this time!
:D
 
So it magically invokes your object somehow?
But how would it know?
Bleh, should just read RFC.
I don't think it will pass, though.
 
@AndreaFaulds So you'd be responsible for writing in parse_str when it's form encoded?
 
hey happy halloween!
 
What do you do when you join a new company, and it's all legacy spaghetti code you're supposed to 'learn'? Procedural code in JS functions and PHP class methods, based on symfony 1 but still absolutely terrible. Refactoring is out of the question imho. Stick with it?
 
go away
if you ask me
otherwise you would have to arm yourself with really a lot of patience
 
4:19 PM
@DanLugg Yes.
 
Hmm, meh; already possible with php://input, but not bad.
Exposing the entire request construction process to user-land would be helpful, but only if default implementations that replicate the current behavior exist.
 
@DanLugg This lets you parse headers, too, though. Ew.
@DanLugg Yes, it includes that I think. Still, I don't see the point.
 
@AndreaFaulds Well, TBH, I typically take headers like "Date: ..." and turn them into DateTimes
 
Yeah, but you can do that already
This is about handling all the stuff PHP already handles for you fine
 
4:21 PM
Agree, it's just cramming it into the OO paradigm.
Which I'm more-or-less alright with.
 
Go read the RFC.
 
I skimmed it; will do.
 
lol
@AndreaFaulds Now... I can't find it for some reason.
 
I think it solves the wrong problem, really.
What people actually want is a way to get at parameters without mangled names (foo.x becomes foo_x due to register_globals having existed), and a way to invoke the request body parser manually for requests where it wasn't invoked automatically (PUT, DELETE, etc.)
What they probably don't want or need is to implement the entire HTTP protocol parsing themselves.
 
4:29 PM
@AndreaFaulds Most people probably don't; exposing iteratively to lower and lower levels is almost always beneficial, provided there exists a default bottom-up implementation so that people who don't care can start running.
I don't think there's anything wrong with exposing the parser pipeline, but I think this RFC is being sold for the wrong reasons; we first need an front-line API that we can all agree on, and that's a much larger discussion.
This is attacking the problem backwards, so far as I can tell.
Also, anyone keeping up ob objkeys?
 
@Jimbo enjoyed reading the blog post draft.
 
@Gordon I don't have anything like that, but I can write something like it
 
@ircmaxell if you want to :)
 
sounds like a good post
 
@Gordon When I have a "discussion" like that I am known to lose my cool
 
4:41 PM
@PeeHaa oh btw. when will you be in munich again?
 
@Gordon If I still have to go it will be next month (somewhere around the last weekish)
 
@PeeHaa so end of nov?
 
yep
 
@PeeHaa wont be there in the last week. week before or after only.
 
@Gordon k. Will keep it in mind
 
4:49 PM
@RonniSkansing Thanks! I keep thinking it's far too primitive and obvious though, like I need some more concrete examples.. not sure..
 
good weekend to everyone
 
heya
 
@Jimbo imo I is not to primitive, the point about global == static in this context is great.
 
5:04 PM
posted on October 31, 2014 by kbironneau

/* by gumibogyo */

 
lol
 
Is that aftermovie going to come out any time soon?
 
not sure
I did get pinged for the slides to my keynote, so he was editing the videos, which means that perhaps it'll come reasonably soon
 
$_FILES returns error 4 on file, there is properly set enctype and tmp folder of php has 777 permissions. I have no idea what to do anymore?
 
5:22 PM
@Stol3x if possible check the
1) syntax of $_FILES
2) enctype='multipart/form-data'
3) Try Again 777 Permission for Folder
 
have you read the description of error 4? php.net/manual/en/features.file-upload.errors.php
 
@ircmaxell can you advice on path for learning about crypto systems? I want to work on a project next year that involves some cryptography, I can dedicate the next 2 months to learning that.
 
I've enrolled for those :D
3 of them actually, starting in Nov
 
You know what I love about XSLT? That it can transform XSLT. That is really nifty, and is a feature I wish extended to more languages.
Ye ole' "code-as-data".
 
5:31 PM
it's nifty, and also dragons
 
@ircmaxell Meh, I wouldn't call it dragons, maybe shadowy :-P
 
@ircmaxell I know -- it's not unexplored, it's just in the dark corner of seldom use.
 
it's used all the time
 
XLST -> XSLT?
 
5:33 PM
but it becomes really hard to analyze, and hence can be really complicated
 
Oh, I've not really seen it used that way elsewhere.
 
Guys, I'm startig a project for event subscription and such, I'm newbie at PHP and I will make it also to learn
 
@DanLugg no, code-as-data
heck, that's one of the foundations of OOP (message passing)
 
I just want to start with the right foot, so the admin login/logout system I'm getting a pre-made one, because it's security, and I'm studying it...
I saw it uses MySQL, instead of MySQLi - is it safe? intechgrity.com/…
along with ezSQL class justinvincent.com/ezsql
 
no, it's not safe
 
5:37 PM
I'll try to adapt it to mysqli
 
@ircmaxell Basically working as a Application programmer with skills set in Php & Framewoks , strongly concentrating on this side, not on CMS so my primary concern over here is most guys are suggesting me to concentrate on UI & CMS PART.. but i am interested in Application solution .. bit confused, what to do..
 
hmm, or maybe search another one
 
it's not not safe because it uses mysql instead of mysqli
it's not safe because that code is horrendous
 
I see lol, thanks a lot - Imagine if I make my entire project based on this?
at least the admin part
Do you have any good project in mind for this purpose?
 
Hi Guys, Basically working as a Application programmer with skills set in Php & Framewoks , strongly concentrating on this side, not on CMS so my primary concern over here is most guys are suggesting me to concentrate on UI & CMS PART.. but i am interested in Application solution .. bit confused, help out here..
 
5:45 PM
@ircmaxell Ah okay; I was referring more to the introspective features inherent to XSLT -- performing a transformation of the host-language itself, reflection++, etc.
Code generation, y'know.
 
?...
 
@a.saleem Expanding your skills in a particular field and aspiring to become an expert in that field is a noble goal. However, becoming an expert at using a particular CMS is asking for trouble, because you're narrowing down your expertise to a subset of a subset of a subset. i.e. you are a programmer, using PHP, particularly with X, Y, and Z CMS. You should try to broaden your horizons as much as possible.
Though there is nothing wrong with learning how some PHP CMS software works (just keep in mind that due to their low-bar-to-entry the supply will far outweigh the demand when it comes to finding work).
 
6:02 PM
@Sherif Thanks for the Reply.. What you said is 100% true, to go to next level like an tech-architect, solution-architect kind of do .. what kind of steps i need to follow means apart from programming skills..
 
@a.saleem Well, software architecture and software engineering are kind of different fields. I don't necessarily view them as one leads to the other. If you're happy writing code and you feel you're good at it then just focus on improving your skills there. If you'd rather design or architect software systems then focus on that. Software architects are usually more concerned with the overall architecture of a project than specific implementations.
I would highly recommend reading the Mythical Man Month if you want to learn more about project leads and team dynamics, which are probably helpful towards architecture goals.
 
@NikiC You provided the aliases by reflection patch, right?
 
Did you provide a patch because you are a nice guy or because you think it's a good feature?
 
xyz
2
Q: Insert values in junction table

xyzI have three tables in database: trips(trip_id(pk), trip_name(unique), user_id(fk)) places(place_id(pk), place_name(unique)) trips_places_asc(trip_id(fk), place_id(fk)) Since, many trips can have many places, I have one junction table as above. Now, if user insert places to the trip, the...

 
6:11 PM
@Sherif Once again Thanks, Understood much Better.
 
Usually, though, you have acquired a lot of experience working on different kinds of software projects and dealing with different kinds of problems before you fit into the "Software Architect" role, which is really more of a lead/managing type role.
But some people don't want to manage. They just want to write code :) and that's perfectly OK too.
 
@Sherif Yes it does
@sherif (sheriframadan.com) Good Work!..
 
6:43 PM
Morning room 11
 
6:54 PM
@PeeHaa Good moanings. Did you get that mail server migrated in the end?
 
@Danack Yes. I gave up on offlineimap and imapcopy and used imapsync
It took damn long but in the end it just worked
 
@LeviMorrison I'm neutral on it. I think that, given existing usage patterns for docblock annotations in various major frameworks, it's not an unreasonable feature. But not sure whether it's really needed and whether it should be exposed in this way.
 
I'm definitely against being exposed in that way ^^
 
What could possibly be wrong with changing the core libraries to support an IDE?
 
7:15 PM
Ehm, how does one early quit from a generator, except by a goto / do while break until the end of the Generator?
well… and not by an exception.
 
return;
 
I thought return statements weren't allowed in Generators?
 
@ircmaxell Fatal error: Generators cannot return values using "return" in Command line code on line 1
 
non-empty returns are not allowed
 
7:18 PM
oh, okay
 
return $foo is not allowed, but return; is
 
That's documented anywhere?^^
 
dunno
 
@bwoebi "A generator cannot return a value: doing so will result in a compile error. An empty return statement is valid syntax within a generator and it will terminate the generator." php.net/manual/en/language.generators.syntax.php
 
@Danack /me looks at everything but the grey note boxes…
 
7:21 PM
Note boxes are where the interesting stuff lives...
 
I'm used to normative documents from w3c where the interesting stuff is everywhere, but not in the boxes.
 
D:
If I wanted to listen for POST Requests from a different port, I'd need to mount apache to listen for that port right? O_o
 
Yes, but I wouldn't call it mounting
 
Listening :P
 
binding
 
7:27 PM
I like it!
Thank you :)
 
;-)
np
 
<3
Dammit.
Another trick or treater
 
:P
 
These kids!!!
 
You should hand out free copies of Flex4 manuals. That should keep them away. At least it worked for Adobe at the last conference I went to
 
7:33 PM
We've had none - and so I have a whole load of mini-size mars bars and maltesers for myself...
 
@bwoebi Unsure, but I knew it off the top of my head.
 
7:50 PM
 
8:01 PM
@ircmaxell about your last blog post… still, why ever you'd pass a raw, unfiltered array to a database connection without being sure what's in it. First verify yourself, the abstraction layer isn't a replacement for verifying user input…
 
I'm not arguing
but it's not a vulnerability
it's not good software design
 
If one would have verified that, his Drupal app wouldn't have been vulnerable…
but not arguing that it isn't a vulnerability per se.
just like the vulnerability in Drupal isn't a vulnerability per se… only when you pass unfiltered user input…
 
by itself, there's no way to exploit it
so it's a vector, but not a vulnerability
@bwoebi no, one would just need to find an IN query to then exploit. It didn't introduce anything, it just made it easier
 
IN queries generally are horribly to work with… at least when you prepare.
@ircmaxell but okay, I agree.
@Machavity Flex4? Newest is 2.5.x I thought? sourceforge.net/projects/flex/files
 
8:13 PM
@salathe oh that flex…
 
8:28 PM
lol
was gonna say they were handing out Flex3 in 2008
@salathe This flex adobe.com/products/flex.html
Too many projects named Flex
 
8:55 PM
@Machavity yes, that's what I linked to :)
 
soooo... California has mini-raven (birds) ?
O_o
 
anyone mongodb?
how can I search resultset of another query
 
Wow, you'd think I'd just single-handedly destroyed all of PHP. It's great to know that there are people out there who are willing to spend an inordinate amount of time and effort trying to tear down innovation rather than embrace it and have the audacity to imply that I'm being dictatorial!
 
I didn't care for that rant yesterday, neither do I now tbh
 
Sucks to be you.
 
9:10 PM
> Well, you're the one suggesting an alternative. The onus is on you to prove
that it solves the same problem, not me. However, I'll bite for the
purposes of moving the discussion along...
 
@Sherif come back when you can act normal
 
and you say "trying to tear down innovation rather than embrace it and have the audacity to imply that I'm being dictatorial"
 
@ircmaxell @others fwiw I kicked @Sherif because I got bored of it
 
I was thinking of the same. I respect him, but this is completely unconstructive
 
Yeah same. I wanted to do it yesterday when he just wouldn't stop, but didn't. Now he comes in and start right away...
 
9:16 PM
@PeeHaa I could stand to hear a little more…
 
:P
 
Just a question: How long should I wait for a reply from Derick? (I want to respect that he might no time just now… no idea.) Anyone has an idea? I know, I only sent him the mail yesterday, but I'd like to know how long to wait for a reply?
(As I'm not excluding the possibility that he might ignore me)
 
@bwoebi give it a week before reminding him… unless it's time-sensitive
 
@bwoebi give it a long time
don't forget, he's been at a conference and is traveling currently
 
then remind him every week
 
9:19 PM
I'll see him next week, so if he hasn't gotten back to you by Friday I will poke him for you, in person
 
@salathe no, I need a decision about how to proceed with xml protocol in phpdbg in at most 1.5 weeks. A decision, not only a reply.
 
> unless it's time-sensitive
 
@ircmaxell Okay, thanks.
 
9:47 PM
@salathe by the way, the way of reminding someone each week sounds fine… but at the end I'll forgot to remind him and accidentally notice two months later that I forgot…
 
10:13 PM
Guys, I'm doing a small project and I need to include some files in order to everything work fine.

Here's what I did:

index.php
<?php
	require_once("includes.php");
	incluir("mysql","funcoes");
?>
<html>
<!-- etc -->

includes.php
<?php

	require_once('config.php');
	function incluir($inMySQL_connect = false, $inEzSQL = false, $inEzCore = false, $inFuncoes = false) {

		if ($inMySQL_connect == "mysql") {
			include("includes/mysql_connect.php");
		}

		if ($inFuncoes == "funcoes") {
			include("includes/funcoes.php");
The problem is, included files like mysql_connect.php don't have access to the variables in config.php for example, and I would like it to inherit these from includes.php
I know there are a zillion better ways to do this, I'm noob at PHP but trying to learn...
 
@LucasB They don't have access to the variables because you're presumably trying to access them as just $foo, when they're global variables, so need to be accessed as $_GLOBALS['foo'] when inside a function.
 
And that code is horrible.....please also read php.net/manual/en/language.oop5.autoload.php
 
Thanks, autoload seems to nail it: "One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class)."
I'll study it
thanks again :)
 
02:00 - 15:0015:00 - 23:00

« first day (1476 days earlier)      last day (3465 days later) »