« first day (2050 days earlier)      last day (2902 days later) » 

11:05 AM
Oh, I see @Oldskool You are dutch, it's one based not far away from where I live.
 
isn't this considered good practice in PHP code

/**
* @var \Omnipay\Paysafecard\Gateway $gateway
*/

for autocomplete.. ?
 
Hi, everyone
How to test web hook Braintree in local host ?
 
@GeoPhoenix Even better is to make sure wherever $gateway gets it's data from has a return value documented like @return Gateway
Then the @var should not be necessary.
 
how about some type hint?
 
Or use PHP 7 and specify the return type =D
 
11:12 AM
Even better :)
 
Using PHP 7 with PHPStorm, I find very few doctype declarations are needed for autocompletion / hinting to work properly.
s/doctype/phpdoc/
 
@AllenJB True, but then you're assuming everybody uses PhpStorm. It's still good practice to document stuff.
Just because PhpStorm is awesome doesn't mean you have to stop doing that ;-)
 
Everybody should use PHPStorm - it's awesome =P
 
Anyone please answer my question .
 
> If anyone wants to answer your question, they will..
 
11:15 AM
@Saitama thanks for the info
 
@BalasureshAsaithambi If no one answers your question, there's a site you can post it on called StackOverflow.
 
man .. paysafecard is such a f*ck'd up service..
 
@MattPrelude "How to test something" is not really a proper SO question. Very vague and very broad.
 
Hello every one..
any one idea about any plugin that import facbook post as wordpress post type
 
@Oldskool True, but I was hoping there might be more to the question.
 
11:45 AM
hey guys, so is it this the right syntax to pass a php variable to an sql query?

$result = mysql_query("INSERT INTO reg_users(gcm_regid, created_at) VALUES('$gcm_regid', NOW())");
the variable is $gcm_regid
 
No. Use prepared queries (mysqli / PDO).
Also note that the mysql_* functions have been removed in PHP 7.
 
@AllenJB can I know what's wrong with this approach?
 
ok @MattPrelude
 
@SamIbraheem It's vulnerable to SQL injection and/or results in broken queries / corrupted data due to improper escaping.
 
@SamIbraheem $gcm_regid is unsafe
 
11:47 AM
@AllenJB OK, cool I'll try to use prepared statments
 
12:00 PM
Hi, is there a good way of arranging ERD diagrams (.mwb file)?
So that all the tables and relationships are visible
 
you guys, is NOW() a valid sql function?
I mean does it return the current time or something?
 
@SamIbraheem yes
 
man I love SO
 
@SamIbraheem have you heard of google?
^^
 
@ChristophBühler yeah I did but I like talking to people in here =)
 
!!google sql now
 
!!command
 
Syntax: command [map|remap] <command> <plugin> [<endpoint>]
        command unmap <command>
        command alias <new command> <existing command>
        command list
 
!!command list
 
