« first day (1186 days earlier)      last day (3759 days later) » 

12:22 AM
@NikiC By the way, most of the examples I see for people using named parameters have really bad API design. I understand that this is not your fault, but I just had to point it out ^^
@zerkms I disagree with that. REST is really just adhering strictly to HTTP specs, so in that sense it is a really well-defined standard ^^
 
What do you know, I actually got a response for a chat question in meta..
 
12:56 AM
Friend won $50.000 today, says they want to try to drink it tonight.
 
@webarto With E 0.25 / beer they have to be damn fast drinkers
 
:D
That reminds me that I need to "reset" these days.
 
1:27 AM
I've got a query statement that runs in PHPMyAdmin (both local and dev instances) as well as JDBC driver locally, but not dev instance. Any thoughts on where the problem could be? (offending line: AND linkedinflags.updated > Date_sub(CURRENT_TIMESTAMP, INTERVAL 15 day) )
 
1:46 AM
Hi I'm new here does anybody know a really good tutorial for zend 2
 
@hakre I think you and rdlowrey have already covered some of that, but in general I have to say the quality of the proposal is quite poor at the moment.
There has been some feedback that has been implemented so there are some rough spots that have been cleaned up.
At its heart it is still fairly flawed in my opinion.
 
Depending on how well the feedback from the community is received it might shape up.
But with people like rdlowrey not participating it may end up being of low quality and therefore just like the PSRs that came before it I will ignore it.
I've decided that my time is better spent reading up on HTTP 2.0, so I'm probably not going to contribute much either. Said otherwise, I decided that while it might be worth contributing to the PSR my time would be better spent with HTTP 2.0
 
user895378
Yeah, if I disagree with the PSR I'll simply ignore it. I don't care. Bad standards lead to fragmentation.
 
You probably have higher priority things to do as well ^^
 
user895378
2:01 AM
Yes, much higher.
 
rdlowrey: By the way, HTTP 2.0 draft 09 will have interoperability testing on the 22nd so we should see the new draft soon after.
 
user895378
Awesome. I haven't looked at it in months and I don't remember a ton about it TBH.
 
According to some people working with it, this is expected to be the final draft.
Or at least a draft that people should have real confidence in supporting with few changes before release.
 
user895378
I am a little sad at the prospect of a bit-based protocol (instead of byte-based) preventing me from firing up a telnet session to test things with manual input from the keyboard.
 
That is one of the points that vendors have pointed out.
However, some vendors require TLS anyway so even if it wasn't bit based you wouldn't be able to do that most likely.
 
user895378
2:05 AM
I need to read the most recent draft ... I feel like I don't have anything useful to offer the conversation.
 
user895378
I'm fairly excited about the non-blocking pthreads dispatcher ... I've been trying to get a good working version of that without any memory leaks and with robust error handling for nearly a year.
 
It's still up in the air whether or not TLS will be required by the standard, but some vendors are saying they'll require TLS anyway. This likely means that even if it isn't required it will be required, if you catch my drift.
 
user895378
Yeah, I getchya.
 
@rdlowrey Anything specific about it that excites you? Maybe a certain use-case or two?
 
user895378
Yeah, one in particular :)
 
user895378
2:10 AM
I'm likely going to kill the existing process-based Amp dispatcher altogether in favor of the pthreads version after extensive testing and use ... I don't care to maintain it and if you really need threaded multiprocessing in a non-blocking environment you should be able to install pthreads.
 
user895378
The process-based async call dispatcher was a great learning project, though ...
 
Yeah, any foray into concurrency is probably a great learning experience.
 
2:32 AM
now I just feel there's nothing to look forward to
> visited 1342 days, 1339 consecutive
 
Yay. New picture day!
 
user895378
I might be the only person on planet earth who pronounces the SPDY protocol acronym as "spidey" instead of "speedy" ...
 
@ircmaxell You mean because you surpassed 1337?
 
:-P
I did post a screenshot though
 
2:42 AM
@rdlowrey I pronounce JSON with an "ah" sound like "Jay-sahn" which seems to be pretty common but Crockford seems to pronounce it more like the name "Jason".
 
