« first day (1812 days earlier)      last day (3142 days later) » 

9:00 AM
Although hotel is expensive...
 
I had a ticket, it's the rest of it ...
 
Well @salathe be quiet! … TBH, I think we hould also disallow invalid \x sequences… but I don't think we can afford invalidating invalid normal escapes (just leading backslash), too much a BC break?
@JoeWatkins and your company can't pay your accommodation etc.?
 
Hotel is insane prices.
£40 first night. £130 second
 
@bwoebi Hehe, two for two replies so far have been the "stfu" choice :)
 
@Fabor that is insane ...
 
9:12 AM
Yeah, stupid football.
 
@bwoebi I'm sure they would have, given enough notice ... but I only found out the other day that I needed accomodation ... bit short notice, and they're not sending anyone else ...
 
@Fabor 130£ per night or the the second night?
@Fabor ??
 
Yeah because there's a football match so they hike the prices right up.
The second night.
 
oh…
 
@Fabor you don't want to see Edinburgh hotel prices then :P
 
9:18 AM
heh. TBH anything over £60 makes my jaw drop. I start considering sleeping rough.
 
@LeviMorrison May you please allow multi-statement bodies too…? (At least, that was the point which generated the least complaints in previous RFC...) With a few examples of chained <closures, it's very obvious…………
 
@bwoebi If we keep function instead of fn, I think multi-statement would be confusing
Because then the only syntactic difference is that additional =>
 
@NikiC well, IMHO it's already confusing because it's reusing function.
whether we use multi-stmt bodies or not.
Which is why I honestly think we should just use fn and not function...
I'd like to copy Levis draft and rolling out my own RFC with these two changes… but don't think this'll be a great idea and just would be invoking some drama.
 
yeah I thought Levi was going for fn
 
9:26 AM
I'm having an issue with a Segfault in a patch for my new RFC (wiki.php.net/rfc/curl_http2_push), and I'm stuck. Andrea pointed me at a few things, but I'm still not getting anywhere (in fact, it's worse :P) — here's the patch, github.com/php/php-src/compare/master...dshafik:curl-http2-push
 
I'm just not yet sure whether function (instead of fn) is a no-go for me or I'll just abstain… \cc @LeviMorrison
 
the segfault is on line 487 of multi.c
 
@DaveyShafik looks strange
 
@DaveyShafik Where are you initializing ... everything?
Like mh->handlers?
And on a similar note, are you sure you want those to be pointer rather than embedded structs?
 
@DaveyShafik Any reason php_curlm_server_push *server_push; is a pointer and not an inline struct? (same for the handlers?)
 
9:32 AM
I have no idea what I'm doing :P
 
that explains many things, I would do over, but I'm terrible at git, when I try to checkout your branch, strange things happen ... someone braver will help, I'm sure ...
 
@JoeWatkins happy to help with git :)
 
@Naruto why did you add Successful to that edit?
nvm I see...
 
@JoeWatkins it should be git remote add dshafik https://github.com/dshafik/php-src.git, git fetch --all and then git checkout dshafik/curl-http2-push
 
9:38 AM
@PeeHaa what?
 
@Naruto I misread your edit on a question
 
Ah, which one?
 
the mysqli escape one
 
Ah, just added some code format, didn't touch the text itself :)
 
Yeah I misread
 
9:43 AM
Horrible question tough.. should be closed
 
Maybe I should learn not to edit questions which probably get closed anyway ^^
 
@Naruto Meh it's ok. I also sometimes edit questions to be able to read whether they should be closed :P
 
interesting, Python discussing our EOL docs: bugs.python.org/…
 
Windows 10 is a fucking horrible thing and I hate it
Unrelated ^ but true
 
9:49 AM
@PeeHaa after using 8.1??!
 
@NikiC compared to 7 and XP I guess.
 