12:05 PM
Commands currently mapped:
 > - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 ? - Retrieves and displays search results from Google (Google # Search)
 @PeeHaa - Implements the Lickable interface (Lick # Lick)
 canon - Posts links to canonical resources on various subjects (Canonicals # canon)
 chuck - Posts a random Chuck Norris joke (ChuckSkeet # Chuck)
 docs - Searches the PHP manual and displays links with a summary of the result (PHPDocs # Search)
 eval - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 
WHO CHANGED !!google???
 
lgtm
 
@DaveRandom hi dave
do you know how to arrange an ERD?
 
what's an ERD?
 
Alphabetically
 
12:09 PM
Entity Relationship Diagram
 
none the wiser
 
SQL diagram
 
is that like UML or something?
 
kind of
it shows the relationships of a relational DB
 
Never used it, sounds a bit professional for me, I basically just hack things together until they work and make it up as I go along (not entirely serious, but at least partially)
 
12:10 PM
If you use MySQL workbench
 
"it doesn't have" or "it doesn't has" ?
 
You have 54k rep, you gotta know everything ^^
 
Ahh no, I don't use MySQL haven't used mysql for some time
@Shafizadeh have
 
@DaveRandom ok :)
 
"Can I has teh cookie pels"
 
12:11 PM
What do you mean by "arrange" though @ChristophBühler?
 
It's "has" I guess
 
I have done things like that before
...and am never usually happy with the result
 
Anonymous
@Shafizadeh You should read children's book and watch animated movies in English. That's how I learned.
 
@DaveRandom This: imgur.com/J5lmnPV looks bad
 
yeh but relational databases are like that. Just fudge it around until the fewest lines intersect - the real issue here is probably that diagrams like that aren't as useful as they sound for any moderately complex application
 
12:14 PM
@samayo I did .. but I doesn't have any talent to learn English :-)
 
Circular references will happen perfectly legitimately, all the time
 
Anonymous
You don't need talent, you just need ears.
 
(but also note I am not a DBA and my opinion is decidedly not authoritative in this matter)
 
Anonymous
Listen to what they say and try to repeat the words you are curious about.
 
Anonymous
Also: I doesn't/I don't
 
12:15 PM
@DaveRandom Is there an alternative?
 
@samayo ah yes you are right
 
Is there a superior REST framework for PHP with child ressources, HTTP response codes and built-in authentication?
 
@ChristophBühler to what?
To the diagram? Depends what you want to do with it. To MySQL? Very much so.
 
MySQL
sry
 
Postgres is... wonderful
!!version
 
huh
@PeeHaa so, @cv-pls was just d/c by the server
 
!!google
 
@Jeeves was not, interestingly
 
@DaveRandom slimframework.com this looks nice
 
12:21 PM
@ChristophBühler I'm also not a framework person (meaning I don't know much about them)
I haven't written a web site in a while, I mostly work with libs and back-end things
 
Not the back-end you're thinking of either.
 
Right. It's mostly @PeeHaa's mother's back end.
 
:P
 
@DaveRandom Don't be so cautious. You have 54k reputation. You know it all
 
I really don't, fake internet points are no measure of how much anyone knows ;-)
 
12:23 PM
@ChristophBühler laravel lumen
 
@DaveRandom Even though you look young af on your profile pic..
 
All that means is that I have wasted a lot of time answering trivially easy question
@ChristophBühler :-P
brb smoke
 
@PraveenKumar looks quite nice, thanks. Do you have experience with it? How does it compare to other REST frameworks?
 
anyone familiar with integration of paysafecard service? how do you test locally?
 
@ChristophBühler No experience but you can get more info at stackoverflow.com/questions/29647960/…
 
12:25 PM
okay thx
 
@GeoPhoenix Line no 49 index.php $mode = 'test';
 
@PraveenKumar its allows connections from anywhere?
 
I think not
Hey guys anyone knows extended tutorial for class making and exception handling ?? give me some link
 
@Machavity thanks
 
There is a word like "sadeld" which means "the offer confirmed", anybody knows what's that English word?
 
Accepted?
 
No, it starts with "s"
 
check a thesaurus
 
12:51 PM
@Shafizadeh sold?
 
I don't think ^ . I heard that in the movies.
A: do you want to go beach in weekend ?
B: sure
A: that's sadeld
 
@Shafizadeh *settled
 
@Oldskool Yes, I think that's the one - thx
 
Woo Friday!
 
1:09 PM
I don't normally drink beers at work on Friday, but today is looooong.
 
is it strong? @fabor
 
prrrrrr
 
Not particularly. 4.5%
 
ah yes
i saw it
it seems like Miller
 
i saw it coming
 
1:12 PM
@AdilIlhan it's way better than that
 
1:26 PM
Which word is more proper as a column name, which describes this row is a new notification. "seen", "viewed", "visited" ?
 
i would use "seen"
 
@Shafizadeh unread
 
hmm, nice ^
@AdilIlhan thx
 
@Shafizadeh read
 
even so, i would use "seen" :D
 
1:30 PM
@AdilIlhan :-) .. English is your native ?
 
no :(
 
@DaveRandom Didn't see your reply :P
 
I'm a native speaker of Turkish
 
@MattPrelude ;-)
@AdilIlhan but English is @DaveRandom's native :-)
 
But very similar
 
1:31 PM
yeah
 
alright @Shafizadeh
 
'seen' to me is more vague than 'read'
 
@AdilIlhan however still I like "seen" t00 :-)
 
Could mean you've seen it in the inbox but not clicked on it
 
Well you could just go with "new"
 
1:32 PM
@DaveRandom I think "new" is a reserved word ..
 
not in SQL I don't think
 
@MattPrelude true
@DaveRandom ah ok
 
new should be reserved in mysql
 
I dont think it is?
 
1:33 PM
Yeah
 
@AdilIlhan you are right
 
stupid MySQL
 
Just looked
So read is what I'd use
 
@DaveRandom :D
@MattPrelude owkey
 
or unread if you prefer to indicate the new-ness
 
1:34 PM
@MattPrelude read is also reserved by MySQL
 
Actually
read is reserved too
Wow MySQL
 
@DaveRandom then really stupid MySQL .!
 
ahaha you will have to use "seen" at this rate @Shafizadeh
 
@AdilIlhan :)))
 