user895378
I've always said "Jay-sun" ...
 
I pronounce it "Jason".
Capri-Sun?
 
user895378
Fruit-Punch!
 
Maybe it's an east vs west type of pronunciation.
 
I have the following method:
 
2:44 AM
Everyone out here says it like I do, so it was funny to hear "Jason".
 
public function updateLeagueStandings($teamName, $win, $loss) {
	try {
		$sth = $this -> db -> prepare("UPDATE teams SET wins = wins + (:winsNum), losses = losses + (:lossesNum) WHERE Name = `:teamName`");
		$sth->bindParam(':winsNum', $win, PDO::PARAM_INT);
		$sth->bindParam(':lossesNum', $loss, PDO::PARAM_INT);
		$sth->bindParam(':teamName', $teamName, PDO::PARAM_STR);
		$sth -> execute();
	} catch (Exception $e) {
		header('Location: /error');
	}
}
 
My picture hasn't updated yet :-S
 
user895378
You mean everyone doesn't just say "Javascript Object Notation" ???
 
It's called like this:
$win = 1; $loss = 0;
updateLeagueStandings($db7, $awayTeamName, $win, $loss);
However, the database isn't being affected.
There is no error message either.
 
Well, if that's actually your code it isn't surprising
You pass 4 args; the function defines only 3.
 
2:45 AM
No, there is a bridge in between that I haven't included.
function updateStandings($db, $teamName, $win, $loss)
{
	$db -> updateLeagueStandings($teamName, $win, $loss);
}
that's the bridge ^
...
 
Oh, and incase you haven't seen the latest hilarity
@savant @codebyjeff i don’t *owe* anyone access to the room
@savant @codebyjeff really all analogies aside, i can let or not let whoever i want in my IRC channel, and it’s not an injustice either way
 
user895378
 
:(
Don't leave me
 
@AGirlSaidMySmileIsCute He's not talking to you, he's referring to ircmaxell's comments.
 
@LeviMorrison :|
 
2:49 AM
@AGirlSaidMySmileIsCute Are there really no errors or none being reported?
There is a difference.
 
No, it's a blank white page.
I enabled error reporting to show everything, but nothing's being displayed.
 
Did you check logs?
 
No, one sec.
php error log shows the same errors that I can already see.
 
Then why don't you work on fixing those? lol
 
Not sure if you're sarcastic, but that came off as a little rude.
Anyways, thanks for the help.
 
2:55 AM
No, I didn't mean it as rude.
It's quite common that one error can cause a string of others.
It makes sense to tackle the ones you know about.
 
What I meant was the logs are showing errors from before, which don't exist anymore. It doesn't show any new error past the one that I last solved.
 
Oh, I see.
I've reviewed your code again and don't see anything out of place.
If there's a problem in what you posted I don't see it.
Sorry, wish I could help more :/
 
lol, Otwell's got his knickers in a bunch.
 
3:13 AM
@LeviMorrison Perhaps:
0
Q: MySQL Query not updating values in the database in PHP

AGirlSaidMySmileIsCuteI have an if/else block of code below that is supposed to call a function with specific parameters, depending on the situation. The function updates specific values in the MySQL database. However, the database values are not being updated. What am I doing wrong? The following is my code: proces...

 
@ircmaxell I'm trying to think of a common resolution you could aim for, but 1920 days, 1080 consecutive is far gone.
 
Hehehehe
 
Well, 1648 is floor(√e · 1000)... I guess that's something to shoot for.
Better, 1764 is 42²
 
3:31 AM
@ircmaxell omg, I can't take this guy anymore.
 
nope, tis fubar
this was my "answer":
I am reminded of the difference between a leader and a manager. Managers dictate, leaders inspire. Step up and be a leader...
 
Awesome.
The guy is acting like he's the boss.
 
sadly, it will go over everyone's head what it's referring to, but whatever, better than descending into another freaking war
/me is off to bed. Goo dnight
 
Good night.
I'm out too, 4:35AM, third shift :P
 
4:21 AM
Quiet night
 
good morning.
yeah it is
 
Moynin @Orangepill
My avatar finally updated.
 
4:35 AM
Dear Dan, this is a reminder for later. From, Dan.
 
user652649
4:48 AM
any idea on the reason PDOSTMT::setFetchMode won't work with FETCH_FUNC ?
 
5:21 AM
how to delete row matching particular id in doctrine 1.2 in symfony 1.4
`$q = Doctrine_Query::create()
->delete()
->from('apUser')
->where('username = ?',$fields["mobile_no"])
->limit(1);`
will this work?
 
Morning.
 
6:01 AM
Morning everyone! I started learning CodeIgniter last week and I've run into a little doubt regarding active records
I'm assuming CI takes care of sql injection by escaping user input, right? So if I do something like:

$this->db->where('id'=>$id, 'location'=>'$location');

where $id and $location are user inputs, I won't have to worry about escaping them?
 
Hello.
 
user652649
vote! vote! bugs.php.net/bug.php?id=51308 vote! vote! =)
 