@NikiC I never installed 8
I always said I never get away from 7, but I have a new machine now :(
 
I haven't used 10 much yet, but after 8.1 it seems quite fine ^^
 
^ +1
 
9:55 AM
So... "yeah it is fucking horrible, but a bit less fucking horrible than 8"? :P
 
Anyone got any tips for avoiding coughing when giving a talk? :(
apart from whiskey
 
oh
 
@PeeHaa What's horrible about it?
 
When your script doesn't work in the production area and be like ¯_(ツ)_/¯
 
@Jimbo Phlegm cough?
 
9:56 AM
@Fabor Yep, it sucks :(
 
Hot drink
 
What just like a hot tea or something during the talk?
 
Yeah, take a flask or something
 
Nice, good call
 
9:57 AM
Try it now, see if it's good for you.
 
@NikiC Searching in the menu doesn't find stuff (i.e. where is calc)? The flat windows confuse me. The flat windows make it hard to resize my putty window because there is only a tiny resize surface. Edge is crap
And this is 30 minutes of work
 
When I check domain records, and I see TXT records like OUTLOOK... Where do these mails then get stored on the client's computer? Or always on server where the domain name is linked to?
#Issue I have to move a website including the mail accounts. But the mails are not allowed to dissapear, so I can create a new domain with the transfer code move the files, create the new mailboxes. But how to include the old mails?
 
Might be a stupid question but anyone know why I can't edit / delete some of my messages? (here in chat) It happens sorta randomly and the only option I have on them is to Flag them for moderator.
 
Have fun, everyone going to PHPNW :-)
 
Anonymous
Is ruby a lower level lang than python?
 
10:19 AM
paste.ee/p/oDazR Based on this example I made: What is it doing when I do:
public function displayMyVariable( myVariable $myVariable) {
Is that called 'type hinting' ?
 
@Epodax time limit
@Ocramius enjoy :)
 
@JoeWatkins damn it
 
@Epodax All your messages are belong to us :)
 
@PeeHaa Nooooooooooooo.
 
Aww, is the short_closures RFC not gonna make it :(
 
10:35 AM
Why would I use "Chapta" for a form (like contact_us) in my website?! I can use a checkbox, and if user selected it, then I can understan it is not a robot. is it right?
 
> Chapta
 
what ?
 
muhaha
 
It is "captcha". And a robot can tick that checkbox as cleanly and innocently as a human
 
A bot can easily check a single checkbox and it's captcha.
 
10:37 AM
ah :-)
sorry
@AwalGarg oh really?! alright then!
 
The reason why a captcha is more effective, is because it's random.
 
@MikeM. so is Dave
 
@Gordon Who the heck is dave? :P
 
@MikeM. @DaveRandom
 
-.- :-)
 
10:40 AM
so, there is not any approach for submit a form as safe without using captcha ?
 
@Sajad there are some, but none as effective as a good strong captcha
 
Whats the problem in using a captcha -.-
 
ok, how can I use captcha? (unfortunately reCaptcha is filter in my country)
 
google "php captcha lib"
 
php has a library for captcha?
 
10:42 AM
You can write one, if there isn't.
But most probably, yeah
 
Honey pot technic is much better than captcha for your users
 
11:02 AM
Rather than passing through an array type as a function paramater
is it considered best practice to make a value object?
 
Is it normal to consider empty result set from database query to be an exception?
@EquinoxMatt it's not bad to pass arrays as parameters, function foo(array $arr) is normal
 
posted on October 02, 2015 by nlecointre

/* by jaco-jan */

 
@iroegbu - I would say no, because having an empty result set is not necessarily a 'exceptional' result
an exception would be not being able to connect to the database etc
 
but attempting to open a file that doesn't exist is an exceptionable... why should attempting to get a row that doesn't exist be treated differently?
 
@iroegbu - I thought that. But from an outside dev perspective, he may have no idea what is contained in that array
@iroegbu - I think it depends on the context. If you can't open a file which is necessary for normal app functionality (say a config file or logging) that would be exceptional
@iroegbu - also, if a file does not exist when it should, it is an exception
if you do a query on a database and there should be absolutly no reason for getting an empty result, it is 'exceptional'
 
11:12 AM
@EquinoxMatt the outside dev should read documentation... if you used an object instead of an array, he will still have to study the object anyway
 
true, but wouldn't an object have defined properties? Take an invoice object (InvoiceNumber, OrderNumber, TotalValue, TaxValue)
in an array, this may not be even defined
I am purely playing devils advocate here
 
your array can have those as well... there are many cases where people use arrays to pass params that way...
 
you could also easily document a value object via PHPdocs
 
you shouldn't be hasty to add stuff to your project... if an array can do it, use an array; if you think you need an entity for it go ahead...
 
ok cool! Thanks for the input
 
