« first day (2303 days earlier)      last day (2870 days later) » 

14:00
I dont trust youtube tutorials - they tend to be made by people who shouldn't be teaching anyone
the one im watching seems alright at teaching the basics
can you link it?
Don't trust books either, they tend to be made by people who shouldn't be writing books.
@bwoebi Return types aren't related to the change. I created another function instead, so no code that's used for return type checking is used anymore.
14:02
okay fine
Previously it worked the way it was, but only because return types checked that both types are present first.
@RachelDockter I skipped to the "database" part, and it's really bad :(
does he use my sql database
if its bad, i dont mind that much as long as it works to start
then i can work on improving the quality
it is not about quality, it is about harmful practices :(
do u know how u can make a button that submits info to the php document
can u do it the other way round
14:22
you create form in HTML, (with method="post") and when you submit that form, it will send a POST request to the server
then you can use PHP to read the sent information
i thought thats what GET does
Do you know what's the difference between GET and POST requests?
so far i think post request doesnt show in the url?
yeah kinda ..!
So what's your problem now?
im wondering how i get info from the php document, back to the html document
so i can use it on a webpage
14:31
@RachelDockter there are multiple differences, but the one that would be inportant to you would be: data sent using POST requests can be secured against interception
data like username and password
@bwoebi do you know whether there's any way to do a fault-suppressing memory access?
ah so any sensative info ill use post instead of get
@NikiC catching sigsegv and sigbus and then do longjmps? [that's what phpdbg does]
@RachelDockter True !
also, @RachelDockter, usually all the data from forms is usually sent using POST requests
14:32
@bwoebi I was hoping to avoid that :/
Oh, phpdbg does that? I will take a look
you can bypass it, but it tends to be a bad idea (and it makes for ugly URLs in your browser history)
oh ok, so if i make a webpage using html to display the persons name, is it possibile to get their name from the php?
@tereško are you sure? I use GET request when I create a form for searching. I want user can see in the URL what he's searched
@bwoebi thx
14:34
@Shafizadeh notice the "usually" in the sentence?
ah ok :-)
@NikiC what do you need it for?
@RachelDockter PHP does not get any data on its own. You send the data to PHP using a browser
yeh so lets say its a site like facebook, i search for a person, the php gets the name using the post request, looks up the searched name in a database, and then sends their full profile details to a html file to display them
or is that not how to do it
@RachelDockter sounds right to me
14:37
@RachelDockter yes, mostly (facebook used AJAX on top of that, but you don't need to know about it just yet)
so how would i get the details from php to the webpage
is there a request i can google to learn more about
I personally prefer "Ajax"
ok ill look into ajax
don't, not yet
should i learn more of the basics first
14:38
@RachelDockter yes .. but follow what @tereško suggests ..!
@RachelDockter in php there you this think called "SAPI", which give you an abstraction for getting data from user's/browser's request
it provide you with variables $_GET, $_POST, $_COOKIE and some others
if you post a form:
<form method="post" action="somefile.php">
    <input name=foobar" type="text>
    <input type="submit">
</form>
then the somefile.php you will be able to do:
<?php
     echo $_POST['foobar'];
to read that value
but as I said before: read that book
it explains all of this
yeh thats exacly what i did
so, what was your problem then?
i was just curious how to send that info back to a html document
you dont
you send a new html document instead
but this time including that value
14:44
so i would build the webpage with php?
on the same php file that got that info?
please, rephrase
hello, is there anyone to help me
ok so u know that peice of code that posted that gets info from the html document
@tereško I guess he's using MVC architecture and tries to pass a variable from controller to the view
say u wanted to display that information, would u make everything in the same php file? or can u make a new html file which recieves that peice of info to display it
14:46
1 hour ago, by Rachel Dockter
guys im trying to learn php but i dont understand, is it a replacement for html, or javascript
@Shafizadeh I would go on a limb and say: no
I guess you are right .. based on " is it a replacement for html, or javascript"
i feel like im asking it wrong so u cant get what i mean
no offence @RachelDockter
14:48
hold on let i think i know a better way to ask
@RachelDockter I would actually use two files - one for showing the form and other to handle the data, but ion the second file I would put a "redirect" at the bottom
you can redirect from one page to another using header('Location: /some/url');
so a php file to handle the data, then redirect to a html to display the data?
so you can either redirect back to the form or redirect to a completely different page
ah ok that makes alot more sense now
so php is just like a server that can handle infomation really
im probs so far off lol
php is the "application" that is running on a server
14:51
ok i understand, i think ive learnt alot today
hmm ... there is actually an online link to that book
here ya go
start reading
i think i can skip to part 3
page 221
you probably should scan over chapter 1 too
oh it has a whole section on getting data from my sql i need that
thanks @tereško
read a chapter every day, and in two week you will have learned most of that you should have been taught in the classes
an in the meantime, you can find some fitting design for your project on dribbble.com/search?q=registration and make a html for it
@Shafizadeh not "he"
15:04
mrningnn
ok, I'm AFK for hour or so - need to go but ingredients for Tom Kha
@Wes If anything it indicates that we probably want a type alias or typdef mechanism if we add union types.
15:26
@bwoebi For github.com/nikic/sample_prof. I'm reading the execute data while it may be modified...
Currently it segfaults from time to time
@NikiC yeah, for that use case the way it's solved in phpdbg should be best here
hello everybody
Can you help me a little with editting my PHP code in my new question?
0
Q: PHP MVC questions after few days of using

Edenwavefew days ago I started to changing my mind from standard php to OOP PHP with my MVC structure + Eloquent for DB-s. I want to write correctly from begin so I will be greatful if you will show me where I can make my code better. Rooting is good. I made it with YT tutorial. Next I made roots like th...

I tried all the ways and there are always problems to paste it correctly, in best scenario it throw out of block "}" symbol.
same in 10. point
15:43
@daviddan Where do I best start with RxPHP?
There's ./demo, but that's too much for a start.
@Edenwave markdown gets confused sometimes. throw a <!-- --> before your code block to help convince it to suck less.
(basically it's treating it as part of the list item, which is unwanted)
@PaulCrovella <!-- --> doesnt help :C
@Edenwave put it on its own line, isolated with a blank line above and below
...?

<!-- -->

	public function index($name = "")
@JoeWatkins @NikiC What are your reasons to vote for the Sodium namespace? BC compat?
16:01
@kelunik err, why would I vote against it?
@NikiC why would you vote in favor?
because of course it should be namespaced
just because our bundled extensions were introduced before the use of namespaces became ubiquitous (or even before they existed at all), does not mean we need to perpetuate that
I see no benefit in namespacing that. It's all functions which makes no sense to import them (importing them will make it less obvious that it's the libsodium primitives we're using).
@NikiC Because it doesn't fit the current naming scheme.
what current naming scheme?
don't quote me a 20 year old coding style document in php-src pls
16:06
@kelunik he wants to introduce a new naming scheme standard and set precedence
@bwoebi You can import the top-level namespace ... yay for no namespace fallback
Though for the record, I consider the idea of deciding whether I namespace my next library based on whether importing will be "useful" to be ridiculous
@NikiC Tell me, what's the purpose of namespaces? Conflict avoidance is already ensured by prefixes separated by underscores
morning room
To me it's shorter function/class names within a namespace as well as removing vendor prefixes where helpful (And I'd argue that removing the "sodium_" or "\Sodium\" prefix would be counter productive.)
@NikiC But it also doesn't mean to introduce random namespaces now without a new naming scheme.
@bwoebi I think we should maybe remove the crypto_ prefix and use sodium_ instead of Sodium\crypto_
16:17
@kelunik that I can agree with.
We should probably also remove the pwhash functions as we have password_hash already. /cc @ScottArciszewski
@bwoebi While the while (1) yield; at the end of the generator parsers? I would think asking the parser for more data after an error would be a mistake you'd want to catch.
Or rather sending more data to the parser.
@Trowski it doesn't need to be a while(1), but there should be a yield at least. At least for the websocket parser it always yields the number of frames parsed
@bwoebi Yeah, that I kept. I was looking at the HTTP driver parsers at the moment.
As long as the onReadable is always killed upon error, it's all fine
@Trowski e.g. in HTTP/1 Driver we'd have then to also check against the validity of the requestParser within upgradeBodySize
16:27
@bwoebi Yeah, that's true.
or the call to $client->requestParser->next() in Http2Driver (to avoid floods)
I suppose it doesn't hurt anything, it just seemed odd to me.
I'll probably restore it at the end of the websocket parser for consistency.
@Trowski no it doesn't. It's just for the edge cases so that things go quietly.
Here is a weird issue I just had to deal with: github.com/sebastianbergmann/phpunit/issues/2470
While introducing namespaces into PHPUnit's codebase I made a few mistakes that resulted in name collisions.
PHP 7.0.0-7.0.12 error out on startup due to these issues.
PHP 7.0.13+ does not error out on startup.
Yes
As of 7.0.13 collisions are only checked within a single file, always
Previously that depended on symbol type, file order and whether or not you're using opcache
16:31
@NikiC Thank you for that insight. Can you add that to the ticket, please?
Basically it's fine to shadow a symbol in the namespace using an import, as long as it's not blatantly wrong (shadowing a symbol in the same file)
@Trowski yeah, in websocket parser it's not needed
@NikiC Is it okay for me to copy/paste what you said here into the ticket as a comment?
@bwoebi I know… but if something changes that expects it I'd rather be consistent in the way we write the generator parsers.
bob
bob
Hey guys can you use this $cleandata = trim(stripslashes(htmlspecialchars($notcleandata))); to remove an untoward code entered in an input?
16:35
@Trowski yeah, that's fine
@PaulCrovella thank you now it works :)
but with bad editing I got -1 and now nobody want to help
<laugh through tears>
@SebastianBergmann sure. I just added a link to the bug id
16:57
@Edenwave it's not bad editing. your question is too broad. there are actually three statements, that are more like "do you think this is okay"
this tends to get downvoted. Try having one, clear, problem statement, with error messages if possible (I'll admit in this case this seems that it was related to markdown being retarded)
@FélixGagnon-Grenier there are no erorrs there... I am just aasking about best practices...
That is exactly the point. Such questions are not on topic on this site.
Which is what I think explains your downvote, more than bad editing
so what to do if I need help i described in thaat post
read tutorials? type these questions on google. ask here in chat, like you have done, but with a format that facilitates reasoning about the general principles of MVC and OOP, not just your specific problem
google for php session management, to learn about session management
the 8. point in your question is invariably going to differ from person to person, there's not dodging it, you'll have to learn about design, architecture, and make a decision you'll regret in six months
so it needs to be model "registry.php"?
8. is most importnat for me now
17:09
@Edenwave this has nothing to do with MVC
ok guys so can you recommend good tutorials about php mvc, that will explain me all the architecture ect?
start digging through
the actual "MVC part" is actually near the bottom, but you need to understand everything above it before having even slightest chance
@NikiC Thanks!
@kelunik there isn't one specifically for RxPHP. All of the RxJS concepts carry over, so those tutorials apply for the most part. I'll see if I can write something for RxPHP in the next couple of days
17:21
I am a bit disappointment by ReactPHP. It did not have HTML and SQL and JS mixed all over the code ... unlike ReactJS
2
@FélixGagnon-Grenier Yeah I have time.
and o/
\o
17:35
@FélixGagnon-Grenier Did you want to talk about something?
yup, putting details together before sending it your way
18:06
Hello. How to inviste a user (not one I find in a chat room) to chat?
18:20
@bwoebi Hit the merge button. github.com/async-interop/promise/pull/43
18:44
@tereško What's the concept of "react"? these days I'm constantly hearing about reacts (react native, react js, and now reactphp)
19:08
If I have learned anything from this RFC discussion it's that people want JS/HHVM syntax. /cc @bwoebi @NikiC @Trowski @Wes
Maybe we should consider moving to a GLR parser.
Wes
Wes
i actually prefer fn() to ()=>
but i don't really care as long it's short and it works by ref
19:31
() => {} is sexy
19:55
Who processes PECL account requests?
hi everyone I have a profile page that pulls all the data properly the only issue is i cannot get it to keep the users gallery images in there profile.. or the images will only show one image
0
Q: display information form 2 tables based on id

CodiI have a profile page that has 2 database tables, table1.users and table2.images table1.users has id, email, full_name and table2.images has image_id, id, picture_image this is not a page that requires sessions or login my problem is that the user can upload images to their profile f...

@Codi I'd strongly recommend re-writing you question until it is focused on the exact thing you are having a problem with, rather than including both HTML and an sql query in a single question. Maybe sscce.org would guide you on how to rephrase it.
@LeviMorrison in that case I'll vote no. And that no is not up to discussion for me.
20:12
Hey guys, can someone explain urlencode should i always use it when using get parameters in links?
Wes
Wes
@TheCodesee yes. if with that you mean print out urls
although browsers these days are more permissive with malformed urls
20:53
hey guys can any one tell me how can i use isset or empty functions like this
$var = 'isset';
$var($form['user'])
it gives me error call to undefined function isset
i am working on a dynamic validation class
@AbdulRafay isset isn't a function
@AbdulRafay use array_key_exists instead:
$var = 'array_key_exists';
$var('user', $form);
I wouldn't use raw functions - I'd wrap all validators up into specific types:
class StringLengthOrNull extends StringLength
{
    public function isValid($value)
    {
        if ($value == null || strlen(trim($value)) == 0) {
            return true;
        }

        return parent::isValid($value);
    }
}
I haven't run the tests for this recently, but github.com/Danack/FirstClassForms/tree/master/src/FCForms might be of interest.
21:10
@Danack thank you
21:28
@bwoebi @Trowski Instead of printing the exception thing to STDERR, we could also just throw the exception from a register_shutdown_function for the Promise\ErrorHandler: 3v4l.org/BQeEC
I honestly don't care what happens at that point of execution
argh yasuo
I think it's a little bit cleaner, as it doesn't print to stderr directly but let PHP decide that.
moagain
@DaveRandom o/
21:35
inb4 yes I am doing some dns things right now
ok i will stop reading the php.internals mailing list
@kelunik do whatever you prefer there :-)
@NikiC What did he do this time? the hkdf thingy?
yes
he just trumped his own incompetence by suggesting to remove the length parameter
That fucking parameter is 90% of the reason this function exists
I like how "trumped" has a more contemporary and still contextually valid meaning in that sentence
:D
i dont really unterstand what Yasuo want
on the mt_rand discussion he said himself its not supposed for crypto stuff - but then why make it stronger?
i just dont get the point of his mails
21:50
@Stricted he wants to make stuff "safe" for people to use, even if they're using it completely incorrectly.
e.g. the whole of the mt_rand thread.
Not just that
Bah
in my opinion nonsense to change it for neraly no benefit
I will just tell gmail to discard his mails
great idea
imagickpixeliterator_object_handlers.get_gc = php_imagickpixeliterator_get_gc;
is there anything other than that ^^ required to get the gc hook to be triggered when an object can be garbage collected?
no_idea_what_I'm_doing_dog.jpg
21:58
@Danack nope
So php_imagickpixeliterator_get_gc should be called when the imagickpixeliterator object goes out of scope, before its destructor is called?
no
get_gc is called when the cycle GC runs
if you want to do something before the destructor is called you can override the dtor_obj handler
Though I'm not sure when you would ever need to do that
Ok, I'll ask what I should be doing then. I have a ImaigckPixelIterator object that has a method getNextIteratorRow().
which returns an array of ImagickPixel objects.
The ImagickPixelIterator needs to not be destroyed, until all of the ImagickPixel objects in that returned array also can be destroyed.
So where can I tell PHP, this object is still needed, if there are references to those other objects stil live?
Why is the object still needed?
I think internally ImageMagick is freeing all of the pixel objects that were created by a PixelIterator object when the iterator is freed.
22:04
okay
So the iterator owns the pixels?
And you are creating objects referencing pixels owned by the iterator (rather than by the objects)?
That is my understanding.
In that case the pixels need to reference the iterator
Though the design sounds distinctly weird
So, add just add a reference to the iterator object, when a 'child' pixel object is created? And decrement when the pixel object is destroyed?
yes
> Though the design sounds distinctly weird
22:07
and add get_gc handlers, as you now have cycles
@Danack I'd first make sure that this is really how pixeliterator works, and isn't just an artifact of some other issue
Yes, what could be better than reading the source code
Wes
Wes
@Trowski maybe you can help me, can i ensure that N methods from 2+ different mocks are called in the order i define? i want do do: mock A's foo() will be called, then mock B's bar() will be called, then mock A's foo() will be called again, in this order
it seems each mock has its own queue
actually - that was easy to find. Destroying the iterator does definitely destroy the pixel_wands it had created: github.com/ImageMagick/ImageMagick/blob/master/MagickWand/…
And there is a hack to prevent a double-free for those pixel objects in Imagick: github.com/mkoppanen/imagick/blob/master/imagick.c#L2892-L2893
@NikiC just to clarify one thing, is it actually a cycle? The pixel iterator object in PHP, isn't currently aware of the pixel objects, so there's only a single direction of references, rather than a cycle, right?
22:22
@Danack in that case, not a cycle
cool, thanks.
hi all
what is this sign <<
Shift bits to the left x units.
7 << 2 would yield 28.
how 28 ? can you just split it
7 in binary is 00111, shift them to the left twice yields 11100, or 28.
22:29
ohh means 1st 2 digits of binary will be shifted to right
is that correct?
No, another example... 18 (00010010) << 4 = 144 (10010000)
err, I meant << 3
18 << 3 = 144
I do have a question of my own though, I'm working with a project called aurweb (git.archlinux.org/aurweb.git) and we can run php -S to test things and we're curious how it knows to rewrite /index.php/xxx to /xxx?
thats simply clear that you moved 1st 3 digits of 000*10010 to the right and digit becomes 10010*000
@Danack i didnt understand their example really
thats why I asked here
0010010 << 4 = 100100000
22:37
ping @JoeWatkins?
It's moving all the bits to the left.
but I can see them moving to right
Ignore the leading zeros
Pretend I grabbed from a NEW pile of 0s and stuck them at the end.
And the ones on the left are just shoved over.
Because for 144, 10010000 is the same as 0000000010010000.
00001001 << 2
00100100 << 2
10010000
22:40
Just like 144 is the same as 00144.
or even simpler
01 << 1
10
@DaveRandom ignoring leading 0 will give me 10010
and now I have to add 4 zeros at the end,right?
@Exception OK so forget binary for a second. In decimal, if I write 9 or I write 0000009, they mean the same thing, yes?
It's the same in binary. It's just padding.
@DaveRandom yes thats correct
OK so the only significant digits are the ones including and to the right of the first non-zero digit
thus you can pretend that the leading zeros are not there
When you left shift, you are shifting zeros on from the right, that makes them significant zeros
2 mins ago, by DaveRandom
01 << 1
10
in its very simplest form
22:43
I have an idea, let's say I'm limited to 8 bits, 11111111 << 6 = 11000000.
there is no meaning of remaining 1's
is that correct?
I am still confused man
?
They have been shifted off the end of the register
why dont you just explain in simple english
:(
may be I am not able to get it
I had no clue what it meant the first 19 times I saw it
Same.
22:47
Because PHP abstracts all this stuff away from you
It's low-level computing
It's not particularly complicated or difficult but it's not something you are used to thinking about
yes thats correct
<< and >> are binary operators, which we aren't used to thinking in.
@Exception you know what we mean when we talk about 32-bit and 64-bit integers?
Like, what that actually means in real terms
OK so what @markzz was using there were 8-bit integers (bytes), which is a good way to simplify it down IMO
for readability if nothing else
22:50
Because writing 32 or 64 bits is annoying.
So imagine I have this byte:
00000001
If I left shift it by 1, I get:
00000010
pretty obvious what happened there, yes?
yes yes I got it
if I left shift the original byte by 7 I get this:
10000000
@DaveRandom Ah, so you're saying << 1 means "flip the lower two bits"?
@DaveRandom yes
22:51
@NikiC wow you are annoying :-P
@DaveRandom sorry :P
...
@Exception OK, so if I left shift it by 8 what happens?
@NikiC no, no - he rotated the whole number by 180 degrees.
OH I KNOW!
PICK ME
22:53
@DaveRandom On x86 or on ARM?
(okay, I will shut up now)
@DaveRandom 100000000
You cannot have 9 bits in a byte.
@Exception except that can't happen, because your integer (byte) is only 8 bits wide
So it falls off the end and becomes zero again
Jan 20 at 14:06, by Jeeves
[ Jeeves ] [ c41460c ] I hate you people - Commited by: Chris Wright on 20.01.2017 13:55
@kelunik We would need to separate them into adding Argon2i to password_hash()/password_verify() AND adding an hash_argon2() for just a KDF
I stand by the commit message
oh hey @ScottArciszewski is still alive \o/
22:55
for the moment
@NikiC: Would you possibly know the answer to my question wayyy above?
@DaveRandom so it will be 8 bit wide ALWAYS
so digit will remain same as that of 10000000
@Exception No, 00000001 << 8 = 00000000
ohh
gotcha
22:57
in this specific example, where the integer width is 8
it can be greater
?
In PHP you have no control over the integer width, in the real world it's likely to always be 64 bits nowadays
@markzz Not sure if I get the question. Are you looking for one of PATH_INFO or REQUEST_URI?
I couldn't even find the question :-P
@ScottArciszewski a kdf should be definitely be a separate function… but pwhash() sounds like hashing passwords…
@ScottArciszewski also, can't that be merged into this hkdf proposal?
22:59
if we can't replicate the exact functionality of those two functions with a simple function alias, I'm not about to change the proposed API
@Exception It's... tricky when you are used to high-level languages. Is there are particular reason you are asking about this other than curiosity? i.e. do you have a use case or are you just trying to learn a new thing?
@bwoebi nope, different algorithms.
@NikiC The project uses urls that nginx rewrites /index.php/xxx to /xxx, so it uses PATH_INFO to route the pages. For some reason, with php -S, it seems to do this without configuration and is confusing me.
@NikiC ah okay

« first day (2303 days earlier)      last day (2870 days later) »