« first day (1007 days earlier)      last day (3944 days later) » 

Anonymous
7:00 PM
@Sparrow don't worry too much about it. It is good for your second project.
 
Anonymous
Come to my room, and I'll show you my first/second projects
 
I mean this one sabsab.herobo.com
this is the first html and css
@Simon_eQ
 
Anonymous
seems good. But too slow.
 
Anonymous
maybe that is from my side
 
the server is busy .. you know free hosting
 
7:03 PM
@Simon_eQ I'm just stoked because I'm ahead of skeet on the weeklys
 
Anonymous
@Orangepill I noticed that some days ago. I said to myself 'this dude is going places' :p
 
user895378
@Orangepill Holy crap you've answered 792 questions in 2 weeks months???
 
user895378
(sorry, misread months as weeks)
 
user895378
Not as crazy that way. For a second I was thinking ... OMG.
 
Anonymous
May 29 at 21:09, by php NoOb
SOMEBODY do something, he is going to pass me
 
7:06 PM
hmm... can anyone recap me on why PHP doesn't support json internally?
 
@rdlowrey Still about 15 questions a day
 
@Orangepill: has an auto answer script for a certain set of tags that just answers "your doing it wrong"
 
hi all
 
user895378
... which is still a pretty high rate. I haven't answered 15 questions in 2013.
 
@bizzehdee no... but I'll get to working on that....
 
7:07 PM
@bizzehdee you're
 
@Ocramius I'm guessing you have a script for that?
 
