« first day (1647 days earlier)      last day (3287 days later) » 

12:05 AM
@JacobGray I've enjoyed using PHP ever since v5.5 (Generators FTW!). I'm especially looking forward to the performance and type declaration improvements in PHP 7.
 
12:53 AM
i personally love php, i recognize there is a lot of hate on it tho. does anyone use hhvm with their php now? it seems like the way of the future, and im especially interested in where hack will lead to (perhaps php7 will reduce a need for hack as long as used in conjuction with hhvm?)
 
Hack was premature. In my opinion Facebook really gave up on PHP-core way too early.
 
agreed it would make much more sense to just incorporate the desires of hack into php7 etc
personally im holding off on hack, but im really excited about hhvm and plan on using it soon
 
I haven't done much compared to some but if I can contribute what I have, surely Facebook could have done a lot more for PHP-core and the whole world would be better off for it.
 
why do you think they didnt though? do you think it was a developer mindset of "oh lets build the next big thing", or (what i think), "we can't rely on the php internal community to implement what we think are better choices"
 
It's because they ultimately cared more about moving quickly and without relying on some third party.
And to clarify, I'm totally okay with HHVM.
Hack just kind of pisses me off. They also claimed to be open but they have not made a single decision with the community with Hack in the open.
And it's been very hard to contribute anything aside from bug fixes and feature parity.
 
1:10 AM
"they ultimately cared more about moving quickly" - The long term support for HHVM is my favourite bit of the project. If you use the most up-to-date release it's 'long term support' lasts until 28 Jan 2016.
 
I'm talking about Hack, not HHVM.
Also, this issue really pissed me off: github.com/facebook/hhvm/issues/2542
"Nah, screw normal constructors. Gotta use our new syntax"
 
yeah you know thats whats keeping me from jumping on the hack wagon. it just makes more sense to innovate the php core. but how do you feel about the state of the php community? do you think its headed into a direction of speed and optimization?
lol yeah it just doesnt make sennse to have this hack php schism now that i think of it
 
@RobMullins Given that 29 of the 45 proposals that made it into PHP 7 were authored/coauthored by people from this room... :)
It takes time and we're not perfect but I think we're making progress.
Hack is primarily focused on security and finding errors in code before running it. In PHP 7 we add scalar types and return types, which go a long way on this front.
 
honestly i think thats what i look forward to the most, strict data types with hhvm is really all the speed i think i could want. granted, i learn more and more everyday
 
1:39 AM
@Andrea no clue, but I usually cache the bound instances anyway, so there shouldn't bea big difference.
 
@Ocramius I was going to suggest Vodafone - I thought they have a plan that is usable across Europe, but a quick googling couldn't find it, and instead just showed some hilariously bad 'data traveller' packs .e.g 15MB for £5.
 
23.03
 
1:56 AM
Any hockey fans around here? Can I even talk about it ? :)
 
 
2 hours later…
3:31 AM
Is there any reliable way to delete either entity from M:N relation in doctrine without cleaning up a joint table?
by default it cascades deletions, which is not what I need
 
 
2 hours later…
6:03 AM
@LeviMorrison What's the reason to have that ->ordinal method for enums?
 
@kelunik EnumClass::values()[$myEnum->ordinal()] - exporting and importing the value.
 
@bwoebi If that's the case, ->toString() would be enough.
 
@kelunik __toString() is called under some circumstances where it's not really useful to enums
@LeviMorrison Hard to tell… I already know everything (or I imagine so) about the RFC… rather ask somebody who doesn't know anything and listen to his questions… and name() method is still there…
 
@bwoebi Where?
I just can't see a real value there, rather the abuse to rely on that value.
 
Oh hi @kelunik
 
6:10 AM
@BenjaminGruenbaum morning
 
Mornin, how are your projects with event driven PHP coming along?
 
@kelunik Usually __toString() forces a string to be returned and only may be called when asked for a string.
 
I'm still waiting for @rdlowrey to finish the new aerys branch using amp@1.0.0-dev
 
Internal classes can handle that differently, but I'm not sure if it's worth it.
Also I'd rather have accidental uses of an enum error than just magically returning an int…
@kelunik you'd loose every typesafety with cast_object handler.
If you pass an object with a cast_object handler to an argument requiring int, it'll just work.
 
->name or ->getName would be fine, too.
 
6:20 AM
Why the fuck are all these people suggesting singletons here? stackoverflow.com/q/29740389/1348195
 
The problem with name/getName is that you can't just simply isset(MyEnum::$constName) … this is a static property, not a class const
uh… well, defined() and constant() will work… but yeah… it gets kind-of hacky.
 