11:26 AM
Hi...
 
11:37 AM
Shit, just practised my talk, it's only 40 minutes long
 
@samayo nope sorry.
your best bet is to keep applying
 
@SergeyTelshevsky don't you just do PEMDAS?
 
11:47 AM
@samayo you may find job boards/agencies/other job sites more productive in acquiring employment than an SO chat room :p
 
Anonymous
@JonClements Yeah. This is just an addition to the list :)
 
Anonymous
 
@SergeyTelshevsky Is the answer 4??......
Really?...
My whole life is a lie....
 
@MikeM. The 7 and the parentheses you use the distributive property if I recall.
2(4+2)
is 8+4
is 12, right?
 
Well I believe, following math rules it would turn into "7*(3^2-5) - 7 + 3" == "7(3^2-5) - 7 + 3"
oh wait
nvm.
It's evaluate the expression
I said nuthing.
Reading always has been hard :-)
 
12:01 PM
I just took a 3-4grade practice math test an hour ago. I got a perfect score. I think I know my shit.
2
=oP
 
I hate math anyways xD
allthough it's very important, I hate it.
 
user1804599
tough luck programming then
 
Hating something and not doing/knowing something are 2 different things, just saying..
 
@crypticツ @MikeM. it's correct but it's an attention exercise :)
 
Anonymous
@elyse I quit highschool in 2006, I never had the chance for education since then, and I don't think I found programming harder because of that fact.
 
Anonymous
12:07 PM
Even those education I got until high, was in one of the poorest countries in Africa.
 
Anonymous
No in any way comparable to a European level education.
 
Anonymous
just sayin
 
@samayo rofl, if I'd do shit about math I probably would be well in it, but since middle school I stopped doing a lot for it as I got more and more lessons to take care of instead of only math, so ye I keep up in class, learn a few things but after all it just hides in a corner and never come back.
 
@MikeM. no
 
My AVG score in middle school with algebra and math was about 89/100 - 92/100 it always jumped up and down in that range, now I barely have a 65/100... but most likely about a 55/100 so I just nail it.
 
Anonymous
12:11 PM
I don't even know what algebra means lol :/
 
