« first day (1126 days earlier)      last day (3827 days later) » 

12:14 AM
@webarto had some free time this afternoon: github.com/webarto/boostrap.php/pull/6
 
Already merged, awesome, that's the spirit :D
 
haha you are way ahead of me
I was looking through my older repos and found that gem :P
 
Thanks, appreciate it :)
 
Just trying to do what I can to help other PHP devs make their apps better, ya know?
everyone could use more eval
 
Quick question, new to php. When using the __constructor. All the tutorials use $this->example = $example .
My question is is "$this" in everyone or just the example i saw
Is $this important?
 
12:18 AM
@jack $this is a reference to the current class you are within.
 
ooooh
 
$this->methodName(), $this->variableName, etc.
 
So it's basically just example = $example and the $this is just saying in this class.
 
It's day before weekend, it's day before weekend...
 
@sectus Yes it is!
 
12:26 AM
@Leng Does every class need a construct? All the time?
 
@jack No. Only if you need to do something upon class creation.
 
So in that example did you need to do that on class creation. Surely not. Only when you need to call it.
 
Yes, it needed the constructor.
Otherwise we would have had to do this...
 
@jack also, the method signature is __construct, but the concept is called a "constructor" rather than "construct"
 
This would be the same as INIT from python yes?
almost anyway
 
12:28 AM
basically yeah
same concept
it's the method that's called on object creation
 
And it's the way you accept paramaters as a form of object initialization
 
if you want the class to have parameters when instantiating it, then yes
 
Hello
hello. . .
 
Hellooooo
 
Can I ask a question here?
Or it is for chat purposes only?
 
Ah ok thanks for the reminders.
Because I exceeded my questions today. :)
 
You can ask, doesn't mean anyone has to answer :)
 
@RochelleCanale usually, a bad sign
 
12:52 AM
What a bad sign?
 
1:19 AM
lol
 
user1642018
2:00 AM
0
Q: php curl_getinfo multithreading how to?

Ambrose BwangattoI have millions of remote files urls in a text file, i have taken them in a an array. I am trying to get filesizes only of those files. and dont want to download files. I did normal curl query in foreach loop but its taking too long as its single threaded , so how can i use the curl in multithr...

 
user1642018
help needed., thanks
 
user1642018
err i just did Chatroom Don'ts , sorry for that.
 
3:06 AM
Good morning Everyone
 
user1642018
3:21 AM
@webarto thanks, looking in to it.
 
@ircmaxell I had a discussion with bwoebi and NikiC the other day about what PHP would be like without references. If we changed arrays to act more like objects instead of values then the major use-case for references just disappeared. The only other use-case I can think of that isn't easily supported by other constructs would be closures.
$i = 0;
$closure = function () use (&$i) {
    return $i++;
};
This one is trivial to make a class for, but would you WANT to write a class for it? Probably not.
I think I'd actually prefer the reference-less version of PHP.
 
4:17 AM
@LeviMorrison that's just changing the reference to be something else
also, if closures worked as real closures instead of variable copying, you wouldn't need references there
 
@ircmaxell Not exactly.
 
@LeviMorrison I know not exactly, but it sort-of is
 
Right, but it's important to someone like me ^^
 
I know :-P
 
@ircmaxell Agreed.
At this point we'll probably get neither :(
 
4:20 AM
nope
 
I keep thinking one day I'll make a language that takes the bits of PHP I like but leaves out the parts I don't.
Except
Every time I do that I think, why don't I just use some other existing language?
Like Dart for instance.
 
4:43 AM
Morning
 
It's morning, morning...
 
0
Q: How can i write a SubQuery in SELECT statement that would be dependent on the first column?

ScoRpionIs there a way I can write this Query in a way to get the result of my sub query compared with my category_id. SELECT category_id, count(id) as TOTAL COUNT, (select count(*) from products where product_path LIKE '%Electronics%' and category_id = category_id ) as ELECTRONIC COUNT FROM products ...

 
5:06 AM
I use an e-mail verifcation method and in the end users can activate by going something like: activate&user=blah&token=blahblah. However both user and token are inside the database. Is it enough security if I use PDO to bind the param? Or should I actually make sure that token is all numbers and user does not contain any special characters.
 
PDO is enough for it
 
Ah thank you. Just wanted to make sure thank you.
 
5:43 AM
Hey guys , I know i should use framework or something if i want to create startup because that will help develop product faster, But other partner said,
Tomorrow another thing will comeup and u may have thought that I should use this framework because this provides some more features etc etc
CORE PHP will never change.
Can you guys tell if this is always the case.
 
