« first day (2314 days earlier)      last day (2638 days later) » 

7:00 PM
No you do not use md5
the problem is not the expense
 
@RonniSkansing he's not talking about passwords at all. you can md5 stuff, it's just an hashing function
 
oh lol
sorry I dunno, I just auto assumed it was somebody talking about passwords
just the first line said "Security, mysql, hashing question. "
 
first word security
and now I am also confused why he would make a hash lookup, he could use primary keys, ints or guids .. so now I am back to thinking its passwords
maybe handling files.. or some shizzle I dunno
 
@RonniSkansing i took at as he's only hashing to try to prevent injection in a clunky way..
 
7:06 PM
Nice catch Think you might be right
 
7:20 PM
Opinions on anonymous namespaces? I have a use case for them
Looking to get rough feedback before emaiing internals or patching
Spoke to Rasmus so far and he did not immediately reject the idea
 
Anonymous
@Wes nice! Still too friendly but nice!
 
Anonymous
Haven't you been debating on a logo for like 6 months now?
 
Wes
@JayIsTooCommon more like a year
2 hours ago, by Wes
http://i.imgur.com/Si3zKUq.png http://i.imgur.com/XNLMUfz.png http://i.imgur.com/yT8cDpm.png
 
@Wes I kinda like #3
 
7:36 PM
purplols!
@huncyrus Do not make the db do the hashing.
1) If it is sensitive information, you're sending it in the clear over the wire.
2) If it is not sensitive but is something long (like a document contents), you're sending more data than you should
 
Any HTML gurus here?
Trying to create a deposit form where users can select PayPal and Bitcoin, where it would redirect them to a different url (paypal.php / bitcoin.php) based on the selected option, but I don't know how I could do that
 
i did something similar, used 2 buttons on the form, 1 for each then when it redirects u, do an if statment saying if they clicked the paypal button, do this etc
probs not the best way but it works
 
Anonymous
@Wes #3 but again, I like yow angry ones
 
@NikiC @Eugene I would caveat that with, openssl_pseudo_random_bytes() is suitable if you're using 5.6.latest or better
I can't remember the exact point release, but there were two patches, one to stop using the "discouraged" method (obsoleting the "strong" flag), and one for fork safety
 
Wes
youtube upload is so slow. why do people even make videos. takes 1 month just for the upload...
 
7:47 PM
not if u got good upload speed lol
 
@Leigh where only the second part is an actual concern
 
hmm I'll try something thanks
I'll send a pastebin with the finished result if it works
 
as from the openssl side pseudo_bytes and bytes is basically the same, as long as you check the strong param
 
Wes
40mbit, it's not great but not even totally shit
 
@NikiC in practice, yes, but that flag (which we should remove) does tend to worry people
The fork safety patch came later anyway, so you get the former as a bonus :)
 
7:51 PM
@adsr Can you roughly explain the usecase?
 
@adsr Is your use-case something that would be catered for with package visibility?
 
what is an anonymous namespace?
sounds like a contradiction in terms
 
Wes
so tdd says we should avoid private members entirely (as they are not mockable) and use only protected ones. thoughts?
 
@Wes where does tdd say that?
tdd does not say that
 
lol. my formulation of "tdd doesn't say that" was more like "fuck off"
 
Wes
7:55 PM
@NikiC i'm reading a guide, not the book
is the book good?
 
what book?
tdd isn't a book
 
Wes
it was, originally, afaik
 
@Wes You're still insisting on the idea of testing private stuff. I'll give you another hint, there's a rather large project that you probably use every day that ONLY tests it's public interfaces. :)
 
does anyone know why this doesnt work, its driving me crazy
<a href="http://www.google.com/" class="profile-buttons" src="graphics/buttons/mail.png"></a>
 
@pmmag @Leigh @NikiC The specific case I'm looking at is with the embed SAPI. When embedding PHP there is often no concept of request/response in the host application, so you have one long request. Now consider you want to reload a user script. There is no way to do that without avoiding top-level identifiers altogether, or invoking request shutdown, which would shutdown all PHP scripts, not just the one you are trying to reload.
 