Anonymous
There is not a day that goes by, that I don't regret quitting, but that's life :(
 
@samayo The simplest way to describe it is whatever you do to one side of the equation you have to do to the other
 
@SergeyTelshevsky What no? That's clearly a yes because it's a fact ^^
 
ehmm. E_LACK_OF_REBECCA
 
@RonniSkansing SHUSHZZZ I DIDN'T SEEN IT YET!!!
 
12:13 PM
Algebra is simply a way to solve math problems when you don't have all the pieces in a nice, neat order
 
Anonymous
@Machavity stop messing with my head :D. Sometimes, I try to take the courses at khan academy, but I'm focusing on learning German right now. But, next year .. I will.
 
@samayo Why is learning german so important for you? :P
 
Mind you I took college level calculus, which I don't know that I've ever used in any real life situations
 
@NikiC And what do you think about fn that is just function but shorter? And what do you think about fn that only exists on short closures?
 
Anonymous
12:16 PM
@MikeM. Going to UNI. (Have to take an exam, which is in part German). If not, I get some job (dev) offers on the German-speaking part of Switzerland A Lot. And, I fail solely on my lack of basic German skills. Which is required.
 
@samayo Understandable :P
 
@crypticツ I tought you were going to say you've learned not to click links on friday ;)
 
12:33 PM
@Naruto xD that should have been on it aswell :-(
now Imma go unfavorite the image.
Damnit, StackOverflow hates that -.-
 
@NikiC ping
 
12:59 PM
@crypticツ The sad thing is that, I was quite convinced that today is Wednesday despite the usual Rebecca references...
Went to an appointment today thinking it was Wednesday
I have no idea how that happened
@JoeWatkins pong
@LeviMorrison I think having fn only on short closures would be best
 
anyone using phpstorm around?
 
@EquinoxMatt vim is the only true editor! Repent and ye shall be forgiven
 
Haha. Well I am pretty fluent at using phpStorm without needing to use my mouse
however there is one thing irritating me and I can't find the answer
When you have a code inspection error, the only way to know what it is that I can see is to use your mouse to hover over it
I would of thought there must be a way to view the error by moving your carat, somewhere within the offending code and then use a keyboard shortcut to get the error?!?
 
@LeviMorrison well, fn only for short Closures is what I'm advocating for all the time…
 
nvm, I am just being thick as shit, you press F1
 
Anonymous
1:17 PM
@NikiC It happens to me also. E_TOO_MUCH_PHP
 
user1804599
<?php
from __future__ import echo_function
 
Anonymous
from extensions import Session
 
Anonymous
@elyse That would be nice to have in PHP.
 
mus
hello
I need some help
can someone here help me?
 
Anonymous
I hate it that all extensions are loaded by default.
 
Anonymous
1:20 PM
@mus ask and see
 
user1804599
@mus depends on the problem
 
@mus Hi, just ask your question, if people have time and knowlege they will try and help you
 
user1804599
Currently, no, because nobody knows what you need help with.
 
Feels like a regular question on SO xD
 
mus
$sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]." ".$requestData['order'][0]['dir']." LIMIT ".$requestData['start']." ,".$requestData['length']."";
 
1:21 PM
.@Naruto lol
 
mus
I have problem with this code
it always says Error :You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT ,' at line 1
 
user1804599
haha
 
Anonymous
> I have problem with this code
 
@mus Uhhhmmm what is $requestData exactly?
 
mus
it's for datatables
 
1:21 PM
please tell me this isn't all coming from user input?
does $requestData from POST or GET data?
 
mus
it's to make datatables work with serverside
yes
$requestData= $_REQUEST;
 
Insta drop database
 
@samayo Story of my life.
 
@NikiC Any particular reason?
 
@mus Read up on sql injection prevention
 
1:22 PM
@mus - This isn't a put down, but please for your sake read this phptherightway.com/#security
Never ever, build your SQL queries based on user input
well, that is wrong
but be very careful about using user input.... at the very least filter it first!
 
Morning's
 
o/ @AnmolRaghuvanshi
 
mus
I will use trim()
and mysql_real_escape_string
 
user1804599
lol
 
1:25 PM
why not just take the values and compare them against an array of available columns
 
Anonymous
@mus trim everything
 
@mus Read up on prepared statements
 
user1804599
trim($beard)
 
you define the columns, and then match the input to the available columns
 
user1804599
@ʎǝɹɟɟɟǝſ you can't do that with ORDER BY
 
mus
1:26 PM
here is tutorial coderexample.com/…
 
@mus $requestData['start'] seems to be null or generally empty
 
mus
ahhh
start is what?
 
@mus do a var_dump($requestData['start']);
 
You probably want to check for that condition and define some sensible default (or perhaps just omit the , in the case that value is empty).
 
R.P
1:28 PM
Anyone has used APCIterator? Basically the question is why it cannot find cache entries even if they exist there? Also why doesn't apc-status.php show all cache entries (even though it's there)?
 
mus
@Naruto it gives NULL
 
@mus well that's a problem then isn't it? :)
 
mus
yeeeee
but what is this $requestData['start']
here is from where I took the code coderexample.com/…
 
mus, you need to learn MySQL syntax
you shouldn't just take code and expect it to work without learning what LIMIT actually does
 
mus
yes I know what it actually
does
 
user1804599
1:31 PM
@ʎǝɹɟɟɟǝſ Complicated parameterisation like this is where I usually start looking for query builder libraries and then get bored and abandon my project.
 
@mus Copy pasting code without understanding it is not going to work in the long run. Just sit down, learn PHP and MySQL (or any other SQL engine).
 
mus
lol
 
@mus are you sure the ['start'] and ['length'] are being passed to your script?
 
mus
I'm not that nub
in php nor in mysql
 
posted on October 02, 2015 by nlecointre

/* by Arnaud */

 
1:32 PM
LIMIT ".$requestData['start']." , - is obviously the first param of the LIMIT statement
 
mus
I just can't get the values being passed from datatables
yes
but let's say
I removed request data
I did LIMIT 1,10
and still same problem
it gives error
 
What is the full SQL you are trying to run?
 
LIMIT 1 OFFSET 10
 
mus
$sql.=" ORDER BY ". $columns[$requestData['order'][0]['column']]." ".$requestData['order'][0]['dir']." LIMIT ".$requestData['start']." ,".$requestData['length']."";
 