7:20 AM
morning all
looks like this is happening ...
#php it is 7:23am, eyes open for ~25 minutes, I already branched PHP ... this is some kind of record for me /cc @philsturgeon
 
user652649
got hacked?
 
(just wanted to see what they said, this is the quickest way to <pre> text)
 
user652649
lol
 
nah they are messages from irc servers, but my client formats them so they are unreadable
 
user652649
monospace ftw
 
user652649
7:30 AM
mission impossible: use a custom iterator on pdo's unbuffered queries' resultsets
 
user652649
i failed at everything, i'm stuck with mysqli
 
to be honest, I know we tell people to use PDO, but I use nothing but mysqli
@rdlowrey looks like that PSR is happening ... groups.google.com/forum/#!topic/php-fig/H1Lr7FYxj94
that's what mtdowling does, he works for amazon web services, and does usually know what he's up too ...
 
user652649
as first impression pdo's api looked to me a bit weird... i would have used a pdoresult class as in mysqli instead of mixing everything up inside pdostatement... basically i'm allowed to call $aaa->fetch() but only if i called $aaa->execute() before on the same object. i believe this is bad oop (i'm not pretending i know oop in any way xD)
 
user652649
same goes with iterators... pdostatement implements traversable... i'd have liked to see iteratoraggregate or at least iterator. this makes totally impossible to override the "default iterator"
 
user652649
mysqli at least has methods that allowed me to wrap the bundled traversable in a custom iterator
 
user652649
7:44 AM
super late, going to work, later
 
lata
terrible ... wapache wtf ...
 
 
1 hour later…
8:50 AM
Morning
 
Phil sure is using the framework topic a lot these days. Wonder why.
 
work work work
 
9:09 AM
moin
 
@JoeWatkins morning
 
moin @RonniSkansing
 
9:24 AM
Hey Joe
 
moin @Fabien
 
How's your regex? :D
Pinging @Suhosin
 
any alternative of array_filter?
 
9:44 AM
 
Hey @Fabien
 
@JoeWatkins had some strange seg faults, would you be willing to take a look? gist.github.com/edorian/8415837
 
@igorw sure, what's this for then ?
 
ThW
Good Morning
 
@JoeWatkins php-fpm with ~50 workers, getting lots of these in production
 
9:59 AM
mroninningi
 
morngintrdfs
 
ThW
yeah, need coffee ...
 
@igorw you're invoking a refelction method with arguments that are using recursion I think ? and you have a shutdown function registered, show me how it's registered ?
 
@JoeWatkins I'll see if I can build a minimal case with that...
 
cool
 
10:07 AM
mornings
 
morning all
 
huh, each time I'm thinking about some hard algorithm question, I'm forgetting about time Oo
 
In case anyone's interested, I found the FileSystem API last night, really awesome for having server -> client downloads with a progress bar etc. Thing is, it only works in chrome, but there's idb.filesystem.js that allows FileSystem API usage in other browsers (any that support IndexedDB).
 
Thing is, it only works in chrome violates really awesome
 
I'd say it only supplements it, not violates.
 
10:15 AM
@AlmaDo Mozilla has their reasons for not supporting it - but if you can get a solution (as above) that works all around, with the minor setback of another lib needed, it's fantastic.
Just something I thought I'd share :-)
 
@JoeWatkins looks like there is a shutdown function in which there is a call_user_func in a try/catch block
the method called by call_user_func throws an exception, that causes the segfault
any ideas?
 
get me a reproducing script and I'll take a look at it ...
I think it's going to need a general fix, executor globals should know when the vm is shutting down and prohibit exceptions from being thrown
 
@igorw isn't that some sort of "constructor in destructor"?
 
I don't really have a reproduce case atm, it only happens in prod, only for some requests
@AlmaDo what do you mean?
 
@igorw well, if only for some requests, then I doubt that I was correct in guessing reason :p
 
10:22 AM
zend_try {
		php_call_shutdown_functions(TSRMLS_C);
	} zend_end_try();
it shouldn't really matter if a shutdown function does throw
so we can't really fix it by disallowing it to happen since that'd be incompatible with the way it's handled now, we really need code that produces it so it can be debugged I think .... if you get some traces that look different it might give us something else to look at ...
I'd actually think the recursion one is going to be the place to start, helpfully the addresses are optimized out, but it really looks like ordinary recursion, which I guess you didn't program ....
wrapped in try too
 
@JoeWatkins That's not what's happening though, the CUF target is throwing but the actual shutdown should be catching it before it bubbles up to being suppressed by the shutdown handler. Possibly it's the fact that it's being caught that's the problem - the shutdown wrapper has free'd the exception before it hits the catch?
(according to what igor said)
 
it makes no difference whether cuf throws or the registered function, I think if it were this, it would fault everytime I executed code that done this, and it doesn't, I can't reproduce it ... the fact it's intermittent leads me to think it's not even connected to this ... first dump really looks like recursion ...
or it could be something else completely, but I see no logical path to what is occurring with cuf/throw ... can you make it do anything unexpected ?
 
10:37 AM
@JoeWatkins Just trying now
 
Hey @Suhosin. I was hoping for some regex help please. I have already solved my issue but I was just wondering how I should have done it.
I am looking to match everything up to but not including the second instance of a character
I got here, but it grabs everything after too, so half win half fail. /(.*?)-(?:(?!-).)*/
 
@Fabien what's the format of the data ?
 
fabien-lastnamehidden-93.jpg
 
are they really names ?
(I'm asking if you're making the assumption that the second instance of a character marks a natural boundary in names?)
ah you want fabien-lastnamehidden
 
10:54 AM
@JoeWatkins I cannot. I can make it segfault with an infinite recursion but that's not unexpected. The thing about that though is a) the trace that looks like recursion is not that deep, I wouldn't expect the stack to overflow that soon unless the recursive function is slurping a huge block of stack memory or every iteration, which would be very very difficult to engineer even if you were trying, the vast majority of the allocations would go on the heap
2) something different happens at the end so even if it is a recursion, it looks like the recursion has completed by the time the fault happens
 