(sorry, I can't read that)
 
Yay for
...cats walking across keyboards
 
Anonymous
 
Uh oh.
 
7:08 PM
@Simon_eQ Nice try :-P
 
@Ocramius: im attempting to evolve the english language by merging your, you're and yore to have the same spelling
 
@bizzehdee yoro
 
@Ocramius What do you mean with "doesn't support it internally"?
 
Seriously though, I'm not supposed to be here yet, I'll catch y'all in a bit
 
@Ocramius You Only require Once?
 
7:09 PM
@Jasper $a = {"foo": ["bar", "baz"]}
@Bracketworks can work...
 
Anonymous
@DaveRandom later.. nice move for adding hakre btw
 
@Ocramius it's getting closer... array notation was adopted
 
@Ocramius: i also assume that javascript object notation isnt supported in php because of the first part of its name
 
@Ocramius Also kinda sounds like trying to say "Oreo" with a mouth full of ... well, Oreos.
 
@Ocramius $a = json_decode('{"foo": ["bar", "baz"]}'); works
 
7:10 PM
@Jasper ha ha.
 
@Ocramius it would be a handy
 
@bizzehdee sad sad sad
no, there must be a conflict somewhere
something like a parser catch
 
As for inline: well, php isn't javascript (as a starred message from yesterday nicely said)
 
bugs-beta.php.net what is this?! (or what should this be?)
 
@bwoebi: it appears to be a domain name
a sub domain name at that..
 
7:14 PM
@bizzehdee woah. never thought of this… and what should be hosted on this subdomain?
 
@bwoebi or if you are referring to what it points to: a webserver that has no content to display
 
more than likely, its possible that it is a website... but since its the default apache page, i assume its a new domain that is about to contain something awesome
 
everything should be somthing
 
@bizzehdee that's why I'm asking: what will this something awesome be?
 
@bizzehdee well, I think that's the (strange) assumtion @bwoebi is making, but it may as well have been planned to do something with in the past
 
heck, it may have been used, but after its use was over they forgot to remove the (possibly virtual) server. Either way, the fact a subdomain exists is a very fickle reason to believe it is supposed to go and do soemthing
 
i notice there is a 20 per day limit on reviewing edits.. is there a 20 per day limit on close votes too?
 
here's a thought: what if PHP core allowed you to mock functions, temporarily replacing them with any callable.
 
@Jasper yeah, I think they just forgot it
 
@igorw like monkey patch them like js?
 
7:19 PM
@bizzehdee there's a limit on close votes and one close reviews, but they aren't linked (and the close votes is different per user based on your history if I remember correctly)
 
might be hard to do with opcode caches, but if there is a way to invalidate the cache, it could be doable.
 
ah, so this is why the backlog has now gone past 61k?
 
@Orangepill kind of. in JS they're often in a private scope, so you can't get at them. but generally, yes.
 
@bizzehdee I'd say it's a contributing factor, far from the reason
 
monkey patching isn't what I would want this for. in fact I'd strongly discourage monkey patching, as it just causes havoc.
 
7:21 PM
so A reason, rather than THE reason?
 
the use case is mocking for testing.
 
user895378
@igorw So like:
 
user895378
alias_function('someFunction', $anyValidCallable);
unalias_function('someFunction');
 
@rdlowrey exactly
 
user895378
Because THAT would be AWESOME
 
7:21 PM
OMG i hate going through other people's crap code..
 
user895378
It would eliminate so many testing difficulties for me.
 
user895378
Doesn't runkit do something like that or am I imagining things?
 
it does
 
but you need to provide source
 
user895378
7:22 PM
So it's not impossible.
 
yes, but I want it in core
and I want it for callables
 
how not to right-align:              &‌​nbsp;            &nbs‌​p;             &‌​nbsp;            &nbs‌​p;             &‌​nbsp;          
12
 
@igorw do you need it for testing in core?
 
user895378
@igorw I don't have any idea how to do it but I'd be thrilled if someone made it happen.
 
@CarrieKendall that's left-align when you want to align how not to right-align: in a right-floated container.
 
7:24 PM
@Ocramius or put more simply? that's dreamweaver ;]
 
@CarrieKendall Worse then that ... that's 90's era frontpage
 
i dig through craptastic code like that all day errday
don't you want my job?
 
@rdlowrey if testing is the only reason to do IoC, I don't want to test.
 
@CarrieKendall you can always use <table><tr><td></td><td width="1%">aligned text</td></tr></table>
 
user895378
@igorw I don't think it's the only reason. IoC makes your API eminently clear whether it's in the form of __construct(INeedThisDependencyToWork $dep) or function(NeedThisDep $dep). It makes your code much easier to read and debug.
 
7:28 PM
of course that is tongue-in-cheeck, but I'm starting to think that IoC convolutes code. it makes sense in certain places, but littering an entire code base in the name of testability... somehow feels wrong.
 
user895378
It also makes it FAR easier to implement pluggable functionality.
 
@tereško i resent that comment mostly because i am currently sifting through table-based "design" (loosely using that word)
 
you can always add IoC for those parts that you want pluggable.
 
hmmn, hoping that i can get 50 on stackoverflow.com/questions/17548906/… ... its getting close :D
 
user895378
That's the single biggest benefit IMO. If you're in control of the dependencies a functional unit of code receives, then you're always able to modify what it does.
 
user895378
7:30 PM
Testability can be a huge benefit or a negligible one. It just depends on the needs of the project at hand.
 
so often I hear the #1 reason for IoC to be testing. if that's the reason, then the language isn't flexible enough.
 
@CarrieKendall , I was debating to write an implementation of same with <img src="spacer.gif" />
 
user895378
For example, NASA better damn well be testing hell out of code for things it's blasting to Mars.
 
@bizzehdee you could always beg for upvotes in chat ;]
 
user895378
But is testing really an ultra high priority for mykindergartentoygallery.com ? Probably not.
 
7:31 PM
was considering doing just that
 
@rdlowrey you CAN debug software on Mars .. it has been done before
but if that thing crashlands , no debugger will be able to help
 
Anonymous
@Orangepill is this your first account?
 
that has more to do with modularity and message passing between higher-level components than IoC imo.
 
user895378
@tereško Yes, but it's better if you can debug it on planet earth before sending billions of dollars worth of technology flying through space :)
 
posted on July 19, 2013

2nd Annual Northeast PHP Technical Conference - August 16 to 18! This year’s Northeast PHP Conference will once again be held in Boston, MA from August 16 to 18. This year we are adding a day to the front of the weekend for half-day workshops. We have 2 great Keynote speakers

posted on July 19, 2013

For those who like to do more than just code, we're pleased to announce Ski PHP 2014, which will be held on January 17 and 18, 2014. In the U.S., this is a 3-day weekend, so attendees will be able to enjoy the skiing, snowboarding, snowmobiling, and other activities that Utah has to offer after the conclus

 
7:32 PM
@rdlowrey also, C actually allows you to mock functions if you want to test them at the unit level.
 