MySQL is really belligerent about reserved words as well, even T-SQL rarely complains about unquoted reserved words unless they are contextually ambiguous
MySQL just goes "no, that my word! give it baaaaaaack!!!" and throws its toys out of the pram
and it wonders why it has no friends
 
it won't last a day when it gets to big school
 
according to mssql's document
that "new" and "read" reserved keyword
 
Anonymous
It's funny how they reserved the most important words.
 
and oracle too...
 
Anonymous
I mean, they could have at least _prefixed it
 
1:38 PM
yeah, oracle suc
-cesfully made things worse
 
@littlepootis What's the meaning of "suc" ?
 
i thought you were going to say "oracle sucks"
:D
 
Ah .. :)
 
"seen" is not bad ;) @Shafizadeh :p
 
Anonymous
It's a pun.
 
1:40 PM
@AdilIlhan :)
 
Hi
How can I generate alphanumeric random string of length 5 ? like '96CA59'
 
Wes
\o noons
 
156
Q: PHP: How to generate a random, unique, alphanumeric string?

AndrewHow would it be possible to generate a random, unique string using numbers and letters for use in a verify link? Like when you create an account on a website, and it sends you an email with a link, and you have to click that link in order to verify your account...yeah...one of those. How can I g...

 
2:03 PM
@bwoebi I honestly had no idea you could increment a string indefinitely. That's a much better way to produce watcher IDs.
 
@Trowski It's a nice feature in PHP… :-D
These builtin gems in PHP are sometimes nice… :-)
so many tricks you can employ there
 
does anybody have like 10-15 minutes to spare to help me take a wordpress theme php file and implement some of the php calls within my php file?
I know it's easy stuff to most of you but quite overwhelming to me :)
 
@RajaSharma We actually don't really have any people in here who know much about WP at all afaik, although someone may prove me wrong
sorry :-(
depends what you are actually trying to do though?
(brb 2 min)
 
@DaveRandom its okay my friend :) thanks for being kind.
 
@bwoebi I think I agree with throwing on a invalid watcher ID to enable but ignore on other calls.
 
2:10 PM
@bwoebi Thinking just now ... If typed properties always start as uninitialized, is unset() actually needed for the lazy loading use case?
 
@NikiC Well, you then iterate over the defined properties and need to explicitly check whether the property is actually untyped?
 
@bwoebi doesn't this use codegen?
 
That's asking for holes in your feet.
@NikiC Eih, dunno, you need to ask Marco
 