PHP is not going to be outdated just about yet.
 
Hi every one
 
@railsbox Hello
 
i require your help
 
@AshwinMukhija I wasn't saying about php being outdated.
 
5:46 AM
@AbhishekGahlot Good frameworks don't get outdated either.
 
user652649
roarning
 
@Ashwin i want to know how to extract pdf data and insert into mysql
 
Frameworks like Wordpress on the other hand
 
@Ashwin i am using core php
 
@AbhishekGahlot Don't ping random people with questions. If they are available, they will answer.
 
5:48 AM
@Ashwin checking
 
@AshwinMukhija I am not new on stack, I know the rules. He i good in these type of things.
 
@AbhishekGahlot What is your startup about?
 
Assume it as training product for companies.
 
E-learning?
 
Something like that.
 
5:52 AM
Okay, so e-learning platforms for corporate trainings don't work well in India.
I'm speaking from experience
They would much rather want live in-office trainers.
 
Yeah, i wasn't expecting that. But in US or Europe ,its used by companies for training.
 
Yes, but Europe and US hardly consider Indian trainers to be up to their standards.
 
In this case its not trainers. I am providing quizzes, training products or surveys for employees, students.
 
Okay.
 
Frankly speaking,I am not in favour of using corephp because startup is like a risk. If you loose it you know what i mean.
 
6:01 AM
You want to use PHP frameworks?
 
Yeah why not, Kohana,laravel or may be code igniter.
 
Don't use CI
Laravel or Symfony
 
Laravel is bit of symphony plus elegant features thats why its always a good choice.
 
Ram
6:16 AM
0
Q: how to get a specific data from json/jsonp result?

RamI have a json response from an Weather API. I want to get a particular property's data, here is the response: { "response": { "version": "0.1", "termsofService": "http://www.wunderground.com/weather/api/d/terms.html", "features": { "forecast": 1 } }, "forecast": { "txt_forecast": { "date": "2:00...

please help me
 
user652649
6:32 AM
 
user652649
 
Friday morning.
 
@Leri I've thought about measuring memory :p and yesterday I've ended with this stackoverflow.com/questions/19973037/…
we even found bug in PHP when doing that
 
@AlmaDo Nice. +1 However, has one drawback too much statics. I have not researched mem-benchmarking so not sure if results are same for instances.
@AlmaDo What bug?
 
@Leri I've mentioned that bug in answer
 
6:44 AM
Have not finished reading yet, still looking at the class.
 
@Leri yes, you're right - it will not be same (counted till byte) - but the difference may be very little
so all you need is to benchmark several times - is you're not sure.
 
If we had function autoloading \Benchmark or \Php\Benchmark could be cool namespace.
Well static class will work fine atm.
 
@Leri I'm thinking about creating github project for that (add existing time measurement function and some other ideas)
that's because it's portable and context-independent
so you can use it everywhere
 
@AlmaDo Nice idea. I'd suggest making that class final and have private constructor because it will be nothing more than utility. It would be nice to have instances but that will mess up results for few things, I guess.
 
@Leri I'll test. I want to get rid of static methods
but for memory... it's hard to predict what will happen
 
6:51 AM
There won't/shouldn't be differences for performance benchmarks. And I was about to write that. ^^
 
he-he :p
 
I guess, you'd better consult with internals.
 
@Leri so I did
@bwoebi told me about ticks
 
Ok, off to real work. I am gonna have awful Friday.
Later
 
:)
 
7:09 AM
Good mornins
 
hi, @iroegbu
 
moin
 
7:28 AM
morning, @JoeWatkins
 
Good morning guess what @JoeWatkins !!
 
7:53 AM
@Duikboot
W00000000T
right ?
 
ffrr....
 
IDAY
 
yiha!
 
yay for Friday!
 
w00t
 
7:55 AM
I wish I could friggin' sleep but I'm too excited
 
@JoeWatkins are you around?
 
8:19 AM
Hello All
is anybody here
??
 
@Alma kinda, wazzup ?
@UnknownDeveloper nobody knows
 
:d
I need help
 
/me often thinks about telling new people that "I know their secret", just to fuck with them ...
 
about the Paypal Notification URL
 
ask the question, if we like it, and we know the answer, we'll tell you ...
 
8:22 AM
@JoeWatkins can you check this class, method benchmarkMemory() and tell - if it safe to use it in many class instances? My doubt is because I'm declaring ticks, registering/unregistring function e t.c. - i.e. reset that each time
 