7:58 PM
@Wes I thought that tdd was mostly a way of testing for new features, the way we intend to use them, and after that to make the tests not fail. the way those features are internally managed, I sure as hell don't want to know
 
what's wrong with it?
 
me? @nicarpe
 
yup
does it execute? or
 
nothing is appearing, its just blank
yeh its there but i cant see it
 
I'd say your src is wrong
 
7:59 PM
@RachelDockter what are you trying to do?
 
Wes
mention me one reliable source that says that unit testing should be done through black box testing @pmmaga
 
Looks like a hybrid anchor/image
 
@adsr ugh embed sapi. no comment
 
its defo right, ive used it on another button, @Leigh just make it appear
 
pretty sure you're not looking for anonymous namespaces though ;)
 
8:00 PM
C++ has 'em :)
 
Another reason not to use C++
 
Haha
 
jsfiddle.net/a6u5hd2n if anyone could make this appear id be very grateful
 
we need the css in there aswell
 
even without css i think it will just ignore it and the button should still appear
 
8:04 PM
technically, you'd do <a><img /></a>
 
@NikiC Other suggestions? Ideally there'd be a way to instantiate multiple PHP VMs..
I think I remember a project like that...
 
ah perfect thankyou
 
np
 
@adsr what's preventing you from doing that?
I mean, just start multiple vms with proper startup/shutdown
 
8:12 PM
@Wes I don't have one. Do you have one saying that unit tests should be done through white-box? I think this is mixing up 2 different concepts anyway
 
@NikiC Can you? E.g., isn't there just one executor_globals struct? Maybe I am missing a detail
 
Wes
@pmmaga literally everything say that, except random posts on SO that happen to be the "accepted answer"
 
@adsr you can run multiple threads
If you're not running multiple threads, you're only running one script at a time, so there only being one execution context shouldn't matter, right?
 
Only in that they still share the same function table etc
 
but isn't that what you want to prevent?
by anonymizing symbols I mean?
 
8:17 PM
Ah I see how ZTS helps.. though the host application is strictly single threaded
Need to think about this..
 
if you don't like threads, can also use good ol' fork ^^
 
@Wes testing a private method wouldn't make it white-box anyway. As far as I understand the concepts, white-boxing in a unit test context just means that you are validating that certain methods are being called a certain number of times with certain parameters, etc.. It has nothing to do with that method's visibility
 
depending on communication requirements
 
Wes
@pmmaga i'm not testing a private method, i want to mock one
you can't mock private members, only protected and public
 
why would you want to mock a private method
that aint not make no sense
 
8:19 PM
PHPUnit has some hack that allows you to do that
V ugly though
 
next you're going to suggest mocking a final method, right?
 
Wes
@NikiC you mock sibling methods of the SUT method, plus its dependencies
fu, guys
 
you do not mock sibling methods
 
Wes
very constructive talking with you
 
or at least, that would be rather unusual
 
8:21 PM
Mocking suggests there is a dependency. Curious what case there is a private dependency?
 
if you need to mock a sibling method it probably shouldn't be a sibling method but a functor dependency
 
Wes
a sibling member (both fields and methods) that is used by the SUT method is also a dependency
 
@Wes If you mock it in the cases it would be consumed by the public interface than you would need to test it separately, no?
 
Wes
otherwise the SUT becomes the class as a whole, you aren't testing the single method but the method and how it uses the rest of the class
 
@Wes you are indeed, and that is fine.
just because a method has been refactored by using multiple private methods internally, doesn't change anything about how you test it
 
Wes
8:26 PM
again that's black box, functional testing, not unit testing
 
no, it's still unit testing
 
aren't you supposed to be able to test all your private methods by going only through your public methods?
 
you don't unit test every atom in the universe
if you don't think testing a method whose implementation is split across private methods a unit test, you can equally argue that it isn't a unit test because you're not testing each line in the method separately
you have to properly calibrate what a "unit" is
 
Wes
how is that even related to what i'm saying? i want to mock stuff because i don't want rely on them to be correct for the actual test to work
 