out of the two dumps, it's more suspect though
 
a) and 2), quality numbering scheme there
@JoeWatkins That I grant you, I suspect it's a red herring though, in general without the PHP src that cause it it's somewhat blind guessing though
 
it could be accidental recursion leading to a path that was never meant to be traveled, which is why the end segfaults ... it was never meant to be there ... without reproducing script we are both stabbing, wildly, into the dark ...
 
One of the points I'm wondering about is that both of them show ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER which is only called once in zend_vm_execute and preceded by an E_STRICT
waves to chat hi, it's been a year again i guess :)
 
@JoeWatkins Cheers. Never would have got that myself -_- Still looks like hieroglyphics to me...
 
10:59 AM
and we're (I'm a colleague of igor now :) ) at least not having any E_STRICTs in the logs as far as i can tell.
 
are you using a patched php @edorian ?
@Fabien np
@edorian lxr.php.net/xref/PHP_5_5/Zend/zend_vm_execute.h#19950 this doesn't make sense ? if you have additional patches, what are they and where can we get them ?
 
Holy crap, @edorian is here!
Welcome home :-)
 
hm, what does ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER do exactly, something like function (&$foo) { $foo = ...; }?
 
@JoeWatkins PHP 5.5.7-1+sury.org~precise+1
@DaveRandom and all it took was 20 segfaults per second on production systems :) - Thanks for the warm welcome
 