@bwoebi And MyEnum::$$constName would work if it's really a property.
 
// That's going to look like
if (defined(MyEnum::class."::$const")) {
    $enumval = constant(MyEnum::class."::$const");
}

// that's not nice code…
 
But how's that related to name/getName?
 
@kelunik not sure what you mean? I just explained why we can't replace ordinal() by name()?
 
6:33 AM
No, because you wanted to access these things by name, not by it's ordinal value.
 
@kelunik If you want to access them you just access the constant? If you want to access dynamically… that's what ordinal() is for.
 
Hi all
i have issue with shell_exec() its will intermittent unable to execute
appreciate if anyone can help
 
6:51 AM
Hi
I have a table column of varchar datatype in MySQL database called price which store some money value like 23.000 657,000 etc Could I select these values with php asc and how?
 
moin
 
good afternoon
 
@JavaFan why would you store price as varchar? ...
 
good afternoon
 
hi all
 
7:00 AM
If I store them as numeric they stored as 38.000 instead of 38,000 for example
@loading Second reason I used JDBC to insert into my table
and I would fail if the datatype is numeric
 
@JavaFan and now it fails because it's not numeric
good job
you format it when you show it to the user, not when you store the data
 
how?
 
this my code:
$rrd = "c:\\MetoceanStation\\Buffer\\".$rrdname.".rrd";
$rrdtool ="c:\\MetoceanStation\\bin\\rrdtool.exe";explode ("\n", shell_exec ( $rrdtool . " lastupdate " .$rrd ));
 
19
Q: What MySQL type is most suitable for "price" column?

Misha MoroshkoI have a price column in products table. I wonder which MySQL type is the most suitable for this column. Is it DECIMAL, FLOAT, or something else ? The price can be for example: 139.99, 40, 14.5 (2 digits after the decimal point, like in shops). Please advise.

 
morning
I have decided to start blogging (I hope my content will be a bit better than sh*t). Do you guys know any good template for WP technical blog?
 
7:07 AM
@Patrick no answer
 
@JavaFan what?
 
Is that question answered?
 
good mornigns
 
@JavaFan yes. :-)
 
3
Q: How to disable cascade deletion for many-to-many relations?

zerkmsFor a Many-to-Many relations (say Groups and Users) the rows from the joint table are automatically removed as soon as either of the entities is deleted, like the cascade remove attribute was set for the relation. So basically I want to delete it IF ONLY IT IS EMPTY. So the solution must guarante...

Any doctrine gurus around?
 
7:11 AM
@zerkms Sorry it was answered, there was a problem in my browser
 
@JavaFan ?
 
@zerkms they stored and showed as x.000 instead of x,000
 
@zerkms Is not checking before deletion and locking that part (because of race condition) acceptable there?
 
@Leri well, locking is a solution indeed, but it's ugly
 
although the data type is decimal
 
7:17 AM
@zerkms Not sure what you actually have there but in an async environment errors/exceptions are the least thing I'd like to have.
 
morning
 
morning @MarcelBurkhard
 
@Patrick how's the book doing? ^^
 
@Leri why?
 
hi @JavaFan
 
7:18 AM
 
Hi friend
 
Constraints is a natural mechanism of DB, why to not use them.
 
@MarcelBurkhard only a few pages written...
 
@zerkms Well, in C# it's pita, makes my code ugly with try/catch/finally, application flow become unnatural, etc.
 
@Patrick steter Tropfen höhlt den Stein
 
7:19 AM
@Leri you cannot omit it anyway
you have to handle it regardless if you use it or not
not to mention locks are always slower
 
@zerkms Agreed, about locks being slow. My point here was that exceptions should not be a part of flow.
 
Well, you cannot omit it
 
@MarcelBurkhard As long as you have any motivation at all… ;-D
 
Exceptions is the only mechanism to deliver information about constraint violation
 
Sure, but all I am saying that constraint violation should not happen. It's always nice to have exception thrown for the sake of safety, however, it should not. This means you either have to check before deletion, or should not display deletion option in the first place.
 
7:23 AM
"constraint violation should not happen" --- you cannot guarantee that
 
@Patrick I understand 43,000 and 43.000 are same in php
 
if you need to solve something with lock - you're doing it wrong
>or should not display deletion option in the first place.
how about race conditions?
 
good mornings :)
 
mornings
 
@zerkms Sounds like you don't like awaiting things :-) Seriously, if your main concern there is performance, I totally agree with you. Handling error from dbms is the only solution.
 
7:26 AM
@Leri I just prefer exceptions to deadlocks
the former are predictable, the latter are not
 
