« first day (809 days earlier)      last day (4155 days later) » 

4:00 PM
@hakre Sagfault? /blame @NikiC
 
@PeeHaa Sagfault? Is that what happens when you take a big fat application and strip the bloat out of it?
 
:D
 
@DaveRandom I bet you think you're clever :D
 
Don't mind @DaveRandom he's a prick! :)
 
4:04 PM
Damn I like that word
 
Nope. I am fully aware that I am a gibbering idiot. But you know what they say, the first step is admitting you have a problem...
 
i am amused.
morning @LeviMorrison
 
Like
 
@LeviMorrison What's the difference with the previous rfc?
 
4:08 PM
Don't know; haven't fully read.
I pray it doesn't make it, though.
 
@LeviMorrison Reading it now. Why do you dislike the concept, though?
 
I was hoping for drastic object changes in PHP 6.
 
I was / am also not really sold
 
@Lusitanian Hate this implementation. Love the idea.
I mean, look at it.
 
@LeviMorrison ah gotcha
 
4:09 PM
class TimePeriod {
    private $Seconds;  // <-- Traditional Property
    public $Hours {    // <-- Property
        get() { return $this->Seconds / 3600; }      // <-- Accessor, more specifically a getter
        set($x) { $this->Seconds = $x* 3600; }       // <-- Accessor, more specifically a setter
        isset() { return isset($this->Seconds); }    // <-- Accessor, more specifically an issetter
        unset() { unset($this->Seconds); }           // <-- Accessor, more specifically an unsetter
^ Is that attractive to anyone here?
Do you really want to write that?
 
And your more attractive proposal would look like...?
 
And why, why, why on earth do we have an unset for a property?
 
@LeviMorrison Ah, good question...
 
or even isset for that matter?
 
@LeviMorrison it's very similar to C#'s property syntax
 
4:10 PM
@LeviMorrison isset meh unset no
 
@Lusitanian And it's awful.
 
@LeviMorrison isset checks for non-null values
 
tbh i'm not really sure why you say that
 
@dev-null-dweller Exactly: get() !== NULL is the same as isset.
 
there shouldn't be isset/unset, but I don't see the issue with the syntax, imho it's fine
what would your proposal be?
 
4:12 PM
I was starting an RFC, actually: wiki.php.net/rfc/php6-rethink I work on so many projects that I had to stop working on that one for now.
 
@LeviMorrison Yes but what if there is a huge procedure to get the actual value, but there is a shortcut to check simply that there is a value?
 
@DaveRandom There's always a value. It's an object property defined in a class.
It might be null, but there's always a value.
 
@NikiC: got output buffering working
 
@LeviMorrison but get() may involve some operations, and if you don't want the value isset would be quicker than
 
@LeviMorrison See that is what I think, but in order for that to be really true NULL would have to be distinguished from undefined, which it is not.
(in the context of isset())
 
4:14 PM
@DaveRandom It's a class property. It can't be undefined.
 
@LeviMorrison private $parts; << undefined
I didn't write private $parts = NULL;
 
@DaveRandom Defined, actually. It's NULL.
 
@LeviMorrison Yes, but isset() will still return false
 
@LeviMorrison unsetting object residing in property decresses it's refcount and frees memory, so may be usefull
 
@dev-null-dweller That's the same as setting it to NULL. You can't delete an object property, only change it to something else.
Regardless of why I think it's a bad proposal, I think this is much better:
class PersonImpl implements Person {

    int $id; // creates get and set methods for id

    string $name;  // creates get and set methods for name

    __construct(int $id, string $name) {
        $this->id = $id; // calls the set id method
        $this->name = $name; // calls the set name method
    }

}
And it isn't strict typing.
I could implement that (mostly) with the current engine.
And the full-on, verbose way:
class PersonImpl implements Person {

    private int $__id;

    private string $__name;

    public __construct(int $id, string $name) {
        $this->id = $id; // calls the set id method
        $this->name = $name; // calls the set name method
    }

    public int get id() {
        return $this->__id;
    }

    public string get name() {
        return $this->__name;
    }

    public void set id(int $id) {
        $this->__id = $id;
    }

    public void set name(string $name) {
        $this->__name = $name;
Or, if you don't want to define a type-hint you could use the old PHP 4 var $property syntax.
In case anyone is wondering, this is a very Dart-like syntax. That's one reason I can support it. I've actually used this type of syntax in a small project.
 
4:20 PM
@LeviMorrison In what way is that not strict? Are you proposing an automatic cast if I try and set $__name to an int?
 
@DaveRandom $daveRandom->name = 'Dave'; (throws NameIsChrisEvenThoughNoSenseIsMadeException)
 
@LeviMorrison in fact, you can
 
@DaveRandom An integer can be a string in PHP, no worries.
 
class stdclass2{
	public $prop1;
}

$obj = new stdclass2();
$obj->prop1 = 'hello';
var_dump(get_object_vars($obj));
$obj->prop1 = null;
var_dump(get_object_vars($obj));
unset($obj->prop1);
var_dump(get_object_vars($obj));
 
@Lusitanian lol
 
4:21 PM
@dev-null-dweller I misspoke, you can't delete a class property.
That isn't the same thing as what you did.
 
@LeviMorrison Indeed, but how does the fact that you hinted the type of the property work? Cast or throw?
 
@DaveRandom Niether. Current type-hint semantics of raising a warning.
People always talk about resolving type of scalars such as int or string in type-hints as being problematic but that's really not true.
 
Blegh. I hate that. Why should I go all round the houses to gracefully handle things when we have a perfectly good try/catch?
 
Because why would you even want to bother checking parameter types if they have to be a certain type?
 
@LeviMorrison so it aplies only to static properties
 
4:24 PM
Just declare DateTime or MyObject or gee, I don't know, int?
 
OMG .. [mental sickness](mental sickness) .. that guy thinking we are racist since his question on meta got many downvote
 
user1642018
lol
 
user1642018
oh hi all.,
 
I don't care if it's a string representation of the int or a real int. Does it pass filter_var($param, FILTER_VALIDATE_INT) !== FALSE? Then it's an int, no and ifs or buts about it.
 
That sounds an awful lot like static typing to my simple brain. Not that I really have a problem with that, it's just that it seems to me there's no point in handling scalar type hints in any other way than cast is possible or throw if not. Otherwise it really is just half arsed static typing.
 
4:26 PM
@DaveRandom That's all the current type-hints are anyway. How's this any different?
And you know what? It works just fine.
In a language like PHP that's all we really need.
Was the variable that got passed in of X type when it was passed in?
I'm looking for type safety more than anything.
And we already have it for arrays and classes.
Anyway, regardless of the other changes in that proposal, I still like the property syntax better.
class PersonImpl implements Person {
    private int $__id;
    private string $__name;

    __construct(int $id, string $name) {
        $this->id = $id; // calls the set id method
        $this->name = $name; // calls the set name method
    }

    get id() {
        return $this->__id;
    }
    get name() {
        return $this->__name;
    }

    set id(int $id) {
        $this->__id = $id;
    }
    set name(string $name) {
        $this->__name = $name;
    }

}
^ In my opinion that is much better.
 
You know what my main issue is with this? If you don't cast from string to x, it makes user input more of a pita. Because everything comes in as a string. So if I'm expecting an int from user input in a given field, cast it to an int without me doing explicitly at call time. If the user screws around passing things that can't be converted, fine, throw up. It's the users fault. But generally always throwing up when the type of a scalar is wrong seems stupid to me.
 
You shouldn't fail in that case.
I wouldn't use type-hints to resolve user input. I'm not crazy.
 
:-P
 
It's type-safety in case I personally screw something up.
And as I said, in my proposed way of doing things you don't have to type-hint things.
We still would have plain-old normal typed PHP properties if we wanted them.
 
4:36 PM
Is it possible for PHP to know of a list of computers that are currently connected to it (and listening) via a long-polling javascript?
And subsequently, send data back to those computers? Kind of like a server push?
 
@LeviMorrison I'm going to have to think over this again when I have time and brainpower. Honestly though I don't really see how that ^^ is much different to the RFC, all you really did is syntactically move some stuff around.
 
You sound like syntax isn't important.
 
Think of it like a chat room where 1 person is talking and several others listening. Rather than have my PHP script check for updates in a database, I'd like (somehow) for the long-polling script to be able to send data back to the listeners when a new comment is made.
I hope I'm making sense.
 
@SenorAmor One way is to have a server side daemon to deliver the messages. The long poll request connects to the daemon (e.g. via a local socket) and waits for a message. When a user sends a message, you send a request to the server, which connects to the daemon an pushes the message onto the delivery queue, the daemon then delivers it to the long poll requests.
Or just use websockets.
 
I had considered websockets, but I have to account for older browsers (like IE 6) and I don't think they support websockets properly, correct?
 
4:42 PM
posted on January 02, 2013 by Paul M. Jones

Previously, on decoupling and dependencies, I said: “Some [Symfony] commenters were dissatsifed with my use of unit testing requirements to discover what a package really depends on, as opposed to what its composer.json file states.” I’m willing to allow that … Continue reading →

 
@DaveRandom you should have suggested node.js. it is webscale.
 
@SenorAmor True. But I would still personally recommend websockets where available, and fallback to long polling. YMMV.
Either way you need a daemon to handle the message delivery if you want instant delivery without bouncing it through a database.
@Lusitanian :-P
 
@DaveRandom @SenorAmor sockjs provides quite decent WebSocket fallbacks
 
I have a system that responds to hundreds of devices all checking in. If a device checks in, one of my operators needs to respond. Right now, they just look at a blank screen. I poll periodically for new data and update the page they're looking at if there's any action to be taken. I'm trying to somehow eliminate the constant db polling
 
@DaveRandom Do you have PHP vote karma by chance?
 
4:46 PM
@LeviMorrison No. There's probably a good reason for that :-P
 
Eh, I have it. Is that any worse?
 
A question that comes straight to the point:
0
Q: PHP SOAP Client request

user1171724I am having a problem implementing a soap request using php soapclient with nested objects.

^ yes pls
 
@hakre close as off-topic, belongs to twitter?
 
@dev-null-dweller Belongs to Tutorial My Ass Free Lancer Pitch Dot Com?
 
good morning btw
 
@MikeB Looks like it got taken care of, yes?
 
@igorw Mornings :-)
 
@igorw A very fine good morning!
 
I like the fact that PHP is community driven, but sometimes I wish there was some inner council that made decisions and I was an influential member of it.
I'm not saying my ideas are always the best, but half the time when I post something well thought out on the mailing list it's completely ignored.
There seems to have been a flood of things I disagree with lately as well.
I will say something about the author of the properties RFC, though: He did actually take and implement constructive feedback.
Even though I still don't like it I believe it is a better RFC than when it was proposed.
 
@LeviMorrison There is an inner council that makes decisions!
But, I've said too much already… :P
 
4:56 PM
Oh, lol :)
 
it's a secret society :)
 
@salathe What are your thoughts on the proposed launch of prototype.php.net on January 15th?
 
@LeviMorrison In a word, "no".
 
Thank you.
I was worried people might actually agree to launch it.
 
The only argument seems to be, "if we release it, people will be spurred on to 'finish' it when the complaints start flooding in". I can't believe anyone really thinks it's ready to go.
 
5:02 PM
Btw, there's a display bug on prototype.php.net
The first contributed note goes down to the bottom of the menu, leaving a big white space
 
Yeah, yeah, known issue.
 
'k, my bad.
 
But thanks for the report :)
 
If only there was... oh I don't know... some place to submit bug reports.
 
5:04 PM
Twitter?
 
Was just throwing it here, since you talked about it
 
@DaveRandom That's acceptable, actually: wiki.php.net/web/redesign/howtohelp
 
@DaveRandom Yes, or random chat rooms!
 
@Touki Not mad or anything. It's fine. It's a pretty 'popular' bug :)
 