@RajaSharma if you have a specific question I'll look at it, although I can't promise to know how to answer it :-)
 
@DaveRandom well On a webpage the theme does some calls to display blog posts. Now I hate the way it is styled which means I Need to change the way the html is structured. The problem is there are like 3-4 if statements which is making it difficult for me to implement the calls within my html.. I basically want title,date,category, read more. The php code they have has all these options in if statements. I just can't wrap my head around implementing it with my html which is maybe 15 lines.
 
2:12 PM
@Trowski Then perhaps write that into the issue or create a PR ;-)
 
@RajaSharma can you pastebin the relevant bit of HTML/PHP?
 
@DaveRandom Sure!
 
@Ocramius Does the lazy loading use codegen or are you literally iterating over the properties an unset()ing them?
 
@NikiC But the language should not rely on codegen. But this anyway only would cover the very specific case where we assume the object will never be emptied and re-loaded from db for example
 
@bwoebi Is that a use case? \cc @Ocramius
 
2:15 PM
@bwoebi Still trying to decide if there's something I'm missing... Icicle throws on operations on an invalid watcher and has helped me find bugs before.
 
@NikiC I don't know. I'm just proposing cases.
 
What I'm asking is basically: Is this really only about lazy loading, which happens exactly once, or not?
 
@NikiC I think lazy loading is just one use case here.
> breaking circular references on typed properties, hinting that there should be no access anymore
 
@bwoebi yes yes, I don't care about that
 
these are also points (which are actually valid cases)
 
2:17 PM
@Trowski just so I'm clear, the proposal is to throw when you try to enable/disable a non existent ID, but silently discard cancellations of non-existent IDs?
 
Wes
@Danack maybe?
 
@DaveRandom just enable … and discard on disable()/cancel(), as they don't change state
 
@bwoebi I personally would probably rather throw on all, because any of those would indicate a logic error (to me)
 
@DaveRandom even if you can show me just how to add the title i could probably figure out the rest :s THEME POST PHP: pastebin.com/EdwDHzms
MY HTML: pastebin.com/yj7kmbpU
 
2:20 PM
@RajaSharma kk, give me a minute or two to finish up what I'm doing and I'll look it over
 
@DaveRandom take your time!! no rush
 
@bwoebi hmmm... maybe you're right
 
Said no project manager ever.
 
either of those
 
Wonder if Jeeves should split the Plugin interface into two - one which supports handling messages, and the other which supports handling commands.
 
Wes
2:24 PM
is there any performance difference in doing
class Foo{ private $data; function __construct(){ $this->data = [huge array]; } }
vs
class Foo{ private $data = [huge array]; }

array is static, won't be modified after creation
 
@NikiC A big problem here still is that the behavior is really inconsistent here then. If we were to disallow it at all and start all properties in uninit state… maybe.
 
I find myself needing to implement the message functions even though I don't handle all messages.
 
but typed no, untyped yes … nah
 
@bwoebi yeah, in the end I don't like it
Just thinking about implications about UNDEF only at the start or UNDEF also being possible as an intermediary state
 
@NikiC it == Dmitrys proposal or it == undef props?
 
2:25 PM
@bwoebi it == forbid unset
 
okay
 
Basically the nice thing about not allowing intermediary undefs is that if $a->b is accessed (with typed b) then it is known that any following $a->b is not undef (assuming $a is not overwritten)
 
@NikiC Also, do we actually gain very much here from a compiler perspective when we allow undef only at start. We are not able to determine statically where it will be set for first time … and in case where we are able to completely analyze every access, then it's not a problem either.
 
If intermediary undefs are possible then we don't have this guarantee. And due to error handlers taking a symbol tables we don't even have it for code that does not explicitly do unset($a->b) or call othre code
@bwoebi we can determine that if an $a->b access dominates another $a->b access, then the latter will be guaranteed undef (in this model)
 
@NikiC and how does this guarantee help us anything in optimizing?
 