@tereško That's what Mars One is for :P
 
@Jasper I find that "Mars One" project quite ill advised .. human body is not compatible with g = 3.7 m/s²
 
@tereško hey you just read my question a minute ago, how do you get the view to ask for data from the model layer when it does not have access to the request? for cases when you are loading entities from user input do they have to be done in the controller and maybe stored in the service that loaded them and retrieved then in the view?
 
user895378
@igorw Mocking is one thing. Saying it's okay to to write this code is quite another, IMO:
 
user895378
function doSomething() {
    $someDependency = GlobalServiceContainer::getItImALazyCoder('SomeDependency');
}
 
user895378
7:34 PM
Everyone knows why global is bad.
 
user895378
And that's what that code is -- disguised global state.
 
user895378
That's the argument against saying "Oh, IoC isn't really necessary" even if you have the ability to mock the dependency at the language level.
 
@David currently i instantiate the view in the bootstrap stage and then call command on it
 
if you want to put "passing data into functions" under the term "IoC" then yes, it's absolutely necessary.
 
$controller->postItem( $request );
$view->item();
 
7:36 PM
@tereško If find it interesting first and foremost and I feel it's interesting to see how we are stretching out into our solar system. And (about) all sci-fi gets disproven by it being commercial. The gravity will indeed be a challenge
 
the method name is derived from URL , minus the REQUEST_METHOD bit
 
@rdlowrey I'm generally referring to IoC as passing behaviour. which is sometimes necessary, but should not be necessary for mocking.
 
@Jasper what it actually might end up doing is kill all space exploration for 21st century
 
assuming there is a way to replace behaviour. not global mutable state. big difference imo.
 
they want to turn it into a realit-tv show ... and the results will not be pretty
 
7:38 PM
oh i left out how not to add padding around characters: &nbsp; |&nbsp;
 
more something along the lines of slow-motion serialized snuff film
 
user895378
@igorw I think you're making a very valid point. Unfortunately in the absence of function aliasing we don't really have any other choice when it comes to testing behavior in PHP :/
 
@tereško so you are saying the command/action you call in the controller is always the same as the method called on the view minus the request type?
 
user895378
Which brings it full circle and makes me say, "please, can we have what @igorw is asking for?"
 
@David currently , yes .. but i'm still trying to figure it out myself
a quite promising alternative is to actually implement the observer pattern
 
user895378
7:40 PM
From that standpoint, function aliasing could conceivably break OOP's stranglehold over PHP and open the door for more functional code :)
 
@tereško i was thinking of doing that but it seems sort of pointless on the web. i have not given it much thought yet though
 
@tereško Because people get killed or because they cancel because they end up unable to get over that problem?
 
user895378
Because if you want testability right now in PHP your only option is classes and passing around the resulting instances in the guise of IoC.
 
@rdlowrey :)
 
@tereško oh yeah while you are here, do you call a template the files with HTML in them?
 
user895378
7:42 PM
Fascinating. We need to agitate for this.
 
@Jasper because people will publicly and horribly die. Which will turn society against space exploration. Such trauma might require a whole generation to change, before sending people to other planets becomes viable option again.
@David well .. it's the html with php echo's with the class that services such files
 
@tereško ok. when you say "change the template in the view" do you mean just change some string class property with the name of the template or do you have an actual Template object?
 
@tereško It's 0.37g (yes you corrected it, but I still didn't realize that immediately myself). We've had astronauts in space so even if it does happen, it'll take quite some time before that happens. There's a risk, but I really don't think it'll be as bad as you're saying
 
@rdlowrey http://localhost:1337/erere/erewrewrew/ewrew
 
@Jasper thing is - astronauts can come back to earth
 
user895378
7:45 PM
@Baba what happens?
 
$myApp = function(array $asgiEnv) {
	var_dump($asgiEnv);
    $body = '<html><body><h1>Hello, World.</h1></body></html>';
    return [$status = 200, $reason = 'OK', $headers = [], $body];
};
@rdlowrey query string missing
 
@David where exactly .. you will need to provide the context
 
@rdlowrey Would open an issue
 
user895378
@Baba You mean the 'QUERY_STRING' key doesn't exist if it wasn't present in the URI?
 