@LeviMorrison But it's only a minor issue and doesn't mean the prototype cannot go live next week! :P
 
5:06 PM
I actually thought @GoogleGuy was going to commit the fix for that one because he thinks he introduced it.
 
Are you serious?
 
omg its really awesome ...
 
I can fix it but it'd be nice if someone more familiar with what it might break took over that task.
 
Someone just posted a review of my code and he's gone through the whole horrible massive function and added spaces like foreach() to foreach (), and after IF statements
 
@Jimbo As he should! Spaces or die()!
 
5:08 PM
Is it feasible / useful to have casting with list? Like list((string)$newRate, ... ) = [$object, ...] ?
 
I hate list()
 
@DaveRandom It stole my favorite keyword :(
 
why?
 
@LeviMorrison Rubbish, if I want my code as if($x == 1) { // Do something } instead of if ($x == 1) { // Do something } - that difference isn't a big deal and I prefer the former
 
@Jimbo DEATH BY FIRE!
 
5:10 PM
@LeviMorrison Damn right it did. I want methods called list()!
 
@LeviMorrison Come on.. if I had put if($x==1){//Do something} then yeah, sure kill it with fire
but a space after the if? No way.
 
@hakre That ^^ and it's generally a horrible syntax. It looks like assigning a value to a function return. Smells of VB.
 
Honestly, list should have been created like this: [$a, $b, $c] = funcThatReturnsArray();
 
@LeviMorrison Still looks a bit weird but definitely better
 
@Jimbo But... but... it's not PSR-2 compliant!
 
5:12 PM
@DaveRandom That's how several other languages implement that feature.
 
@NullPointer I saw
And you gained quite a bit of upvotes since :)
 
honestly PHP should have reverse functions in userland ;)
 
That question is spammed everywhere, you'd get a whole lot more attention that way
 
taking the input value though right-assingment, giving out to parameters ^^
 
@Jimbo Just to let you know, spaces after control constructs is incredibly common. Don't get too upset.
 
5:13 PM
@hakre strrev() :P
 
I say just use the god damn array. Properly. If you want separate values, assign them individually.
 
my_func($a, $b, $c) = array();
muhaha.
 
NNNNOOOOOOOooooooooo.......
 
@DaveRandom The only place I might use it is with an array of arrays like so:
 
@MadaraUchiha yo..and yeee... :)
 