well
I think it's the other way around, LIMIT 10 OFFSET 1
 
1:34 PM
What is contained in the request data vars? We have no idea
it could be anything
 
he just said values couldn't be passed :P
 
mus
here is the tutorial guys
 
@mus better just check the regular site.. datatables.net/manual/server-side
 
Didn't you say requestData['start'] was NULL?
 
@mus var_dump($_GET); and check the 2 values you need
 
mus
1:38 PM
@Naruto array(0) { }
 
or better yet, just print $sql and paste it here so we can see the full query
 
that is awesome news.php.net/php.internals/88640 (no friday link)
 
@mus and var_dump($_REQUEST) ? which kinda is the same but w/e
 
Weekend time wooooo!
 
@PeeHaa get stackoverflow.com/questions/32907803/… this closed already will ya
 
1:43 PM
^ second time a person has added a answer... first answer got deleted tho
 
How awful....
 
mus
I made it work
hurrraaaaa
I installed firebug
I was using the php file directly
which limit was null
but now I went to the datatable
which is sending limit values
so now everything is working fine
 
still, a highly suggest you read phptherightway.com
 
@mus now the SQL-injection optimalisation ;)
 
Is there a html 5 equivalent for images like <audio /><video /> elements? Tried <img /> ofc but for some reason it doesn't like what I'm trying to do
 
1:51 PM
I tought this was the PHP room?
 
Sec, adding more info, so you know why I'm here
 
mus
yes @Naruto !
@Naruto I have a function
in my php script which I use it all times for variables
before entering them in php
wait I will send it
 
@mus No need..
 
mus
function secure($value){
$value= trim($value);
$value= bad_word($value);
$value= addslashes($value);
return $value;
}
I'm using this
bad_word is another function
which has values like window
alert
javascript codes etc
 
In short: I'm working on a secure upload script. Files are given a temp name and a .tmp extension. Temp name, original name and MIME type are saved in database. Next files are retrieved by sending some headers and readfile(). This works fine with the <audio /> and <video /> tags using the retriever as source. But the <img /> doesn't like that approach. Hence the question earlier
 
1:55 PM
Why not just upload the file and store the name inside the DB?
 
Because of the risks involved in that. If the user is able to find the filename on the server, they could abuse that by parsing the files through the php interpreter
Technically I guess that can be solved by saving the files outside docroot or using a htaccess file. But for now I'm trying this approach
 
user1804599
 
@elyse not super updated afaik
 
@elyse good for what?
 
user1804599
good as in correct and complete
 
2:09 PM
dude, your password is showing up news.php.net/php.internals/88640
8
 
@marcio LOL
 
How do I make more money?
 
Gigalo
 
@marcio clever :-D
 
sent a private message, the email client is probably fooling him.
 
2:20 PM
@DanLugg I'm going to have to agree with @EquinoxMatt
 
@marcio haha, you and about 50 other people :P
 
Bah, selling drugs never worked out for me
I can't imagine manufacturing will go any better
Unless you're implying that I just quit my job and make/do speed all day
 
I definitely think there's a market for cacti for PHP developers considering how much we've discussed it
 
@DanLugg is finding a job that pays better an option?
 
2:31 PM
@Jimbo cacti for php devs? o___O
 
@marcio That's definitely my first line of offense.
I've got an "okay" paying job, but uncuttable expenses keep piling up.
I was thinking supplement, more than replace, but whichever works.
 
@bwoebi I honestly thought cacti was some new drug that he intended to sell to his coworkers.
 
@marcio lol
 
@DanLugg Have you not done a search for jobs that pay more? Senior positions?
 
@DanLugg just out of curiosity, you're still having that consultancy with the JIRA guy?
 
2:43 PM
@DanLugg You could always act out 'Pretty Woman' but in reverse rolls ;)
I hate JIRA -_-
 
@marcio lol
 
@DanLugg your expenses will always grow to match your income...
 
@iroegbu - very good point
 
agree @iroegbu
 
@PeeHaa shouldn't that question be closed instead 'on hold' ?
 
2:59 PM
@Jimbo I have, and am in the process of starting to apply, revising resume, etc.
I gotta get my shit together as far as past work, etc.
@marcio Yes, unfortunately. Thankfully he's become less and less involved, as predicted.
 

« first day (1812 days earlier)      last day (3142 days later) »