« first day (1415 days earlier)      last day (3533 days later) » 

4:00 PM
@ircmaxell excellent
 
will play with that later
 
@SecondRikudo no
 
@FaizRasool at that moment your code is like ..... i want to be safe from being wet so i using bullet proof vest
 
For the redditors in here, please consider upvoting this: reddit.com/r/PHP/comments/2f2rad/…
 
@LeviMorrison "Tell us about your most complex database query you have written." They are suppose to remember a database query?
Also what is complex? In what way?
 
4:04 PM
:) That's why it's a good question. Leave it up to the interviewee to decide.
 
Fair enough :)
 
Also, I asked them to tell me about it; I didn't ask them to write their most complex query.
 
Depending in the person I like this approach for juniors
 
I like this approach for seniors too. Can always ask more narrow, domain-focused questions on second interview.
 
Well yes but if you would ask the same questions to seniors it would takes days :P For me at least to explain for example "Tell us about common security problems in web development that they are familiar with." and eventually it would end in me (if there is a technical guy on the other end of the table) talking about how much php sucks and what parts suck most :P
 
4:08 PM
You can always interrupt them and say "good enough" and move on.
 
I also always specifically asked non juniors what they disliked about the language
 
@PeeHaa Why?
 
Much more useful than letting them write code
imho
It shows they understand the language and understand concepts on another level
 
This is a junior developer though.
lol
 
The moment they say they dislike argument order and/or api inconsistency the most chance is they are somewhat clueless :)
 
4:12 PM
For our last PHP developer, we hired someone who had only written PHP one time and couldn't remember anything about it. Why did we hire him? Because he knew a lot about HTTP, had written numerous small but complete websites in Python, and knew about common vulnerabilities and knew the general strategies to fix them.
And he's been a great employee.
(Oh we were confident he could learn PHP too; he knew C++ and Python well, and had dabbled in Java, Rust and Go)
 
@PeeHaa I dislike argument order on many functions, AND the API inconsistency. Does that make me somewhat clueless?
 
Yeah sounds about right. The last person I hired two jobs ago was an asp guy who never did anything in PHP. Really smart guy and worked out pretty well
@SecondRikudo "the most"
 
I think it makes the guy who named functions based on their name length somewhat clueless, not me :P
But you know? That's not what annoys me most.
What annoys me most is that we're finally evolving to PHP "7"
 
:P
 
Now is time to break all the crap from inside out.
But no
PHP "7" will be PHP 5.6 + a few things + some performance improvements.
 
4:14 PM
Also: that feeling when you have converted that innocent asp soul @LeviMorrison :p
@SecondRikudo I don't see it that way
brb sushi time \o/
 
@SecondRikudo there are some breaking changes
like list
 
@FlorianMargaine If I don't see @NikiC's named params in PHP "7", I don't see it as a big improvement.
 
I can't seem to use HashTable correctly... any pointer as to what I'm missing? pastie.margaine.com/c070a0e3-488b-4db8-91a7-98fd3ac2eccc
I get segfaults in zend_hash_find
 
@SecondRikudo I will loudly oppose named parameters.
 
@NullPoiиteя thank for help. i did fix it
 
4:22 PM
Call me a heretic if you want.
:D
But we will likely have return types and maybe nullable types.
 
@LeviMorrison Why's that?
 
@FaizRasool yours welcome .. but did nothing :)
 
@SecondRikudo The names of the parameters are currently not part of the API. In fact, until PHP 7 you could have duplicate parameter names.
 
but to be honest with you my code was actually preventing those attack
what happen
i miss one get var
to filter it
 
@LeviMorrison That's a job to be done. Name the parameters.
Your point?
 
4:24 PM
when i did check code again.
 
Also... in the case of inheritance you can have different names for the same parameter.
 
@FlorianMargaine you're looking for zend_hash_exists I think
 
it was just search input field upper
 
Also, static is not thread-safe
 
Lastly, any API in which named parameters would help helpful I consider to be poorly designed.
 
4:25 PM
which i was not filtering while echo, now it is fine
 