when i enable the IPN notification ULR
paypal send me a mail
like
 
hello guys
 
@AlmaDo duuude, know what happens when you use ticks ??
 
did you all know what this doit
COALESCE
 
Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:

index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component
index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component
 
8:23 AM
something like
 
@JoeWatkins not exactly. So I'm asking you :p
 
COALESCE(SIGN(CAST(s.timemarked as SIGNED) + SIGN(CAST(s.timemarked as SIGNED) - CAST(s.timemodified as SIGNED))), 0) AS status ';
 
@JoeWatkins is it bad?
 
wht the different between
COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';
 
8:24 AM
see how many times you spot ZEND_TICKS
 
@JoeWatkins huh.. 1 time? and.. ?
 
hello...
 
expand classes
benchmarkMemory, every few opcodes ZEND_TICKS
 
yes, I see. But that's the sense of ticks.. no?
 
you are taking measurements ... think about it ...
they mean absolutely nothing, you are measuring opcodes that you will never execute outside of your test
 
8:27 AM
yes, I do. And how else can I traverse code structure and find maximum space usage if not with this?
 
a profiler ?
 
@JoeWatkins um.. not sure I got that. You mean that I'm measuring... ticks?
 
there's no good way to get data that you can rely on by completely changing your executed instructions ... you need to obtain it otherwise, hperf or maybe xdebug has something, or there is a profiler on my github, or look for some other solution ...
but the numbers you get from this don't measure anything that is relevant ...
 
@JoeWatkins hm.. well, why then that data looks so realistic?
 
because you are used to it :)
school run, back in 20
 
8:31 AM
i.e. str_repeat('test', 1E4) is ten times expensive than str_repeat('test', 1E3)
well, I'll wait - I'm not sure I understood you
 
user1642018
0
Q: php curl multithreading not working , why so?

Ambrose BwangattoI am trying to get the size of millions of png files, remote urls using curl in loop, but its not speeding up as i increase the threads count. <?php ini_set("memory_limit","-1"); ini_set('max_execution_time', '-1'); //number of concurrent threads $threads = 200; $allimages=file_get_contents('...

 
user1642018
help needed.
 
Good Morning
 
user1642018
@ThomasWeinert Good Morning
 
omfgofdmg
 
8:45 AM
@ircmaxell saw your video on G+. Are you currently in the Munich Area or is it just a recent video?
 
8:57 AM
moinz
 
Good moaning.
 
@Alma I assumed you are looking for cpu and memory figures, the speed numbers might make sense, they are proportional, but there's no way for you to measure accurately the memory usage because it is polluted by ZEND_TICKS, also, on the bench, there may not be a difference but when php is serving up a deployed service things are much different, try running 10's of thousands of iterations rather than one ...
 
@JoeWatkins no-no-no... there's no sense for me to measure time/memory accurate. I want to do: measure function X, then measure function Y, then say: 'function X is Z% faster/slower than function Y and function X takes W% more/less memory than function Y'
 
@JoeWatkins phpdbg.com 0.0.1 live today :)
 
@Alma that makes some sense ... change the class to register the method directly rather than with call_user_func ... and then yes, it should be safe (it might be safe now, but I don't like it) ...
@webarto yep :) waiting for Felipe to get up ... he's gonna tag it ...
 
9:09 AM
@JoeWatkins I can not do that
I don't like this, but it's the only way
 
cannot do what ?
 