That was a response to "again that's black box, functional testing, not unit testing"
 
8:31 PM
@adsr, since you're here: github.com/php/php-src/commit/…
 
@Wes if your mock is private, that means you're not passing it down as a dependency?
 
Wes
the class being the SUT is totally fine depends on how you define it, but if you want to be more pedantic and many do, you can mock all the things except the single method you are testing
 
@Wes Not saying the class is the SUT
 
Wes
if a method uses other members and they are private they are effectively part of that method. the unit spans several things and ideally you don't want that
 
... whatever
 
Wes
8:40 PM
/me successfully resisted the urge of being not-nice
 
Anonymous
23 mins ago, by Wes
fu, guys
 
Wes
that was a friendly fu
 
Anonymous
:P
 
I feel like the conversation I tried to start about object variance got derailed by enums.
Enums are just one example. It would cause a BC break for union types as well, and possibly others I haven't thought of.
The assumption that all user-definable types are class/interface based is not a good assumption to make going forward.
 
8:56 PM
@LeviMorrison how would it cause a bc break for union types?
do you mean for typedefs?
 
@NikiC Yes.
Should have been more specific there.
 
overall I agree with you
This seems too risky
 
interface Factory {
    function make(...$args): object;
}

class FooFactory implements Factory {
    function make(...$args): Foo;
}
For this to pass (which under this RFC it would) it must either know information about Foo or must assume it will be a user-defined class/interface.
 
Given that the utility of the object typehint is very limited, it is probably better if we hold off on it until at least the variance issue is resolved
 
And at present Foo doesn't even have to be defined.
@NikiC Exactly; this niche functionality is not worth the assumptoins.
That's what I tried to say but it got lost on Internals; maybe you can try?
 
8:58 PM
@LeviMorrison At present we assume it's an class/interface/trait and we load it on run-time because of late binding
 
No, to pass the type checker Foo does not even need to be defined because it makes the assumption that all user-defined types are classes/interfaces.
 
If other newly introduced types araises there would be more problems like autolaoding, etc.
 
Exactly.
 
Currently there are problems with autoloading functions...
Or constants
 
object has about the same utility as a resource type hint, which doesn't have the issues and was still rejected
 
9:01 PM
@PaulCrovella What do you mean it has the same utility as a resource type hint?
resource typehint is really useless
object would have some usages as described in RFC
 
@NikiC Can you please chime in on the mailing list please?
 
I'm creating a deposit page and I wanna implement multiple payment gateways. I have a form that sends the data (payment gateway & amount) through POST to a different url, how would I grab this data and send the user to the correct payment page?
 
@brzuchal Sorry, but I find object to be about as useful as resource. Each will save me the same number of function calls: 1.
I think resource was excluded hoping that they would be gone soon. I still hope so, but a lot of code needs to be re-written for that.
 
@brzuchal a lot of the arguments for object in the rfc apply to resources as well (e.g. detecting return errors more quickly), and typically you need to do additional reflection on an arbitrary object in order to do much with it (if you can at all), which was same argument used against resource (where you need get_resource_type and friends)
of course there was also the mantra of "we hate resources and they're going away", of which only the first part is true
 
9:20 PM
I agree to both of you, starting this RFC I knew it'll have limited utility, but found some good usages in examples and so decided to write that RFC to fill the gap.
 
@PaulCrovella one resource went away recently :P
so if we drop one resource usage every three years ... um
 
@NikiC gmp? (that's the one that comes to mind)
 
@NikiC we'll gonna die till that time
:D
 
@PaulCrovella hash
 
ah, right
 
9:23 PM
No one will gonan know then why we hated resources :)
 
This chat room should commit itself to achieving the goal, before this decade is out, of removing resources from PHP and returning type safety to our functions.
 
two down
 
Luckily for NASA they didn't have to deal with internals…
 
@Trowski this decade ends in 2 years and 10 months, that's impossible :)
 
Yeah, they had more time too, lol
 
9:25 PM
@Trowski We just need a BDFL who will sign a ban on resources
 