Ali
5:14 PM
Hi anyone here with experience with the Zend Framework 1
 
// don't remove the space directly after 'foreach' and before
// the parenthesis or it will break
foreach ($points as [$x, $y]) {

}
 
I see, yeah I never remove that space, its just the space directly after the foreach that I seem to prefer to miss out, not sure why
 
Ali
I'm setting up acl permissions on my blog application and so far I've figured out how to restrict action on resources and individual resources however I want to restrict listing posts based on the user logged in i.e user logged in sees only his own posts
 
@DaveRandom But in general I wouldn't be using an array of arrays like that. I like classes, even if they are pure structure.
 
Why was this extremely tiny code changed approved though :/ I didn't approve it
 
5:17 PM
@LeviMorrison Yeh now that I kind of get - but at the same time will those two extra statements really hurt? Because I'm sure a lot of people would agree that the absolute limit of vars in a list would be 3-4 (from a readability point of view) and the shortcut just doesn't seem worth the bytes it's type in to me.
 
Ahh, group approval. Never mind -.-
 
Ali
I understand that I would make a function in my post module to return viewable posts - however do I pass it the session of the user logged in or should the model access the session directly
looking for a scaleable and extendable design here
 
posted on January 02, 2013 by Anthony Ferrara

In today's video, we're going to explore the concepts of closures in JavaScript and PHP. During this quick exploration, we'll talk a little bit about variable scope and the difference between scoping in JS and PHP. Check out the video: Read more »

 
@Jimbo I always space keyword from opening parenthesis, always. I find it noticeably more difficult to read without them. For some reason though, I don't really have a problem with function() {} - but only that keyword.
 