2:28 PM
@RajaSharma See what pastebin.com/B1uptFFj does for you, I can't see where you'd get stuff like dates and categories from but hopefully that should get you started
(or it might be totally wrong)
 
@bwoebi Only in that we don't have to check for undef. Nothing else. It doesn't matter for type info
 
@NikiC the generated code is unsetting them
 
@NikiC we already can do that, as long as we figure out that there is no potential unknown code/the holding variable never passed to outside between.
 
@Ocramius But the generated code for a typed property could (theoretically) simply not unset it? As it is uninitialized by default.
 
@NikiC no, because then I wouldn't be able to intercept any read to private/public state
basically, if public function foo() internally accesses any property, I must be able to initialize state during that business logic
 
2:30 PM
@bwoebi Note that "potential unknown code" means "is guaranteed to never generate notices etc" which is pretty problematic in PHP. 95% of our instructions have error conditions.
 
and this at every level of the inheritance too, which is tricky too
 
@NikiC stupid set_error_handler()
 
@Ocramius Not sure I understand. A typed property is basically "unset" by default, so an explicit unset() shouldn't be necessary?
 
@NikiC you can check gist.github.com/Ocramius/e4f481dd1d4f93adffb0646a780d1217 for a sample of generated code
@NikiC if the property doesn't exist post-__construct I don't need to initialize it, but __get and __isset must be triggered in that case
 
@bwoebi It's extremely stupid. Who the fuck thought it was a good idea to pass a symbol table to the error handler!??!?!?!?!
 
2:32 PM
I can try writing some functional tests around the current branch to see if the patch works for me atm
 
@Ocramius patch works atm for you, we're just deciding whether to go with the current behavior or not
 
@DaveRandom hahahahha thanks bro!
 
@NikiC a symbol table? wuh, wat?
 
@daveRandom il give it a try
 
@NikiC it is using __get for initial initialization. After which if it needs to update the field it uses reflection here github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/… /cc am I right @Ocramius
 
2:32 PM
@Ocramius So, just to clarify, do you ever unset() a property more than once?
 
usually only at the beginning
I know the ORM can reset some proxies, unsetting stuff again
 
"usually" or always?
hrm
 
I'd need to check
 
Okay, that part doesn't sound so good :D
 
basically that's like "please ignore everything, and make this object not-initialized again"
ok, gotta run, but I'll try compiling and writing tests while @ airport
 
2:34 PM
> User error handler must not modify error context.
Yeah, that guarantee is not good enough
 
If it weren't for that context, error handler would be much less of an issue
 
@NikiC Can you … deprecate it?
 
At least you could determine which objects clearly don't escape the method.
And similar for references
@Ocramius okay, thanks for the info
@bwoebi how would one even deprecate a parameter of a callback?
Maybe add an ini option to disable it
I imagine it's also a pretty big performance hit
 
@NikiC throw E_DEPRECATED if a cb with 5 args is passed
 
@bwoebi Problematic if you only proxy
 
2:38 PM
if they're using func_get_arg(5)… well, then they're out of luck
@NikiC uh, why?
 
@bwoebi because you're not actually using it ^^
 
@NikiC right… simple fix is removing the fifth argument?
and in proxy just pass [] an empty ctx or so
 
you may pass an empty array for compatibility, and remove it completely in Next.0
 
true
 
@DaveRandom lol
 
2:41 PM
@bwoebi I still have a deprecations rfc lying around that I totally forgot about ... maybe should include it and see if anyone complains
 
@PeeHaa So, it turns out that the reason we are having this issue is actually because I fixed something :-X
 
I can imagine that all those "fancy error page" packages actually use it though
 
"fixed"
 
@DaveRandom I'm going to find that thing I talked about this morning about another bot having connection issues
@DaveRandom hehehehe
What is it? :)
 
@NikiC bah, these users of fancy error pages also use xdebug or such things where we just can turn off our optimizations
 