VAR_VAR
variable variables
assign variable variable
 
11:10 AM
$$foo = ...?
 
@edorian If we'd only known... :-P
 
@edorian can you download the source for that build and stick zend_vm_execute.h on pastebin or one of those sites so I can look at it ...
so of all the segfaults these are the only two traces you get ?
 
@Fabien You want everything up to the second hyphen?
 
11:22 AM
Correct
 
@DaveRandom you seen that arrayof patch from yesterday ?
 
@Fabien /([^-]*)-([^-]*)/
 
@JoeWatkins I saw you talking about it, not looked at the actual patch yet
I love the concept though, even if it is of dubious usefulness without scalar support
 
yeah but when scalars come, and I'm sure they will ... pretty neat ... pretty neat now I think, I was just writing tests ...
function test5(array[] ... $arrays) {
	return $arrays;
}

var_dump(test5([array(), array()], [array(), array()]));
dude, is that php ?
 
@JoeWatkins You don't need to escape hyphens if they're the only (or first, or last) item in a character group fyi
Also don't need to escape hyphens outside of character groups, they are literals
 
11:26 AM
I imagine it's relatively slow though compared to a "proper" typed array, presumably the validation requires an O(n)?
 
yeah of course, but the type system needs improvement in general ... the alternative is much slower in php but performance shouldn't be the driving force, the ability to write and document api's more precisely should be the driving force imo ... variadics does type hinting, it's just the same check really ...
 
@JoeWatkins ppa.launchpad.net/ondrej/php5/ubuntu/dists/precise/main/source that would be the sources list - Doing a apt-get source php5 and pasting the file: gist.github.com/anonymous/8416880
 
Cheers @Suhosin :)
 
@JoeWatkins Of the ~500 core dumps that actually worked those are the only two that where "different looking". Yeas
 
@Fabien May be worth precursing with a /-/ to ascertain that there is at least one hyphen in the filename.
 
11:35 AM
@edorian can you get attached to a process with gdb ?? I'd break on that function, see what's actually happening, you should be able to get the current file and line (php) from somewhere in the trace, that should tell you what you expect to happen and stepping through the function should tell you what is not happening ...
@Suhosin I didn't know that ... I'll still escape all the things probably, force of habit ...
@edorian super hard to be helpful ... hope some of this is getting you somewhere ...
 
any recommendation about php design pattern?
 
can somebody answer my question? wordpress.stackexchange.com/questions/129696/…
it's to easy but not for me;)
 
@fidz.id yep. do not use a thing which you have no idea about
 
@JoeWatkins I'm really really grateful for your help. You've gotten me way further than I would have gotten on my own :)
@JoeWatkins it just takes me a bit is all
@JoeWatkins When you say "get attached to a process" to you mean load in the core dump file or do you mean "find a running segfaulted php-fpm process and attach to that one?"
 
11:52 AM
@edorian I mean attach to a worker and force it to segfault be stressing it like your production server ... do this in your development environment obviously, since requests will be held up when you are stepping through that function, you'll eventually know how it is supposed to execute and be able to come up with a more precise way of breaking execution than just on function entry
the core doesn't show you what you want to see, it's only a backtrace, you want to go in the opposite direction during execution ...
segfault leads to abort, so you can't attach after it has faulted, you need to attach before and watch it execute
 
We don't have many F-End Devs in here do we?
 
Doubt it
 
if you're a frontend dev you're too busy to chat ... you're making your javascript/css work in IE3
 
what's the difference between f-end developer and just developer?
 
@AlmaDo jQuery
 
12:02 PM
@Jimbo ? what does jQuery has in common with development?
 
@AlmaDo Laziness :P
I've had this before - what's the best way of setting up a class constant to use the current directory? It wont let me do: const DIR = __DIR__ . "/dir";
 
constant expressions let you do that in recent php ...
 
@Jimbo hm.. how that been. If I'm correct, "jQuery is an ancient armenian word what means 'I don't know how to use javascript' .." - or something similar
 
hey
 