@DaveRandom including function names?
substr (...)?
 
5:21 PM
@DaveRandom Okay so function() is fine, but not if() {} and foreach() {}.. That's yet another standard to adhere to then I guess
 
Oh, you mean like those, yeah, same here. function() but if ().
 
@Jimbo In my head. I can't really explain it.
@MadaraUchiha No, there's another thing, as call time I omit the space.
 
@DaveRandom Yeah, I'm exactly the same.
@Feeds Ooooh that sounds interesting, nice one @ircmaxell I'll watch it once I get home :)
 
Hey how do I edit my 404 error page
I have a 404.shtml file on my host
 
@benlevywebdesign You use .htaccess for it
 
5:27 PM
, you need to add these directives to your .htaccess file.

ErrorDocument 404 /404.html
 
it has these lines of code
<!-- SHTML Wrapper - 404 Not Found -->
<!--#exec cgi="/cgi-sys/fourohfour.cgi" -->
 
ErrorDocument, IIRC.
 
my host has a file called 404.shtml
 
i am somewhat worn out
evening , people
 
@tereško evening
 
5:29 PM
@tereško I'm sitting cramped in a bus for the last 5.5 hours, what's your excuse?
 
@LeviMorrison +9001
 
(still sitting btw)
 
so what do I do with the 404.shtml file that's on my host?
 
@benlevywebdesign check this out thesitewizard.com/archive/custom404.shtml
 
@MadaraUchiha sitting at work for ~8 hours , sitting in a traffic jam for an hour when going to work , walking for an hour when returning , after 3 hours of sleep
 
5:31 PM
@tereško I don't have to sit in traffic jams :P
 
Although I do get a bit wet
 
@Jimbo I hope you realize how that looks like to me who has no idea in what context you are "wet"
 
@MadaraUchiha Uh oh... Soaking wet, it's chucking it down outside
 
.. was about to point it out , but opted not to go for the low hanging fruit
 
5:33 PM
Haha
 
@Jimbo thanks for clarification
 
No worries @Gordon ;)
Disappointed much?
 
@Jimbo There are no girls on the internet.
 