@LeviMorrison I think that's not an argument. I'm also not really in favor of it, but that's not the argument.
 
(I'm looking at you stream API. You are awful)
@bwoebi It's only one of many arguments.
 
@NikiC oh, thanks
@NikiC damn.
 
every one downgrade my post, with out reason .....
 
4:26 PM
how do you deal with that then? you get all the headers every time?
 
Anyway, I'm not going to talk more about it right now because I have a lot of work to do on return types.
I spent all of yesterday and part of Friday hung up on a segfault.
 
@LeviMorrison well, phpng anyway doesn't like multiple params with the same name, so that's not the issue.
 
@bwoebi (Which was mentioned in the message you linked to :D)
 
4:30 PM
> Rust is a 3d printed gun. It may work some day.
hah
 
@AndreaFaulds I am curious if some of the people who answered "strict" would not have done so if "(like Hack)" was omitted.
 
in JavaScript :: -0 testing center, 35 secs ago, by Second Rikudo
TBH it sounds to me that your website is a huge magnificent clusterfuck of spaghetti code that needs to be purged with holy napalm, then rewritten.
 
@Gordon ROFL
 
@Gordon This should be pinned
 
I don't want to feel like I'm spamming random noob questions on php core here, so where can I ask this kind of questions?
 
4:35 PM
@FlorianMargaine Shoot here
I ask noobs questions here all the time
38 mins ago, by Second Rikudo
Do I need ; after a <?= ?> statement?
Point in case ^
 
k.
How do I use thread-safe static variables in SAPI?
 
I don't know about that one, Florian. I'm pretty new to php-src myself.
Also, historically weekends have not been very good days to get answers to these types of questions.
 
@FlorianMargaine there must be some thread-safe globals structure for what you're modifying
 
@LeviMorrison "Have you used version control software?" The fact that that has to be asked makes me need a drink.
 
@Danack This is for a Junior Developer; it's needed there.
 
4:39 PM
@NikiC I'm just checking response headers
Well... Checking before adding some.
 
thread-safe globals are accessed through macros like EG(, CG(, SG(, etc
 
So a request-global struct
Oh, thanks, I'll grep that
 
Hmm... how can I get opcodes emitted to stdout or a file or something? I need to look at them for compiling functions and methods.
 
Is there any doc w.r.t php core? I haven't found many docs on internal functions :/
 
If all else fails I can just step through it in a debugger but that's slow.
 
4:42 PM
@FlorianMargaine for most things the code is your only doc...
 
Ok, so I keep going as I already have :p
 
@LeviMorrison wanted to port phpdbg next week… but until then, no chance, I fear…
@LeviMorrison here it's not so dependent from the day of week… but in #php.pecl, yep.
 
@FlorianMargaine lxr.php.net is a really helpful tool.
 
@LeviMorrison hm, I find ctags to be better :/
 
What's the best way to alter ini entries without marking them as modified? Is there any function or do I need to do this manually? zend_alter_ini_entry_ex is always pushing to EG(modified_ini_directives)
 
4:51 PM
@AndreaFaulds You could change the hash function to generate case-insensitive hashes in the first place.
 
5:08 PM
@ircmaxell are we sure llvm is even a candidate, this is working for us because libjit has fast compilation, some people say it's between nine and fourty six (yep) times slower to compile the same code as libjit ....
 
should the whitespace cleanup be taken out of the patch I'm going to send? github.com/Ralt/php-src/commit/…
it's just a couple of trailing whitespaces removed...
 
not a real issue… If anyone complains you still can remove it.
 
*complains*
 
@bwoebi probably updating table yourself, what's this for ?
 
5:12 PM
@JoeWatkins phpdbg
 
what's the harm in using the api, is something buggy ?
 
@JoeWatkins no, I just want that restore operations don't restore these inis.
 
should I add a comment or something? what's next?
 
ping @Tyrael @FlorianMargaine
 
5:15 PM
oh, he's there too?
are like 90% of core devs in this chat?
 
@FlorianMargaine "what's next?" Bike-sheddiing?
 
@FlorianMargaine 90% of the sane ones? mhmh… yeah.
 
@FlorianMargaine the hashtable never gets destroyed, so you will have leaks. did you try your change in a debug build?
@FlorianMargaine submit a PR on github, nobody uses patches anymore ;)
 
@FlorianMargaine tbh although it's not 'allowed' forbidding that behaviour is probably going to break something somewhere. Just raising the warning would be enough, rather than changing the behaviour.
imho.
 
@NikiC it's a per-thread global, it should be cleaned up on its own, no?
 
5:18 PM
@FlorianMargaine ... this is c
 
@Danack hmmm true it does change behavior.
 
in c nothing happens on its own ^^
 
@FlorianMargaine the debug build will clean it for you, but if not, it's your turn to take care of it.
 
I mean, if the thread terminates, the OS cleans up for you, doesn't it?
Debug build?
 
@FlorianMargaine Look for the PHP_RSHUTDOWN_FUNCTION I think - github.com/mkoppanen/imagick/blob/master/imagick.c#L3073
 
5:20 PM
@FlorianMargaine only on a per-process basis.
 
ok, I'll fix that
however... debug build? what's that?
 
@FlorianMargaine There's no tracking of which thread memory belongs to.
 
@Danack RSHUTDOWN is per-thread?
 
@FlorianMargaine RSHUTDOWN == request shutdown.
MSHUTDOWN = module shutdown.
 
5:22 PM
/blind leading the blind here ftw
 
and how do I run the debug build?
 
@FlorianMargaine --enable-debug --enable-maintainer-zts
 
@NikiC hehe
@Danack fyi, there is ... not useful except for the mm's leak detection ... but it is there ...
 
@JoeWatkins K. That's through PHP's custom allocator right? Not at the C level?
 
5:29 PM
right
@salathe tell us all about it ...
lolwut
 
is there an equivalent of PHP_RSHUTDOWN_FUNCTION for PHP_RSTART_FUNCTION or something?
RINIT
hm, it seems PHP_RINIT_FUNCTION doesn't run...
PHP_RINIT_FUNCTION(setcookie)
{
	ALLOC_HASHTABLE(SG(cookies));
	zend_hash_init(SG(cookies), 0, NULL, NULL, 0);
	return SUCCESS;
}


PHP_RSHUTDOWN_FUNCTION(setcookie)
{
	FREE_HASHTABLE(SG(cookies));
	return SUCCESS;
}
anything wrong?
 
yeah
gotta destroy before free
 
before that, it seems ALLOC_HASHTABLE isn't even run
but thanks, doing that too
 
isn't run ??
(if it weren't zend_hash_init would fault)
 
yep, I get seg faults
 
5:44 PM
show me
 
when zend_hash_exists is called
and the hash table isn't allocated, still 0x0
what should I show you?
 
show me whole patch and valgrind
(also check make output for warnings)
 
@FlorianMargaine You have to tell php about the init/shutdown functions - like lxr.php.net/xref/PHP_5_6/ext/standard/basic_functions.c#3374
 
oh yeah that's the problem
there's no setcookie module
 
5:49 PM
The setcookie function appears to be listed as a basic function lxr.php.net/xref/PHP_5_6/ext/standard/basic_functions.c#2990 and there is a basic module entry lxr.php.net/xref/PHP_5_6/ext/standard/basic_functions.c#3374
 
so it should work?
 
I'm not sure, but it might be better if the init/shutdown code you are trying to add was in the init/shutdown for the basic 'module' lxr.php.net/xref/PHP_5_6/ext/standard/basic_functions.c#3753
I really am unsure if the name change from standard to basic is relevant.
 
correct, do it there ...
posting to google+ makes you feel like a growed up ...
 
6:05 PM
google.com/+JoeWatkinsPHP ... that's quite cool ...
 
@Ja͢ck I have positive things and negative things to say about swift
 
Can anyone recommend a clip-on microphone and recorder suitable for someone doing a talk?
 
@LeviMorrison Hehe, good question.
@Leigh Not sure zend_hash has one that's pluggable ^^
 
aaalright
this should be fine! github.com/php/php-src/pull/795
 
@FlorianMargaine Since it still sends it, why not say "should not"?
 
6:18 PM
@FlorianMargaine <bikeshed>"setcookie() cannot be used twice with the same name"</bikeshed>
Yeah....what Andrea said.
 
I wouldn't worry about someone who is relying on broken behaviour that violates RFC's, I would implement the function so that it is compliant with the RFC in question and let an RM decide which version should contain the change ...
since there is no standard way for browsers to handle the incorrect behaviour you are avoiding a non-issue at the expense of correctness
 
> If the given bugger...
 
@FlorianMargaine Also, your IDE has weird white space stuff....but also there ought not to be spaces at the start and end of zend_error( )
 
Shouldn't that be buffer :P
 
ha ...
leave it ... funny ...
 
6:21 PM
:D
 
@AndreaFaulds indeed
@Danack I just redid what the previous lines did
 
@JoeWatkins But he's not writing new code. He's modifying code that is already there.....it's entirely possible (and probable) that someone somewhere uses that behaviour.... There's no benefit in breaking it for people who are sane and aren't sending the same named cookie twice.....there's only a downside in breaking stuff for people who have a weird setup.
 
they cannot use it if there is no cross browser support for it ... can they ?
 
@JoeWatkins I'm thinking custom software that aren't mainstream browsers.
Aug 4 at 22:39, by Danack
@AndreaFaulds And if there's one thing PHP stands for it's consistency!!1!
 
6:25 PM
there's no way for any client to handle it properly, I'd do it properly ... the rfc says the header cannot be sent twice, says nothing about the language you are doing it from, obviously ... I'd implement the function so that you are allowed to execute setcookie() twice but it sends compliant headers
so long as same order there will be no bc break I think ...
there's very little point in fixing something if it is not fixed ...
emitting a warning and doing nothing doesn't make sense ..
 
One for you @tereško
 
@JoeWatkins Well, I disagree. Changing the behaviour is definitely a BC break, and making it handle stuff magically (i.e. concatenating headers) sounds like a bad plan.
 
@joe: I would do llvm within a request like we do LIBJIT. But for true AOT, like generating a .so or a binary, llvm may be far better...
 
not if the rfc allows it ... didn't read it ...
 
Wouldn't do it within a request
Sorry, typing on a cell phone
 
6:27 PM
 
@tereško LOL
 
:D
That reddit is the place for your input @tereško
 
fuck no
 
But there's such an awesome comment + response in there.
 
6:30 PM
@JoeWatkins The RFC seems to say should not, not must not "Servers SHOULD NOT include more than one Set-Cookie header field in the same response with the same cookie-name. (See Section 5.2 for how user agents handle this case.)"
 
@Danack fair enough, go with that ... I dunno how well recieved yet-another-warning will be...
 
@FlorianMargaine I will reply to him in 5 minutes - that is one of the most moronic things I have read.
And I need to cool down first.
 
@ircmaxell okay I'll research it further, but think we're going to take a serious hit there ... there hasn't been any real activity on the elf writer of libjit since 2006 ... so that's not happening ... the rather confusing thing is that it is used in projects that do appear to write out their binaries ... I dunno why ...
> Fixes? I fail to see how this fixes the problem, it only throws E_WARNING, but does not fix anything.
@Danack you can't argue with that ...
maybe the correct thing to do is going to be a warning on docs rather than changing code, I'm not sure ...
he's only trying to think of a way to actually fix it ... as in do something more useful than emit a warning without effecting outcome or behaviour ...
 
@JoeWatkins "Actually, I would expect it to be "last one wins", That's the dumb bit.
 
6:34 PM
maybe, spitballing though ... at least he's involved in the conversation ;)
 
I set a cookie but I eated it.
 
@Fabien Could you do me another favor and download the latest version of the extension, reload chat and click things to see whether everything works?
 
I'm out, enjoy evening everyone :)
 
@joe don't focus on llvm. Let's get LIBJIT all the way. Let someone else worry about llvm. ;-).
 
later mr @JoeWatkins
 
6:38 PM
yeah good idea ... @ircmaxell
 
Good night!
 
@PeeHaa working on a plugin for the chat?
 
Done @PeeHaa
Yup seems to work
 
@Fabien Awesome. Will tag a release and see whether I can share it with certain people. Tnx for crash testing it ±/'
 
np
 
6:40 PM
@RonniSkansing yes
 
Can I peak?
 
You running chrome?
 
@RonniSkansing Let me tag a release and package the extension. Also a nice test to see whether chrome stable still allows sideloading. Give me a minute
 
7:01 PM
@RonniSkansing Did you download it?
 
Yeps, one moment and I will install it via the extensions page
 
kk
 
yea it is installed now
 
Awesome. I thought chrome had removed sideloading extensions by now
 
nope, I am chrome 37 64bit, no problems here so far
 
7:04 PM
How can I *un*register/disable a module/extension? (the opposite of zend_register_module_ex) … oh wait
 
they kinda did on windows. if you sideload an extension not in their shop it'll be disabled (removed? I forget) when you restart chrome
 
Can you restart chrome @RonniSkansing?
Or are you on nix?
 
Removing from module_registry completely removes the module too… fine.
 
@PeeHaa I can, I am on nix
 
ow. On nix sideloading will stay available, because everybody knows there is no crapware on nix nix does proper sandboxing
 
7:09 PM
I just dragged and dropped file and voila
 
@ircmaxell I remember you once posted a table which shows the time relations between the different actions of the computer (CPU cycle, RAM access, network i/o, etc)
Do you still have it?
 
7:24 PM
I've just seen php 4.0 compatibility code in php-src… :-(
 
get out of the PHP-4.0 branch
 
I'm in the master branch. That's the sad thing.
 
master?
oh dear
link?
 
ext/standard/dl.c line 185+
 
lol
185 -> 227 : delete
 
7:27 PM
yup…
well, 226 can remain ^^
 
@tereško Your PMs may just suck - but it may be worth reading blog.ellenchisa.com/2014/07/20/engineers-pm-sucks-heres-fix anyway.
 
will read
 
Guys I want to implement a rate limiting kind of thing for my site, any ideas how to implement it?
What I mean is, user makes a request, and we give him the expected output.
Now, we log those requests.
If the rate of requests is higher than a threshold limit,
 
@Danack PM?
 
7:41 PM
we don't tell him to stop, we just hold his process for a while. And automatically do that after a few seconds, during which all requests from that user will be dismissed.
 
@SecondRikudo Project Manager.
 
But the problem is, we want to allow requests from anonymous users (users not logged in). And IP address check is not reliable, so... how should we go about doing this?
 
@AwalGarg did i get this right? logging request if logged in user is throttling?
 
7:46 PM
All references to the shared object path are removed after module registering :-(
 
and the hold the process (what is that, what process), and how are the subsequent request dismissed?
 
@RonniSkansing no matter if the user is logged in or not (the site welcomes anonymous usage)
 
sounds like something that should be handled before reaching any php
 
@RonniSkansing hold the process as in, don't process the request he made, set a timout and process it after that timeout is over. until then, do other work. Subsequent request dismissal means don't approve any request from that user until the timeout is over.
 
Are you talking php?
 
7:50 PM
I'm asking, is this possible with PHP? (AFAIK, I don't think so but my knowledge is very limited so...)
 
oh okay. not that I know, but someone else knows better
 
This ought to be asynchronous so I doubt that. But still...
I had an idea that for holding the process, we can send the timeout value to the client and then, after that time, client can resend the request (automatically via javascript without user intervention).
But I am not sure if this is a good idea...
The biggest problem I am having is how do I uniquely identify the anonymous users since IP check is not reliable.
Uhh, reading this answer, it seems it is impossible.
 
you make it sound like a feature? I am beginning to understand this has nothing to do with security?
 
.. talking to the tiny people
 
oh
My memory is very leaky
 
7:59 PM
@RonniSkansing It is related to another site feature, not much about security.
 
Thanks for the heads up @tereško
@AwalGarg and what is this feature?
first to refresh at the right time wins?
 
@RonniSkansing can't say :P but basically, we don't want the user to make more than 4-5 requests per minute.
 
well that is impossible in the context you are describing
and why can you not say?
 
@RonniSkansing I have been told not to...
 
You know, that makes me giggle in real life. That is just so absurd.
 
8:05 PM
I am sorry but I can't help it. Btw, is that impossible with PHP or with any language?
 
=]
Try solving the problem in logic, I can't. How would any language help you then (if they can not solve it by logic deduction first)?
 
You are right, I think I should go with my notebook and pen first.
 
It is the differenting two requests from different computers are not the same person, that is not so possible part.
people can make all the accounts they want, there is nothing you can do about it
so even disallowing anon does not help
 
;-(
 
I heard rewarding instead of punishment works great
 
8:11 PM
@RonniSkansing how would I reward someone?
 
Impossible to say in your context.
The sum of it all impossible, , because you where told so... am going back to the code
 
ok
 
@SecondRikudo Heya ^^ A baby is looking for you. :)
 
@AwalGarg You will never be able to perfectly identify a "user" over a network. That doesn't matter though. Do whatever has a net benefit - be it IP based throttling, device fingerprinting, whatever. Don't let perfect be the enemy of good. Think of your goal as reducing misuse rather than preventing it entirely.
 
8:22 PM
I was trying to create a xml web service using PHP.
 
ok
 
Sorry I was chatting to one of my friend on Gtalk, and due to this stupid touchpad I wrote it here ^^
 
@TheLittleNaruto bash.org/?5300
 
:P
@SecondRikudo , I do not understand one thing what is difference between "mysql_fetch_array" and "mysql_fetch_assoc". IMO, both are used for same purpose. What's the difference then ?
Note: I am a noob at PHP , you know already. :D
My try : pastie.org/9517526 :)
 
@TheLittleNaruto One of them returns an indexed array
 
8:29 PM
you don't use any of them anyway, right?
 
The other returns an associative array.
Also, what Florian said ^
 
Why dont I ? I am using it.
 
@SecondRikudo no, mysql_fetch_array can return an assoc too
 
@TheLittleNaruto they are deprecated. use mysqli_* functions now.
 
gist: Don't use MySQL functions in PHP - Comment for Stack Overflow, 2012-10-12 22:14:43Z
    [**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ).

[**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ).
 
Ohh I see.
Thanks I'll update my code then. xD
 
people still use them? I thought by now, every single person would be informed of their deprecation...
 
@AwalGarg I wish...
 
One day someone will freak out about a Call to undefined function ereg() error. It's amazing what people still use.
 
@derp s/one day/every day on main
I need the link to that crappy blue flash site that pops up once in a while
Chat search fails on me again
 
8:43 PM
btw, on a slightly better note: one of my coworkers has finally realized that getting rid of mysql_* stuff is one of th immediate priorities
 
@NikiC the problem with the mpz_export tests is that when we discussed not exposing the count parameter to the user and I removed it, some tests were broken, so I emulated the count part with substr - so some tests were passing when they really shouldn't have been. I'm using the calculation provided on the GMP site to calc the size, which will result in size * "\0" as the export data for exporting GMP(0)
which I actually prefer
 
@Leigh wait, you're co-testing substr behavior in there?
 
@NikiC no, I was doing $result = substr(gmp_export(...), 0, size * count); to make the output the same as the gmp supplied tests
which made tests with count = 0 pass, even though they were returning size * "\0"
 
oh, gmp provides tests?
 
yea, I literally pasted in the import and export tests from libgmp and turned them into PHP arrays
which is why the test is kind of horrible :P
 
8:54 PM
omfg
the indentation is horrible
 
I changed my code now into mySqli , But in response instead of getting xml response, I am getting all data in a single line T.T Here is my latest code
 
That would still be xml
 
But there is no xml tags, I can see.
 

« first day (1415 days earlier)      last day (3533 days later) »