If you have deadlocks, you're locking wrong?
 
sure :-)
 
I meant no offense. :-) I have never written async code in php
 
Well, it's not about "use the same order", it's about the whole idea: if you ever get deadlock - it's harder to debug it
 
7:28 AM
well, to debug something that is hard to reproduce is always harder than not debug anything
@Leri but the thing is that most likely will go with locks, since the other alternatives (at least the known one) are even dirtier
 
:-) parallel programming sucks is really hard.
 
@Leri oh, now I know another solution
@Leri to limit database connections number to 1
 
hello friends !!!!!
 
no concurrency -> no problems
 
How to make REST API more secure???
 
7:33 AM
@droid_dev don't publish it!
 
@zerkms Nice solution. But don't forget to have solid backlog.
 
Great Answer @zerkms
 
good morning
 
:D
 
I need to add www to a URL if it is not there in php can anyone help me ???
 
7:33 AM
@droid_dev well, it's ideal for the question asked I think
 
@Jaspal google is your friend
 
I don't think so. @zerkms
 
i have but didnt get what i want .. @patrick
 
@droid_dev the question has no details
@droid_dev "more secure" compared to what?
more secure than FB API?
 
I am using API in android and its made in PHP, want to make secure so that it cant be hacked or difficult to hack @zerkms
 
7:35 AM
@droid_dev Use ssl and have your own encryption as well, where AES keys are exchanged crypted (with RSA) and all the data goes through ssl already crypted. That adds extra layer of security. And I am just kidding. :-)
 
@droid_dev don't write stupid insecure code
that always works for me
 
@Jaspal so what have you tried so far?
 
so many of the people suggest string replace but i know little about regex and i think that's the better approach but don't know how to write a regex. @Patrick
 
@Jaspal that's sad!
 
@Jaspal so you don't know how to write regex. Any idea how that problem can be solved?
 
7:40 AM
yeah i just want to write a regex which replaces the string which do not contain www . like if url is "http://test.com" then i want it to be "http://www.test.com"
just want to write preg_replace function for this @Patrick
 
@Jaspal then do that... If you always ask other people for a copy paste solution then you'll never learn
 
7:58 AM
@zerkms How? I am not getting you.
 
@droid_dev well, if you asked a particular question we could give a more particular answer
 
We are creating api that has payment information in one of the api so we want to make sure our api is secure that none can hack it. API are used in mobile application like android/iOS and its built using PHP framework codeigniter
 
Morning
 
Morning
 
@droid_dev so write it secure! (this answer is as detailed as your question)
 
8:04 AM
Morning guys
$doc = new DomDocument("1.0", "UTF-8");
$dom->formatOutput =false;
Would this cause a fatal error? ^
 
yes
 
Or throw a warning and continue?
 
fatal
 
Alright, thanks
 
(I guessed)
 
8:05 AM
-.-
 
PHP Warning: Creating default object from empty value
warning
:-S
 
crap.
 
php forgives anything
 
hello!
 
8:07 AM
can I use str_replace to replace <p> tags with a \n
 
If it were a fatal, that would have made my life a lot easier (because it would have proven that this code is not being used)
 
this creates an empty string

$messagetext1 = str_replace($messagetext, "dave", "\n");
var_dump($messagetext1);
not entirely empty, there is a new line character
 
@zerkms it forgives… but it still tells you.
 
@FunBeans using a DOM parser will likely give you better results.
 
@zerkms if you have a problem with it… throw an exception from error handler
 
8:09 AM
@bwoebi I always do indeed
my every script starts with setting error handler to throw exceptions
 
^^
 
Brb just sneaking out Aurex - Silex micro-framework merged with the equally awesome Auryn dependency injector: https://github.com/J7mbo/Aurex #php
Right, now give me a bloody free PHPStorm license :P
 
Can I tell phpstorm to open multiple projects in the same window somehow?
 
@PeeHaa No it's new window or otherwise, I had to get my head around that when switching from Netbeans
 
Goddamnit
 
8:13 AM
Nah it's alright, you get used to it
 
Agreed, small sacrifice.
 
@PeeHaa you technically can add directories from different projects into the same project
it would be what you ask at some degree
 
@zerkms Does that have any drawbacks?
 