@brzuchal I suppose they don't teach enough US history in Europe for you to know what quote I'm parodying there…
 
hi guys
 
@Trowski Yes, in Europe they don't teach US history at all, just something about Columb and Second World War and that's all
 
No single rfc in this period will be more impressive to mankind, or more important for the long-term sanity of developers; and none will be so difficult or painful to accomplish.
 
@brzuchal Colombus… pssh, not even teaching the correct history.
 
9:28 PM
 
I was actually parodying regardles to dropping one resource in 3 years :)
 
@brzuchal It was parodying JFK's moon speech: en.wikipedia.org/wiki/We_choose_to_go_to_the_Moon
 
has anyone here ever created an api? i have to do it for my assignment but i barley know what one is
 
the "and do the other things" part of that speech always bugged me
 
@Trowski Thx, I think I got it: in '62 JFK told they'll send to the moon in the end of '60's a man and they did it in '69 - yes?
@NikiC According to Wikipedia there is no BDFL for PHP, who might it be?
 
9:37 PM
Does anyone here have good understanding of UPS API shipping service codes?
 
PHP has more of a MCFN (malevolent committee for now)
 
@brzuchal Yeah, exactly. It's a well known speech amongst Americans.
 
@JoeWatkins I would guess that's due to the file extension, will look into it
> we choose to use PHP and do the other things, not because they are easy but because they are hard
 
I would love to take some resource and help with porting it into object type, but feeling very big lack of free time to do that :/
Wow, I didn't even realize there are so many resource types php.net/manual/en/resource.php
 
9:54 PM
a lot of those are already effectively dead
 
curl looks quite simple to transform
introduce CURLSession type and CURLMultiHandle or CURLMultiSession
 
Is @return $this valid for PhpDoc section? And does majority of IDEs understand it?
 
@Eugene at least phpstorm does
and that's really all that matters
 
:) nice. Thank you.
 
If taking such resources to transform them to object types like curl would it be appropriate to just replace resource with object type or introduce complete object api with methods on those objects? That's more work but also changes to the api
 
Wes
10:09 PM
@Eugene it is also a valid "type" in phpdoc's psr
 
@brzuchal Both for BC.
 
Taking resource returned by curl_share_init for eg. CURLShare such resource right now is being passed to curl session resource with curl_setopt($ch, CURL_SHARE, $share); so basically curl_setopt is defined as curl_setopt(CURLSession, int, anything); because sometimes it is array, sometimes it is string or int and in case of shares it'll be CURLShare
So without changes in api for eg introducing new functions like curl_setshare(CURLSession, CURLSHare); there won't be type safety
@Trowski am I thinking right?
 
@brzuchal For the old API no, but you can introduce a new one through object methods that would be type-safe.
$curl = new Curl(); $curl->setShare(new CurlShare)
Something along those lines…
 
Ok, so not breaking BC and introducing new api.
 
$curl->execute() instead of curl_exec($curl_resource)
 
10:19 PM
I remember lastly as I've asked here someone told me that it's hard to maintaint two apis functions and classes.
 
Right. The BC version of curl_init() would return a Curl object, and all the curl_*() functions would expect a Curl object to be passed.
 
Ok, that's clear to me.
 
That is a pain, yes. But it's the only BC path I see.
 
@NikiC Thanks, and your reply also brought the discussion back on topic (people were getting a bit off-topic with enum details).
 
And this also requires an RFC right?
It would be quite long RFC
@LeviMorrison when can expect enums RFC, voting etc.?
 
10:22 PM
@tereško are u here?
 
i here
 
theres 1 bit of the marking criteria that talks about making an api that can read and write with multiple data formats, do u know what this means and any tutorials that can point me in the right direction?
 
you will have to tell me the context
 
of the website ive been making
 
what information is contained in those data formats?
 
10:26 PM
hold on ill show u
 
k
 
There is RFC about adding resource typehint in Under discussion state wiki.php.net/rfc/resource_typehint shouldn't it'll be moved somewhere else?
 