@JoeWatkins Unfortunately stuck on 5.3 at work :(
 
12:05 PM
have you thought about buying a really big scary gun to take to work with you ?? people don't tend to argue with people who are holding big guns, bet if you went into work with a big gun and said we should upgrade php, you'd get your upgrade ...
 
@JoeWatkins At least here I am doing a lot with newer Fed stuff.
Doing my first SASS now.
Learning a fair amount of jquery (would prefer JS but time...)
 
I'm a frontend dev among other things.. and JS is quite cool, once you start using something like Backbone.js
Without that, I seldom want to even think about JS
 
@JoeWatkins Nah, dev lead is way bigger than me. He's a geordie, he'd kick my ass
Although, I could grab a usb mini rocket launcher from amazon.. wanted one of them for ages....
 
That + webcam + code for auto tracking
and facial recognition
 
sounds a bit interesting ... I always hate having to work with js .... and actually it's pretty terrible platform if you don't pick a framework ... it's handy to know what the framework is executing but in the real world, you certainly don't want to be without a framework in javascript ...
 
12:12 PM
I used to work with jQuery ever since it was released.. it's really helpful to get things going, but within 30 minutes you end up with a huge, terrible mess unless you're really, really careful and not under deadline
 
its not php, there's not one implementation of the language, there's a whole bunch and they are mostly very inconsistent which is the reason for the frameworks existing, they currently don't add any functionality whatsoever to javascript, what they do is make it's usage uniform across browsers, which you definitely want ...
 
But backbone.js + require.js do so much for JS development, those two are one of the best tools one can use to ease their frontend dev life
 
@Jimbo I'll never understand why people leave it so long to upgrade ... even if you have code that requires some work to run, which from 5.4 shouldn't really happen, it's always going to be worth the effort, especially if you are coming up to being three minor versions behind, 5.5 is a very different animal to 5.3 ... 5.3 is crap ...
and 5.6 is going into cycle this year (month) ... if guns won't work ... rocket launchers sound like a good idea to me ...
 
@JoeWatkins Dev lead has a fair point - a lot of our code is dependent on PHP 5.3 and a few things on 5.4 do actually break this. It's not just PHP code that we run, we have a lot of services that pull data from the PHP that are running live. We have a lot of out of date linux (system) packages as well, because (for example) things like ffmpeg will only work for us exactly how it's set up. From a sysadmin perspective, upgrading is hell and dev lead doesn't like those devs ..
.. that always stay up to date with every minor version of everything
It would be a lot of work to upgrade
and there's nothing to justify it yet
 
nah you lag a minor version behind, it's reasonable to be running 5.4/5.5 right now I think ...
 
12:19 PM
My argument was that I really wanted array and constructor dereferencing within php 5.4, amongst a few other things, but these weren't big enough arguments to have our whole system upgraded
 
that depends on what you mean by justifying, 5.4 has real perf improvements over 5.3, 5.5 comes with opcache and has big improvements over 5.4 ...
that can translate to requiring less actual machines, money in the pocket ...
 
What percentage of improvement though, he'd want numbers and tests on our specific platform, only cold, hard facts -.-
 
check the rfcs, the changes are documented and dmitry included the numbers ...
string interning, runtime caches for op arrays, it all got quite clever after 5.3, and then opcache came along, there's no matching that however you setup 5.3, none ...
 
@JoeWatkins If it wasn't just me proposing the idea, I'm sure it would hold weight. But because it'd be only me who cares, then it won't go anywhere unfortunately
 
If the upgrade yields benefits, such as more money saved than it's spent to upgrade the codebase, then any boss in this world will instantly opt for it..
 
12:28 PM
team members should work together :) get them to see the facts, you don't even have to convince them of anything, just show them the facts ... everyone will be better off, 5.3 is unsupported, if your system is brought to the ground tomorrow by bugs in PHP tough shit, nobody is going to fix it, nobody can fix it if we wanted too ... more importantly than get them to upgrade this time, I'd focus on changing the minds of the people in charge, allowing you to track the development of php
at a sensible distance of course
why not benefit as soon as possible from the work that is being done, sometimes it allows you to buy less machines, others write better code ... there's always going to be a very good reason ...
 