@JoeWatkins I can not register callback directly because of this bug (I've found this when creating this class, and @bwoebi posted it). Problem is: if I'll use anything but string, I'll not be able to un-register it because unregister_tick_function() expects string as parameter. So I can't use method or closure directly
 
you know memory_get_usage doesn't actually tell you anything useful, the amount of memory allocated is only loosely related to the amount being used, looking at the class again I'm not sure why you use ticks at all, if you just want to measure the memory used by a function then why notmeasure before and after, why tick at all ?
 
@JoeWatkins because if I'll do so, I'll never be able to discover real maximum memory usage
@JoeWatkins
function foo()
{
   $mem = memory_get_usage();
   $result = str_repeat('test', 1E5);
   var_dump(memory_get_usage() - $mem);//400068
}
$mem = memory_get_usage();
foo();
var_dump(memory_get_usage() - $mem); //100
see?
 
Hello
 
9:15 AM
at outer scope I'll never be able to see how much memory foo() will use
 
Merry Friday
 
hi, @Fabien @Franck
 
happy cordonbleu people
 
@Alma I see ...still you could program a way to get the inclusive figure if that is what you require without using ticks ... since the numbers aren't really accurate anyway what you have is probably fine for your needs ...
usually when we look at the performance of things, we do it from outside the application ... I really would use a profiler if you are actually product testing and this is not part of some application
 
@JoeWatkins fair enough
 
9:24 AM
 
SEXY
gimme gimme
 
@webarto huh... pink? o_O
 
don't listen to him, we loooove purple ...
 
no.. violet :p
 
purple?
 
9:25 AM
see php.net
almost every thing is purple ...
it's sexy, I like it ...
 
@JoeWatkins it's white & black
 
#9955BB; /* Deep lilac */
So you can say... man, that's deeeeeep.
Mauveine, also known as aniline purple and Perkin's mauve, was the first synthetic organic chemical dye, discovered serendipitously in 1856. Its chemical name is 3-amino-2,±9-dimethyl-5-phenyl-7-(p-tolylamino)phenazinium acetate. Chemistry Mauveine is a mixture of four, related aromatic compounds differing in number and placement of methyl groups. Its organic synthesis involves dissolving aniline, p-toluidine, and o-toluidine in sulfuric acid and water in a roughly 1:1:2 ratio, then adding potassium dichromate. Mauveine A (C26H23N4+X−) incorporates 2 molecules of aniline, one of p-t...
 
urm
 
Yo dawg, that 3-amino-2,±9-dimethyl-5-phenyl-7-(p-tolylamino)phenazinium acetate color looks noice.
 
is that not purple ?
 
9:27 AM
Yeah :D
 
someone said to me yesterday that something that was definitely white on my screen was pink on theirs ...
oh good ... fucked with me for a minute ...
 
On my screen, it depends on angle... but hex doesn't lie.
 
Mornings
 
hi, @DaveRandom
 
@DaveRandom moin
ah angle
yes that's it ..
I remember when light coming from a screen didn't discriminate based on angle ... happier times ...
 
9:29 AM
Also, mac? :(
 
who's Mac ?
 
the site header.
 
I wanted to buy Eizo monitor, but I'm poor now.
 
phpdbg?
Proper debugger?
 
9:31 AM
ooh ooooh it's a mac ...
@AshwinMukhija in the making, yes ...
 
I have Asus N76, so will blame on similarity.
 
@JoeWatkins Nice
 
oh, then panic over ... it's not a mac, everything fine ...
 
:D
 
Forgiven
 
9:33 AM
@JoeWatkins Not for windows?
 
Really good laptop, N76, it was about $1400 which is cheaper than Mac I think. (Maybe not in US and A)
 
@AshwinMukhija not yet, php requires patching, submitted a patch ...
yes, it works on windows, but you have to patch php, I'd rather not put that out there ... just wait a while ...
 
@JoeWatkins This should be much much better than xdebug
I hate writing SOPs
 
xdebug has it's uses ... I don't expect this will replace it ...
@webarto any chance of getting phpdbg.com online today in time for twittering about release ? is there anything I can do (except look pretty, of course ... which I do ... all the time ...) ??
 
9:37 AM
Expected release version?
5.6?
5.7?
 
I don't intend to RFC this, if you want it in php then shout and scream, I'm out of energy for arguments, just want to write code ... k thnx
 
But you can launch it as an extension
 
no, you can't
 
Wait, so phpize won't work on this?
 
no, this requires internal apis not exported, it must be compiled against source, when the API's are supported, it still won't work with phpize but might be worth persuing at that point ...
right now phpize isn't meant to work on sapi modules
 
9:41 AM
@JoeWatkins It would be nice if you could just describe "features" a bit so it can sit in frontpage, I'll put some more on front, and need to finish footer (shouldn't take more than an hour), aaaaaand documentation, I have that done, just to setup DB, and paste in your markdown tut.
How much time do I have?
 
@webarto your schedule, not bothered ... let me know when we're close ... and wicked cool by the way, THANKS :D
 
@JoeWatkins the two dozen kindergarden kids in the subway today definitely loved purple. one of them spotted something purple outside and would yell puuuuurrrrppllleeeeee. the other kids looked and another chimed in, then another and another until all of them would yell purrrplleee purpleee puurrrplleeeee purpleee. was hilarious
 
lol
can you imagine a bunch of adults doing that ... I miss the freedom :D
 
the kindergarden teacher told them to be quiet after a while because its a subway. when they ceased yelling I was so much tempted to yell purple myself ^^
 
you should have done it ... you will regret it forever !!
 
9:45 AM
haha, yeah. probably
 
bike crash this morning, it hurt, ok though
 
Anyone could help me with Yii Routing? I'm having a problem with getting my routing to work on a form action
 
oh no @Jimbo ... hows the bike ?
:D
 
Stupidly loud now, think the exhaust system (the newish, £400 one) is damaged. Crash bung saved the fairing, bent levers / indicators... probably £300 damage
 
I have to dissect Whois information. Is Whois information consistent? Like I need to grab an abuse contact if there's one, emails etc, privacy people. Does the position/name of that information stay the same throughout whois info?
 
9:53 AM
^ ie - can it be parsed reliably :)
 