so the bit in yellow is for the API and there abit of info at the bottom for it
thats all that was given
like i somewhat know that the concept of an api is but other than that, im lost
 
@brzuchal I suppose it would require an RFC. It probably doesn't need to be particularly long.
Most important would be listing the new object API… so it might be long, but mostly just some copy/paste sort of writing.
 
ok
so, @RachelDockter, the site that you are making - what will it do?
 
10:31 PM
@Trowski I may try with that at some free time
 
well i pretty much finished making it but it allows users to log in and register for a game, it allows people to make posts and stuff like twitter and u can view peoples profile and stuff
oh also theres a statistics page where it gets everything from the database and puts it into graphs
 
in that case, I would guess that the API would provide external users with JSON data about games and ability to make new posts and read existing posts with the API
 
what is actually an api though
is it like a .exe where people can read and write to the database
 
or a page on my website or something
 
10:34 PM
API in this sense is something like a "data source"
 
everything there can be applied to mine, but im still not sure what it physically is
is it a file?
like how do you use the api
 
"API" in this context usually use a php file, that returns something, that is not HTML
 
ok so is it like a php file where i make a bunch of options to read and write data so people can use that in another website to write to my database
so its like a html page for their website, but in php
i cant find many videos on it
 
what you should be searching would be "REST API" or "RESTful API"
but it is pretty hard to find any good tutorials out there for this, since most of them are made for some specific framework
 
ok im watching this youtube.com/watch?v=RTjd1nwvlj4 about rest apis which is using google maps and instagrams api
so hopefully i can figure it out using that
 
10:46 PM
it should tell you how an API should work from ... emm .. outside
 
so for my site, i should make an api which allows someone to type a username, it then uses my api to return every bit of infomation about that user
am i on the right track
 
probably not "every bit"
 
oh yeh maybe not the password
ok i have a better understanding now i think
 
think about it this way: what functionality should you provide publicly, if someone wanted to make a "companion phone app" for your site
 
10:57 PM
it should be able to read info about the user to make a profile for them, read the posts and then write stuff like when someone likes a post on their phone, it should write it to the database
i think i covered everything
 
yes
that probably would be enough to satisfy the requirements
 
ok perfect thanks, im gonna work on reading data first as that seems eaiser
 
user6061856
 
user6061856
>.<
 
11:01 PM
@pmmaga oh well. I didn't plan on having a peaceful night anyway
 
Anonymous
@pmmaga @tereško sounds like your kinda thing
 
@Terminal-JS foreach ($list as $key => $value)
 
user6061856
oh thx
 
@pmmaga they are autistic. Every single one of people like this.
 
11:03 PM
oh @tereško i was also gonna ask, one of the requirments is to sort people and be able to email everyone thats sorted, i managed to sort people into an array and did a mail button with <a href="mailto://loop array to add every recepitent
is that a good way, if i click it nothing happens but people say mailto: will open like the mail app if you have it
 
the "mailto:" links only open the mail client
what probably is required is for you to send an email using PHP
I would recommend you to do it using a library: swiftmailer.org/docs/sending.html
 
oh this looks better
ok im going to look at this more thankyou
 
but, before you start looking at it, you should learn about use of composer in php
it would help you will the mails and the api
 
ok ill look at that, i think my dinner is burning hold on
false alarm
 
@pmmaga wat
 
11:09 PM
social justice everywhere
 
@NikiC You've never seen that crap before?
 
ehh ... to be able to go back to days, when only reasonable meaning for "SJW" was "St. John's Wort"
 
@Trowski I've seen that crap before, but nothing with quite that degree yet
 
11:26 PM
Next we'll have to change whitespace to blankspace and every time you type it the Taylor Swift song will start playing.
 
@Trowski and then 18 words get added
 
11:52 PM
How's everyone doing?
 
As far as I know "whitelist" and "blacklist" don't come from any racially charged origin; the offense is purely taken and not given. I'm fine with changing words that are offensive but... these aren't.
So until someone provides me with politically correct alternatives that actually make sense I'll keep using "whitelist" and "blacklist".
 

« first day (2314 days earlier)      last day (2638 days later) »