2:43 PM
@PeeHaa Previously when a socket was disconnected it died with an unhandled exception. Now that exception is being handled, and the loop doesn't exit because there's still stuff left on it (I'm not actually sure what), so systemd never gets to restart it because the proc doesn't end
 
@NikiC great idea.
 
I'm almost done implementing reconnect stuff
 
@Gordon When I get home tonight
 
@DaveRandom then have a look at the remaining watchers? dump them or similar
 
Also thanks asshole (my guess is @DaveRandom) for putting my name as ping on the command list
 
2:45 PM
!!command list
 
Commands currently mapped:
 > - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 ? - Retrieves and displays search results from Google (Google # Search)
 @PeeHaa - Implements the Lickable interface (Lick # Lick)
 canon - Posts links to canonical resources on various subjects (Canonicals # canon)
 chuck - Posts a random Chuck Norris joke (ChuckSkeet # Chuck)
 docs - Searches the PHP manual and displays links with a summary of the result (PHPDocs # Search)
 eval - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 
I was utterly confused why I got a ping for that
 
hahaha
 
Anonymous
lol
 
!!@PeeHaa
 
2:45 PM
@bwoebi That's sticky.
 
Anonymous
!!@bwoebi
 
mhm… a sticky PeeHaa… :-D
 
Anonymous
!!lick @bwoebi
 
@samayo At least buy me a drink first.
 
!!command help
 
2:47 PM
Syntax: command [map|remap] <command> <plugin> [<endpoint>]
        command unmap <command>
        command alias <new command> <existing command>
        command list
 
Anonymous
🍺
 
!!command unmap @PeeHaa
 
Command '@PeeHaa' is no longer mapped
 
:)
 
!!command list
 
2:47 PM
Commands currently mapped:
 > - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 ? - Retrieves and displays search results from Google (Google # Search)
 canon - Posts links to canonical resources on various subjects (Canonicals # canon)
 chuck - Posts a random Chuck Norris joke (ChuckSkeet # Chuck)
 docs - Searches the PHP manual and displays links with a summary of the result (PHPDocs # Search)
 eval - Executes code snippets on 3v4l.org and displays the output (3v4l # Eval)
 
//i.imgur.com/Y2dXkOT.png ()
 
Anonymous
!!packagist samayo bulletproof
 
Goddamnit
 
@samayo Usage: !!packagist vendor package
 
2:48 PM
@Jeeves wtf?
 
[ samayo/bulletproof ] A simple and secure PHP image uploader
 
Anonymous
lol, I just noticed the tweet
 
Wes
@Wes specifically, which is better for 2+ instances? will the former use twice the memory?
 
@bwoebi I tried to fix the twitter command, but I just keep finding more edge cased crap :(
 
Wes
any help folks? :B
 
2:50 PM
I guess it won't matter #RandomGuessesFriday
 
@Wes no, there's no practical different because CoW semantics
 
Wes
@DaveRandom but doesn't the array get evaluated twice?
 
Anonymous
!!chuck
 
Chuck Norris knows the last digit of pi.
 
Wes
imho it's going to be a different array
 
2:52 PM
@Wes no
It's dealt with for you, it points to the same heap structure until you write to one of them
 
@PeeHaa yeah, you forgot to check against whether the message is truncated or not … also, it's without protocol prefix…
 
o/
 
is this possible in PHP
if(if(true)){

}
2
 
no
 
I hv tried but giving error..
 
2:54 PM
but why? -_-
 
@bwoebi Also twatter doesnt accept bare image url I need to actually upload them to twitter
 
just gave a try
 
but why?
 
@PeeHaa ugh, seriously?
 
curious
 
2:55 PM
Yeah :(
 
well, then have fun :-P
 
Wes
was doing it @nikita2206
 
:/ the JpGraph library does not seem to have the ability to stream to a resource or have a way for the caller to know if the image write succeed.
 

« first day (2050 days earlier)      last day (2902 days later) »