quick question
I need to replace last comma in a string and add " and "
in php
any help?
 
is that a joke?
 
ok got it
sorry was in tension here :)
 
@Jimbo I dont even work on our PHP and I've managed to get this company to dump 5.2 :P
On friday our last 5.2 server will be turned off
and 5.4 will be the lowest version we use in house
 
@Suhosin (5.2 -> 5.3) > (5.3 -> 5.4)
 
12:39 PM
With 5.5 used on 40%
 
user895378
@JoeWatkins I'm aware. Wrapping curl_* doesn't make you an http expert. Anyway, it's bad standards design that's the problem, not HTTP non-adherence. Beyond that, HTTP is about to change with 2.0 and the streams abstraction is a terrible idea. It's quite obvious no one in the discussion has any experience with HTTP as a server. It's seriously misguided and I will ignore it.
 
user895378
It annoys me because all they're doing is telling people what to do. Nevermind they don't have the first clue how it affects anything outside of an HTTP client. They aren't helping anyone. No one is saying, "Oh gods above, why is it so hard for my HTTP client to interoperate with other HTTP clients." Fucking bureaucracy for the sake of bureaucracy.
 
@rdlowrey Hey man, got your tweet, I'm busy with work atm but I will be taking a look at your code tonight to see if I'm up to the job
 
user895378
@Jimbo Oh no worries. Whatever.
 
@rdlowrey Not "whatever" lol, I'm serious, I'll be reading it and seeing if I consider my skills up to scratch
My code is nothing on you guys
 
user895378
12:55 PM
@Jimbo Not true ;)
 
user895378
And besides, the best way to learn is by doing.
 
1:11 PM
moin Daniel
 
user895378
morning :)
 
user895378
@JoeWatkins My pthreads things are working really well, although when I put it under major stress (like, way more threads than anyone should ever use at one time) I was able to blow it up and get a segault. So I'm pretty sure there's some problem at the extreme edges in the extension. I'll see if I can't tease out the cause, but it's a non-issue right now because it only happens if you do really dumb things.
 
@rdlowrey that's not so surprising, tried --enable-pthreads-pedantic ?
(it removes the trust from tsrm, and used to be the default mode, when you are initializing threads, if an extension misbheaves there is no other way to taim it other than with pedantic, which acquires a global lock just during MINIT of extensions)
by misbehaves I mean manipulate some real global or otherwise makes some thread unsafe system call referencing a global or something like that ... doesn't happen much so switched from the default a few minors ago ...
 
user895378
I'll try it out ... It's definitely a non-issue though because I could only make it happen when I opened > 512 threads at one time in a process.
 
Hi
 
1:19 PM
glad to hear it's working well otherwise ... yeah can't really imagine a setup where that's going to be sensible, at least for the next 5 years or so anyway ... still if we can reproduce reliably we can solve it ...
 
user895378
Yeah, I'll see if I can't isolate the problem.
 
I have a Question, How do I update a JSON file, without completely over writing it?

E.g.

{
"a" : "foo"
"B" : "bar"
"c" : 5
}

and I want to change "c" to 15 ?
 
user895378
Hopefully I'll have some benchmarks for threaded synchronous server response generation today ... I expect them to be comparable to apache MPM + zend opcache
 
there should be a point at which you surpass the performance of that, but it may not be a point you can reasonably reach while testing ... since quite a lot of the overhead of zts/mpm is the initialization of a context per request, and you're not doing that, I would expect you to get higher numbers ... or would expect a real setup, getting real traffic, to achieve higher numbers ...
I always found ab and other stuff like that to be barking up the wrong tree really, what we want is a network of servers online that we can point at a service, this would be much more realistic ... they'd run something like ab I guess ...
travis-ab ...
 
user895378
Well ab itself is utter garbage. You can easily simulate real load with better tools (I prefer wrk)
 
1:26 PM
well it's not real load, you're limited by your own hardware
 
user895378
Yeah, but not that limited if you have good hardware. You can really hammer a service with threads using wrk
 
user895378
Besides, with any service using the php web sapi one machine with good hardware is more than sufficient to bring it to its knees.
 