> “There are No Girls on the Internet” is a tongue-in-cheek adage which implies that there are no female entities actually participating in online activities, especially when it comes to anonymous exchanges in chatrooms and discussion forums. The outdated myth also jests that the Internet is essentially a “sausage fest” dominated and defined by male internet users and a smaller population of male trolls or griefers who pose as women in pursuit of lulz.
2
 
5:35 PM
@Gordon thanks for clarification
 
I need your advice
 
@MadaraUchiha :-D
 
I want to get a PHP installation running and active on a server over at my workplace
Problem is, that workplace is IAF, where getting things in from an external, civilian source, is... difficult, to say the least.
I was asked to send an email to one of the admins, detailing the programs I want to get inside
Should I settle for XAMP or WAMP in order to ease up the transition?
 
@NikiC: I thought of a reason to use our own parser. Right now, parser bugs and features are dependent upon the version of the host PHP...
 
5:40 PM
Or should I insist on installing PHP, MySQL and Apache manually. Will it make much of a difference?
 
@NullPointer Thanks I got it working
 
> BisonWarlock69 probably has a penis
 
@MadaraUchiha virtual machine , which necessary ports forwarded to localhost
 
I just wasted 3 minutes watching that video @Gordon
 
@tereško Impractical, and why? I get a whole server...
 
5:42 PM
@Jimbo not my fault :)
 
lol
 
@MadaraUchiha i assumed that you were talking about your work PC
 
Have a good evening all
 
if it's workpalce server, then set it up by hand
 
@tereško No, I get a (windows, sadly) server, in which I would write PHP applications
 
5:43 PM
Or use a distribution system at last. Using (W|X)AMPP is pretty much a bad idea.
 
@tereško How much difference will it make?
 
@MadaraUchiha Potentially a lot of difference.
 
I'm asking this because whitening (that's what it's called) 3-4 different programs, vs 1 is a whole lot harder
 
Without knowing your use-case, etc, it's hard to say.
 
less likely to have some mystical issues , ability to update the parts independently
 
5:44 PM
define "Potentially"?
 
@MadaraUchiha NO. End of.
 
@LeviMorrison I find it hard to believe any of these applications would be used by more than 100 users simultaneously.
And even that's an overstatement
@DaveRandom Why?
 
the canned servers usually have the problem to get it running for 1 user
scaling up to 100 is not so large a leap as 0-to-1
 
For a start, both of those include all the separate items and more besides so they should in theory be harder to get past the men in charge. Setting aside for a minute the fact that they have both destroyed all their component parts into something that's very hard to use, simultaneously (in all likelihood) introducing new and interesting package specific bugs and security holes.
Get the component parts and set them up properly. And preferably replace Apache with Nginx
 
How's Nginx superior to Apache?
 
5:47 PM
Oh yeh, and last time I checked both of them were using mod_php instead of FCGI. That may not still be the case though.
 
Well fellas, I'm running out of battery here
 
@MadaraUchiha Less bloaty. Kind of a personal preference but at the same time I suspect you will find that the majority of the people in here who know both platforms will prefer Nginx.
@MadaraUchiha Laterz :-)
 
We'll talk more about it once I get home to my charger :)
Cyall :)
 
what I like about nginx: way less sucky configuration, lower memory footprint, extremely performant.
and it doesn't have mod_php.
 
@igorw Never really admined a high traffic server running Nginx so I can't really comment on the performance-y things (although I have heard that said many times), but certainly the sane config file is a big part of what I like about it.
 
5:55 PM
@ircmaxell you mean our own lexer?
 
Right, I'm heading home, later all
 
@LeviMorrison I already forgot, what kind of syntax did you want for the accessors?
 
@NikiC Something more like:
1 hour ago, by Levi Morrison
class PersonImpl implements Person {
    private int $__id;
    private string $__name;

    __construct(int $id, string $name) {
        $this->id = $id; // calls the set id method
        $this->name = $name; // calls the set name method
    }

    get id() {
        return $this->__id;
    }
    get name() {
        return $this->__name;
    }

    set id(int $id) {
        $this->__id = $id;
    }
    set name(string $name) {
        $this->__name = $name;
    }

}
 
@LeviMorrison And how does that in any way benefit us?
In particular, please don't forget that PHP, unlike JS or Dart or whatever has $ properties and no$ methods
I don't see how that syntax would integrate better
And with stuff like automatic accessors it makes even less sense
 
Simple: it's more natural, familiar and it simplifies visibility questions.
It's simply defining a function.
 

« first day (809 days earlier)      last day (4155 days later) »