@rdlowrey yes
 
user895378
7:47 PM
@Baba Okay, I'll fix it -- that's an oversight on my part :)
 
@rdlowrey was that intentional ?
@rdlowrey ok
@rdlowrey No need for issue then
 
user895378
@Baba No, I think that's something that should always be present if for no other reason than to allow this kind of code without an isset call:
 
@rdlowrey noticed it when i was trying to implement URL rewrite
 
user895378
$requestUri = ($queryString = $asgiEnv['QUERY_STRING'])
    ? str_replace($queryString, '', $asgiEnv['REQUEST_URI'])
    : $asgiEnv['REQUEST_URI'];
 
user895378
Just makes it easier if you don't have to think about it, even if you could use empty()
 
7:51 PM
@rdlowrey Ok ...
 
@rdlowrey str_replace('?' . $queryString, '', $asgiEnv['REQUEST_URI']) ? It's my understanding that the question mark is not part of it
(evening @all)
 
@tereško like when the view gets a product for example but the supplied product ID does not exist. then you would change the template wouldn't you? and set the response header to 404
 
@tereško What I meant was, we've had astronauts in 0g for over 200 days, and 0.37g is not nearly as bad as 0g. If there are gravity problems at all, they won't be for the first couple of years. Of course, there's a risk, I just don't think it'll be as "horrible" as you stated.
 
user895378
@DaveRandom I've retained the ? in my implementation. It's an easy thing to change though. I think the ? is present in CGI implementations though? I could be wrong.
 
@Jasper it's not 0.37. It's 3.7m/s² .. more then a third of earth-normal
and gravity is only one of factors
 
7:53 PM
@rdlowrey I'm reasonably sure it isn't, but I equally could be wrong
 
@tereško 0.37g > g /3
 
I must admit it's not a variable I use a whole lot in the general way of things, what with the existence of $_GET
 
user895378
@DaveRandom I think I tested what you got from PHP's $_SERVER['QUERY_STRING'] behind apache and just did whatever that returned, but it's been so long I don't really remember :)
 
@tereško and sure it is, but it is the one you brought up
 
earth normal is 9.81m/s²
 
7:54 PM
One thing I will say is that I'm pretty certain parse_str() will throw up with it, either you'll get the question mark on the beginning of the first key or it'll just fail outright
 
and the gravity is one of the major factors that we can do nothing about
 
And since this is a PHP driven implementation, it makes sense if it's designed to work with the PHP std lib ;-)
 
thats it, im giving up... the desk fan is being put up to number 2
 
$mod3 = $first($compose(
    $curry($operator('==='), 0),
    $curryLeft($operator('%'), 3)
));
$mod5 = $first($compose(
    $curry($operator('==='), 0),
    $curryLeft($operator('%'), 5)
));

$grammar = $pattern([
    $conjoin($mod3, $mod5),
    $mod5,
    $mod3,
    function() { return true; },
], [
    $static('fizbuz'),
    $static('buz'),
    $static('fiz'),
    $self
]);

$results = $range(1, 100)->map($grammar)->toArray();
 
@Jasper there other environmental factors: radiation, weather, dust, air pressure
 
7:57 PM
@ircmaxell ich mag.
 
@tereško uhm yeah: 0.37 * 9.81 = 3.6297 so it probably should have been 0.38g not 0.37g, but that's not much of a difference
 
@igorw :-P
 
@Jasper oh .. sorry .. i thought that you were saying that mars had 0.36m/s² ... misread a bit
 
@bizzehdee I melted earlier. It's really difficult to type when you're a puddle on the floor
Although there are people in this room who are probably laughing it us complaining about 28C
 
user895378
@igorw This might be a terrible idea and I haven't thought it through at all but ... what if accompanying the aliasing behavior you had access to the aliased function's capabilities:
 
user895378
7:59 PM
function someParent() {
    return 1;
}

function someKid() {
    if (is_alias(self)) {
        $parent = get_alias(self);
        return $parent() + 1;
    } else {
        return 42;
    }
}
 
@igorw the cool thing here is that it's all done with iterators (and generators) behind the hood. So before calling toArray(), no processing happens...
 

« first day (1007 days earlier)      last day (3944 days later) »