yes, that's true ... it kind of meant to be like that ...
 
@deep regex?
 
user895378
> zts/mpm is the initialization of a context per request, and you're not doing that, I would expect you to get higher numbers
 
user895378
1:29 PM
^^ Yes, but my server is written entirely in userland php and not C :)
 
user895378
So some things like that are faster but many other are slower because they aren't compiled
 
when you initialize threads you do the same thing as apache worker mpm does for accepting requests, so you feel that initial hit whatever, logically though once you have spun up a bunch of workers you don't have to put up with that anymore and performance should increase considerably, depending how often you are killing workers I guess ...
 
user2286243
@deep You can try the following code
 
user2286243
$a='{"a" : "foo" ,"B" : "bar" ,"c" : 5} ';
$b= json_decode($a );
$b->c=15;
$a= json_encode($b);
echo $a;
 
user895378
True ... the setting is configurable for the user but I default to respawn a worker thread after 128 requests to avoid the problems with leaky code, etc.
 
user895378
1:33 PM
And of course, all the usual PHP configs (e.g. set_memory_limit) are available behind the settings I expose specifically.
 
user895378
Since it's not possible to change function/class definitions once they're loaded that unfortunately means that it won't work like a typical Web SAPI where you update a .php file on disk and click refresh in the browser and the changes are immediately reflected. Instead you wouldn't see the change until being routed to a worker thread that hadn't yet loaded the relevant code. Alternatively you could simply restart the server.
 
user895378
I have a simple console application you can use to instruct a running server to reload without downtime though. It's still a bit buggy but it will be available eventually to allow "hot application upgrades" remotely and with zero downtime.
 
if there's anything I can do from within to help with that, let me know ...
 
user895378
Thanks! I haven't ever used runkit myself ... it may be worth looking at that to possibly avoid this issue when available. I haven't spent much time thinking about this particular problem yet.
 
don't, it's pretty much abandoned, and I don't fancy debugging that ... at least don't take it to production, if it does something you want to do then tell me and we can make pthreads have that and it can be maintained with pthreads ...
 
user895378
1:41 PM
ooooh that would be sexy
 
it is possible to change a class definition at runtime, it just doesn't make sense to expose that to userland, runkit already does it, but comes with loads of bumph ... pthreads builds it's own environment from the one that spawned it pretty confident that I can write stable code to change some classes if you want to do that ...
zero downtime updates are a real headache in the real world, if you make that easy its a real win ...
of course most php devs don't care or know, but when you start to care, it's an obvious problem when you're spread out over so many processes ... I don't have any good ideas for implementing it, but you tell me what you need and I'll make it so ...
 
user895378
@JoeWatkins Well I've already fully implemented everything with regard to the zero-downtime upgrades ... I just have a couple of bugs that I haven't bothered to fix yet.
 
user895378
That took me a long time to design everything to work correctly with that :)
 
user895378
However, would it be possible to do something like the following?
 
user895378
class Task extends \Stackable {
    private $request;
    private $bootstrapFile;
    function __construct($request, $bootstrapFile) {
        $this->request = $request;
        $this->bootstrapFile = $bootstrapFile;
    }
    function run() {
        require $this->bootstrapFile;
        if (function_exists('main')) {
            $this->worker->response = main($this->request);
        } else {
            // throw
        }
    }
}
 
user895378
1:48 PM
Where pthreads "forgets" about anything it loads from the $this->bootstrap file after each Task::run()?
 
user895378
That would allow you to write one script per URI route with a main() function that accepted the request and was responsible for returning a response (either a string or a full Response object)
 
resetting the interpreter is messy, you can clean the function/class/constants table, however we found that to be rather unstable while developing phpdbg and I bravely, gave up ...
I will have a mess around though, it might generally be useful if a stackable did behave more like a thread ... maybe introduce a new Stackable abstract or Thread::record/Thread::reset or something ... I'll give it some thinking time ......
 
user895378
Anything related to that would be awesome ...
 
I wish w3schools didn't rank so high on googlel
 
user895378
1:59 PM
I filter out all results from w3schools
 
Danke @rdlowrey
 

« first day (1186 days earlier)      last day (3759 days later) »