@PeeHaa it offers you that when you open a new project (unless you checked "never ask me again"
 
well, bigger search index
 
8:17 AM
@Jimbo you don't have a php.net wiki account?
 
potentially using more memory and slower
 
Hi my server has just started throwing this error message. php_network_getaddresses: getaddrinfo failed: Name or service not known;
 
@FlorianMargaine Noep, should I?
 
@Jimbo well, if you did, you'd have a free phpstorm license :P
 
@FlorianMargaine Nope it does not :( Only options presented to me were: 1) this window (meaning the current project is burninated) or 2) new window (meaning I have several phpstorm inwodws open :()
 
8:17 AM
Can any one tell me how to check the linux command line to see if my DNS is resolving (i think thats what i need to do from posts)
 
@PeeHaa ah
right, current project is burninated
 
thanks @SecondRikudo
 
@FlorianMargaine I need one. :P
 
@PeeHaa Hope this error isnt the firewall stuff coming back lol
 
@StephenWolfe You are asking whether your machine can resolve addresses?
 
8:20 AM
@SecondRikudo can I ask why, though? I figured out what was wrong with my example code, but look at this new code, what's wrong with doing it this way?

$messagehtml = $data->messageWithSigAndAttach;
$messagetext = $data->messageWithSigAndAttach;
//replace br's with \n's
$messagetext = str_replace("<br />", "\n", $messagetext);
$messagetext = str_replace("<br>", "\n", $messagetext);
// and p's
$messagetext = str_replace("<p>", "", $messagetext);
$messagetext = str_replace("</p>", "\n\n", $messagetext);
 
morning
 
Is there some list I have to follow to setup useful stuff for phpstorm? I am going to give it one last try
 
what about haikuOS?
 
@PeeHaa yes, i have tried ping www.google.com nothing came back
 
@PeeHaa default is fine
 
8:21 AM
k
 
If you develop with symfony - install symfony plugin
 
@StephenWolfe At least something has to come back as output
 
@PeeHaa just says unknown host.
 
apart of that no plugins are essential
 
k
 
8:22 AM
@PeeHaa I think the correct command was "ping www.google.com"
@PeeHaa from my reading it says it could be the dns settings.
 
Can you ping 8.8.8.8?
 
lolwut
 
@PeeHaa says operation not permitted
 
Contact your sysadmin
 
@PeeHaa offline :(
 
8:25 AM
@FunBeans <br/> < br > <br />
Are all valid
And your code will fail with them
 
@Patrick I'll read it at home :)
 
@SecondRikudo the text I'm getting is created by a plugin that will only output <br /> though weirdly if you view source it claims its using <br> so I did both for good measure. But noted. I understand the reasoning, I was just wondering if there was anything about this case in particular.
 
@FunBeans your case leaves you open to silent and undocumented breakage in the future.
 
Morning everybody
 
DOM parser doesn't take that much, and will ensure it to still work regardless of format.
 
8:30 AM
thats at least 2 developers down the line's problem. :) JK this is about the 3rd time I've been told to learn about dom/html/xml parsers so I'm gonna do it right this time.
is there an 'official' dom/html parser I should use for PHP?
 
use any that works for you
 
posted on April 20, 2015 by kbironneau

/* by Rafael Lopes */

 
Does anyone know what are good strategies for handling longer back-end requests. Let's say requests that take 20-30 seconds because of database operations?
 
Good morning
 
8:35 AM
Is it possible to start a separate thread that runs on the back-end and at the same time just finish the current request returning 200 OK, and then when the thread is finished just send an indication to the front end asynchronously?
morning Alma Do
 
@SecondRikudo < br > isn't valid, there can't be any spaces between the opening angle bracket and the tag name (although browsers will probably allow it in most circumstances I imagine)
Also, moin
 
i think im in love with my coworker
actually, I know I am.
 
mornin dave
 
Can I define another "column" in phpstorm at 80 chars besides the 120 chars one?
@DaveRandom MOgguh
 
@PeeHaa That looks like a decent spelling of my current mental state
 
8:44 AM
how so?
is it because it's Monday?
 
@DaveRandom I know dat feel :(
 
@ziGi Self inflicted
 
Ah, the worst kind
 
Beer induced
 
Haha, man I got that yesterday too after Saturday
I had to reanimate for quite a while
I don't know what happened on Saturday but I got drunk from 3 liters of beer
I'm getting old :(
 
8:54 AM
I'd be drunk from 2 beers
 
@ziGi 3 liters.. I drink that much water in a day.. Damn.. I couldn't even handle the alcohol :D
 
haha yeah, but that was in the period of 2-3 hours
ah, also some whine like a glass or two
 
@DaveRandom Aaaaanswer meeeeeee
11 mins ago, by PeeHaa
Can I define another "column" in phpstorm at 80 chars besides the 120 chars one?
Now!
 
@PeeHaa go to Settings (Ctrl + Alt + S) -> Code Style -> The currently used one -> Right Margin (columns)
 

« first day (1647 days earlier)      last day (3287 days later) »