I want to include the external php class to the symfony 2.3
Is there any good guide
 
Thank you @Jimbo :p
 
@Fabien Pear has one
 
All stack and other blogs posts are looks expired, may be for old version of symfony
 
Parsers for Whois are available, so would suggest so
 
9:55 AM
There's also this on github
 
PURPLE, MOTHEF*! :D
 
@Jimbo Aye same I was looking at thanks
I guess this is enough to go on.
 
@Jimbo Insured?
 
@webarto Yeah, but 400 compulsory excess :(
 
:(
What matters is that you're OK.
 
10:01 AM
@webarto font size is unrealistic!
 
0
Q: Yii routing on form action

Dark AshelinI have a problem where, when submitting my form, it seems to ignore my routing and redirects me to the Home instead. In my main.php routing: '<language\w+>/profile/<slug:[\w\-]+>' => 'profile/index', '<language\w+>/<action:\w+>' => 'site/index', My form: <form action="<?php echo ...

 
@Jimbo yeah I kid, glad you're okay ...
I ride 2 stroke 125's in summer ... every time you go out you take your life in your hands, not one single person is looking for bikes ... bet it was someone else's fault ...
 
wth did just happen with meta-SO layout (topbar)?! that looks awful.
Problem: it's black :-(
 
I wonder.. only SO has meta?
 
MGE
Hello
I have a question
 
10:14 AM
@AlmaDo every SE site has a meta subdomain?
 
MGE
if you have an array, similar to this
 
@bwoebi btw, I've ended with this :p
 
MGE
Array ( [0] => Array ( [id] => 5128335 [0] => 5128335 [elementid] => 6dbc258 [1] => 6dbc258 [user] => mikel [2] => mikel [userid] => 1 [3] => 1 [timestamp] => 1384358987 [4] => 1384358987 [type] => 2 [5] => 2 ) [1] => Array ( [id] => 5093751 [0] => 5093751 [elementid] => b0de5b5 [1] => b0de5b5 [user] => mikel [2] => mikel [userid] => 1 [3] => 1 [timestamp] => 1383049399 [4] => 1383049399 [type] => 1 [5] => 1 )
and I want to take an array with only elementid fields?
any command or I have to create a new array with foreach
 
@MGE
11
A: How can I get the array of a single type from a multi dimensional array (without a loop)

Alma DoIn PHP 5.5: $rgResult = array_column($foo, 'clientId'); in PHP <=5.5: $rgResult = array_map(function($rgItem) { return $rgItem['clientId']; }, $foo); (put <= since this, of cause, will work in 5.5 too)

 
@bwoebi Says bwoebi in virtual chat room :P
 
10:18 AM
So I configured browscap
it appears to be working for other people but not me?
lolwut?
 
MGE
nice
@AlmaDo thanks
 
@AlmaDo nice :-)
0
A: The new top bar is out on meta. Consider it a beta

bwoebiThe box on OS X is broken: On OS X scrollbars are configurable that way that they only appear when one is scrolling, so the widths of text and the white background don't fit. (Newest firefox, OS X.)

brml…
 
Thanks @bwoebi
 
thanks to what?
 
Unrealistic font remark.
Forgot to write thanks.
I'm polite, just like that.
 
10:27 AM
@webarto is the features bit in readme.md not enough, what sort of thing are we looking for words, phrases/sentences or what ?
 
@webarto ah ok :-D
 
w3b
hi
 
@JoeWatkins If you could just expand a bit, sentence or two, like Stepthrough Debugging followed with one sentence etc, not necessary at the moment, will add it later. Let's just get this rolling for today.
 
w3b
have anyone integrated bankslip payment gateway?
Boleto Bancario - bankslip
 
10:39 AM
@webarto kk will get to thinking
 
Don't bother now, I'm jobless, got some extra time :P
 
10:55 AM
You're "exploring your options".
 

« first day (1126 days earlier)      last day (3827 days later) »