« first day (1429 days earlier)      last day (3747 days later) » 

00:00
Why would you be mixing them?
Not sure it's practical
And that already happens anyway for ints
@AndreaFaulds yeah, but actually everybody knows he cannot reliably use big values. So not an issue.
But when bigints come, that'll change.
And these bugs might then get hard to track down, especially if people expected their values to be still bigints.
If the docs say float then, well...
@AndreaFaulds Sure, but people don't always look so closely at the docs.
don't assume that people only do sane things ;-)
I want double for non-relative numbers.
@AndreaFaulds I'd maybe add a notice about __toString() in the RFC then.
I can live with float, numeric and int, I just wanted to discuss and understand a bit better the reasoning.
I don't want numeric >.<
@bwoebi I already did... look at the conversion table
00:11
@AndreaFaulds I just looked at the text, sorry.
@LeviMorrison Why not? It's useful for mathematical functions
@AndreaFaulds typo of "Mathing" in the line "Mathing integers and floating point numbers (to allow polymorphic functions dealing with numbers)"
Also, polymorphic functions?
@Danack Fixed
Java like typing detected.
@Danack "In programming languages and type theory, polymorphism is the provision of a single interface to entities of different types." - can work for both ints and floats
00:13
Yes. I know. It sucks.
@AndreaFaulds Having worked in C and C++ and PHP a lot, I much prefer picking types for mathematical functions.
@LeviMorrison Why should I have both absFloat and absInt, or signFloat and signInt?
but that's another case we could solve by having int | float style union types.
@AndreaFaulds :) Again, just use no type hint :D
It's not a problem for simple cases, it's a problem for more complex cases, where the added complexity of having to think in two schemes at once makes thinking about the code harder.
00:15
@LeviMorrison Then I need a DocBlock. Boo
Be explicit or implicit. I don't like numeric which is this odd middle gorund.
Plus it's a keyword/cast we don't already have.
$0.02
@LeviMorrison We do have it as an implicit cast :)
Yeah but you don't have (numeric).
Just out of interest, have you used much polymorphism in Java or C++ or other language that supports it at 'properly'?
00:18
@Danack Both have overloading, I wouldn't say they are polymorphic
@AndreaFaulds I meant have you used "In programming languages and type theory, polymorphism is the provision of a single interface to entities of different types." in a real world project?
@Danack I've redefined abs and sign, does that count? :p
Nope.
I've written polymorphic functions before, though, I suppose
Although it sounds nice, it's just one of those things that as soon as you start actually using it for stuff that isn't trivial, the benefit of not having to duplicate stuff is far outweighed by the increased amount of magic in your program.
00:23
I wouldn't say if (is_int($a)) { } else {} is really that much magic
Yeah, but then you have to remember to think about whether something is float or an int, and whether they need different handling.....and people forget to check.
function foo(numeric $x) {
    return $x % 4;
}
foo(3) - returns unmodified.
foo(3.5) - returns 3
Sure, there are some things you have to be careful about
function mod(numeric $numerator, numeric $denominator) { if (is_float($numerator) || is_float($denominator)) { return fmod($numerator, $denominator); } else { return $numerator % $denominator; } } :)
Yeah...if you're just doing a simple one line function it's not a problem. If you're doing anything more complicated and calling other functions on the parameters then you've suddenly got to 'be careful' when writing code. Having to 'be careful' is likely to lead to surprises and surprises are bad - other than birthday parties.
@AndreaFaulds how good are you at m4 (specifically for autoconf, if that matters)
00:29
entire room flees in terror
@DaveRandom Awful, I'm still trying to figure out why altering the text in a .m4 file in the bigints patch didn't affect --help
Though
I seem to understand it somewhat
I had to debug some m4 stuff recently....so ask?
Hi guys, I'm trying to get lost connection via sending data (fwrite), But I get a warning that It couldn't send data After precisely 19 seconds:
Notice: fwrite(): send of 2 bytes failed with errno=10053 An established connection was aborted by the software in your host machine.

I tried to change the timeout stream_set_timeout($socket, 5); before fwrite
but It prints the warning after 19sec ?
We should write our build scripts in PHP
00:31
Just want to check if a macro exists before attempting to call it (or whatever dirty hack is used to emulate this)
@Ahmad It takes a while for TCP to time out
_set_timeout just sets how long fwrite will take before it gives up trying to write
There's something that libjit uses that mingw doesn't have, it doesn't actually need it when compiling with mingw so I just want to skip it
@tereško Do you happen to live in Riga?
It's unrelated to the TCP timeout (how long the other end must be silence before the connection is considered dead)
@DaveRandom ifdef([AC_PROVIDE_IFELSE],
trying to find link to example.
00:34
@Danack ... no floating point modulus?
@DaveRandom oh it appears to be:
ifdef([AC_PROVIDE_IFELSE],
         [],
         [define([AC_PROVIDE_IFELSE],
	         [ifdef([AC_PROVIDE_$1],
		           [$2], [$3])])])
@AndreaFaulds Aha, ok but I was wondering why it is 19sec on every try ?
I mean why not 15 or 24, I was thinking that this number was set in php.ini ?
# If this macro is not defined by Autoconf, define it here.
It's in the imagick built m4 files - but I can't see where it actually comes from.
I don't actually need to define it (it's a check macro and doesn't have any effect on the mingw build), so can I just do ifdef([AM_PROG_AR], AM_PROG_AR) ?
@Ahmad It's taking that long for TCP to time out, presumably
00:37
@LeviMorrison 3v4l.org/ntOtB - but my point was that some stuff breaks in subtle ways, and that explicit is good.
@DaveRandom Found the manual page - mbreen.com/m4.html search for ifdef
Well, in PHP, you have to do extra work to ensure an integer result with the normal operators anyway ;)
@Danack sweet jesus, why do people use this?
"Although m4 provides no builtins for iteration, it is not difficult to create macros which use recursion to do this."
  define(`for',`ifelse($#,0,``$0'',`ifelse(eval($2<=$3),1,
    `pushdef(`$1',$2)$4`'popdef(`$1')$0(`$1',incr($2),$3,`$4')')')')
Dear god...
They use it for the lulz.
00:47
what the shit
also what's with the backtick/single quote thing?
curly quotes before we had curly quotes
people would do ``foo''
which looks right in the right font
Yeh but this is in a god damn programming language
(sort of)
01:04
@DaveRandom I think this may be a motivating reason for cmake.
76yu8ht
@LeviMorrison Why not phar itself?
@AndreaFaulds I think we can do better; that is only a marginally informed opinion.
Based primarily on a scan of this: blog.engineyard.com/2014/php-53-5th-anniversary
Oh wow. That's a brilliant hack.
02:07
@rdlowrey damnnit i saw that joke 4 days late
:(
02:19
What column datatype should I use in oracle if I am storing a large amount of text? Like in question/answer website for example, what datatype should the column be that holds the answer text?
Clob? Blob?
Varchar? I doubt...
@DemCodeLines TEXT?
Oh, Oracle
@AndreaFaulds it returns ORA-00902: invalid datatype
"Columns defined as LONG can store variable-length character data containing up to 2 gigabytes of information. LONG data is text data that is to be appropriately converted when moving among different systems."
Do not create tables with LONG columns.
Oh. LOB then.
CLOB presumably as it's Unicode
02:25
@JoeWatkins turns out that this is the problem with ->dump(). In a nutshell, you can't pass file handles across DLL boundaries unless they use the same CRT. So unless I can get libjit to compile with VC then it just isn't going to work. My vote would but to simply not define the ->dump() methods on Win for the time being and doc it as *nix only
I can hack libjit to make it work with stdout, but that's it (and probably not something that should be done)
@AndreaFaulds how the heck do you insert a string into a clob field
@tereško Ah, you are (or close). Dunno why it took so long for me to think to look at your profile for location.
 
1 hour later…
04:06
is there a significant performance concern for using ArrayObjects in place of arrays?
@Hamster no.
I guess the better question is: Are they just array wrappers, internally?
@DaveRandom cracking work ... agree, disable on win ...
Request-URI Too Large

The requested URL's length exceeds the capacity limit for this server.
when i sending base64 image to the server
via ajax
how can i fix it ?
@samitha use POST rather than GET
04:21
I'm using angular with POST but same issue
@derp do i need to something with server side ?
ping @johannes
grrrr fud puts me in a bad mood and it's only half five in the morning ...
someone tell me how the heck you insert a string in a clob field in oracle
04:37
morning gents
grrr @Jack
@JoeWatkins what's the cause of such grievances?
1
A: Why is not a good idea to use multithreading in php?

johannesPHP is supposed to run on webserver serving the frontend. In a typical environment you have multiple users (web clients) in parallel making full use of your CPU cores. Splitting the work up from one thread into multiple ones usually makes no sense in such an environment. As the system is already ...

> For actual threading there is the pthreads extension in PECL which doesn't create a copy of the process but shares the same process which messes with PHP's memory model (which assumes there is one request in one thread at a time which shares nothing with anybody else) some people use this, but offloading to other systems is typically better
well, that's not a very nice thing to say.
it's also 100% wrong
04:40
I was wondering when you were going to find that one
you even linked to the document that explains why that is wrong @derp ...
worse that person could read and understand the damn code ... but decided they would talk about it before knowing how it works ...
saying such things causes rage conditions ...
you can forgive an idiot for FUD ... not someone who you know is not an idiot ...
you don't have to be an idiot to be... misinformed
hello, is anyone on here?
04:44
but then you don't talk about things you are not informed about ...
plenty of things I'm completely ignorant of ... don't talk about them ... would be dangerous if I did ...
the whole post talks about 'mess' a lot doesn't it?
@JoeWatkins except for kittens, surely.
I know all about them ...
hmm, it seems that the tau constant doesn't have much traction yet ;-)
05:33
hi. Is anyone else having this error recently? $array = [];
I have to use $array = Array();. I checked if it's a change in PHP but I didn't see it anywhere. I was thinking maybe someone from my web host changed something.
06:18
@chx101 Check your PHP version - short array syntax was added in 5.4.
06:35
Guys please check this post. Isn't something missing there?
Why did nobody advise to strip html tags from body?
Maybe the body tag uses this code:
Hello $_POST["username"]
and the post username var was set to something like <script>alert("wgwgwgw");</script>
won't that cause an issue?
or am I missing something here?
0
A: Why is not a good idea to use multithreading in php?

Joe WatkinsDoes forking create a Thread ? When we fork a process, the process space, that is to say the region of memory where the libraries and code the process requires to execute reside, is duplicated, the distinct but related processes then continue to execute at the will of the operating systems sched...

@AwalGarg you're missing the top-voted and accepted answer to use filter_var() including a link to a tutorial on how to use it where the very first example includes stripping html. The example in the answer itself, on how to sanitize the email address, is just that - an example.
06:58
@derp got it. thank you very much :)
07:31
@LeviMorrison yes, I live in Riga
 
2 hours later…
Morning
mornin
IIRC, you have GitLab set up, @PeeHaa
yeah
have you tried to add some branding to it ?
Nope. Just installed it and was glad it was over :)
09:06
now I need to slap redmine on same box .. because: penny-pinching
:)
At my previous job they bought a active collab license which ended up being pretty fucking horrible and useless
> Earlier today the freenode infra team noticed an anomaly on a single IRC server. We have since identified that this was indicative of the server being compromised by an unknown third party. We immediately started an investigation to map the extent of the problem and located similar issues with several other machines and have taken those offline. For now, since network traffic may have been sniffed, we recommend that everyone change their NickServ password as a precaution.
Hi every one
Guys I went to HP for an interview . but then I told them I am comfortable with php and mysql . after a month they called me and said to me that I passed the interview and I should come for an assessment test and I should revise Java and dot net .
I would like to know what kind of questions or tasks should I expect.
09:47
Hi
someone know if it exist a google irc channel for google place api questions ?
 
2 hours later…
11:54
.. the wisdom that comes with experience
when comparing the installation guide of gitlab and redmine, the latter is made by bunch of monkeys who threw shit at the whiteboards
user924016
Mornings
user924016
Morning @PeeHaa, had a nice weekend?
Decent. Bit short though
user924016
short? =]
12:05
mine has been 4 hours
Yes as in: not long enough :)
@tereško :P
user924016
@tereško =/ watch out for the burn out..
yeah
it's always an option
user924016
=]
12:53
Hi guys do you know something like detection "lib" or code or base url path?
Something like this:
localhost/myapp/
Just detect myapp
BTW: my script name is /myapp/public/index.php and I don't want to use regex
Because regex is evil?
Yesssa :D
emm ... why the fuck your application logic is in the DOCUMENT_ROOT ?
What's wrong with regex now? :|
Good point tereško
12:58
@Leri "Don't use regex for (I don't give a funk)"...
ehm it is because I got lot of projects in DOCUMENT_ROOT for example fuelphp, lavarel named like project1 and etc
@VeeeneX If it's PHP paths, then doing something like $pathToRoot = __DIR__."/../../"; is probably what you're after. If it's paths on a webpage, do everything relative to the root.
@Danack I don't want to use it for file IO, I want to use it for routes
If you get me
Or If you know what i mean :D
Then you definitely shouldn't be detecting anything - do everything to the root of the website.
@VeeeneX $_SERVER['REQUEST_URI']
13:02
Is there generally a performance boost to querying with SELECT ... WHERE id` IN (2, 4, ...)`versus using a loop in PHP to query for individual items with a prepared statement?
@webarto localhost/project/page That's the result and I want only '/project'
i keep thinking because a prepared statement is involved, the lifting should be about the same...?
2 mins ago, by Danack
Then you definitely shouldn't be detecting anything - do everything to the root of the website.
oops - "do everything relative to the root of the website".
@Hamster One query is probably better than multiple... WHERE IN ~= WHERE id = 1 OR id = 2 ... etc.
Danack, can you show me example bacause I'm dunno
13:05
@VeeeneX could this help: stackoverflow.com/a/19309893/727208
@VeeeneX Not really, you haven't said what your problem really is meta.stackexchange.com/questions/66377/what-is-the-xy-problem
slapping on a framework simply because you need a rouning system seems kinda .. emm .. excessive
Ok, I've opened both
BTW: I'm using this amazing routing lib FastRoute :D
13:07
Anyone watching basketball finals tonight?
guys, guys, guys, few gals, guys ... i have naming issue again: what should I call the subdomain which contains Redmine ?
redmine.domain.com
@tereško must likely it's a subsubdomain and not a subdomain?
at work it's redmine-projects.domain.com...
but because projects.domain.com was taken by a legacy app
@tereško "bob"
13:12
I was loking for something better then "redmine.domain.tld"
And do you know some user lib for Auth and things like that?
projects.domain.tld isn't good?
project.management
hehe
kate.loves.redmine.example.com
13:41
gods below
redmine's documentation is a PILE OF FUCKING SHIT
It is not static - are you familiar with laravel's IoC? — M K 2 mins ago
udf uha9psf9we89F7b9 ecB79CASDIAGSCIOusodiucnoaSUHIUMS OAMdxihASMOFHOASHfoh
Yes::it_is($static)Dan Lugg 21 secs ago
I cannot even.
13:57
New PRNG implementation; bytestream derived from telling @Danack that Laravel IoC isn't static.
14:10
The slides from my DI the Right Way talk http://static.basereality.com/PHPSW.pdf - you might be able to tell that fitting it in 20 minutes was 'tricky'.
heh .. the integration test lecture still ended up in the slides
Yep. :)
14:30
Morning, folks.
@tereško In what area? Someone is staying at my house for the night and she's from Riga.
@LeviMorrison Agenskalns
(I don't know how you will be able to pronounce it)
I'll just have her read it :D
in that case: āgenskalns
sveicieni no Amaerikas latvie;siem
:)
gandriz kaimi'ni
es no Dzeguzkalna
Jap, pavisam tuvu, it sevišķi ņemot vērā ka esmu pie botāniskā dārza
@LeviMorrison , you can actually make a virtual excursion using google's street view
=P
14:40
:D
I'm confused by being told I should not keep my database login in my PHP code.
Where else do I keep it? A config file somewhere?
Wouldn't that also incur similar downsides?
security is like an onion
Or maybe I'm just misreading what I've been told...
14:50
you should NEVER keep the DB login details in DOCUMENT_ROOT
also, the db login that you have in your site's config should only have rights to insert, update, select and delete (maybe even more finely granulated if you can)
and you should not be able to access the DB from outside the localhost
@tereško Noted.
any one of those things helps with security .. all three would be recommended , but seldom seen
15:09
hi
evenin'
afternoon
I'm sort of a weirdo, but I actually like my RFC more than the two options it compromises between. I'm neither a fan of weak hints nor strict ones
baaah, internals
@AndreaFaulds As you may have guessed with my talk yesterday about explicitness, I am in favor of very strict types.
Tis an unpopular opinion, it seems.
Strict types are popular in the general community
15:16
@LeviMorrison not really
They're not on internals
@AndreaFaulds Not on Internals >.<
whenever typehinting comes up in the php community, everyone is all strict types
Myself I think both camps are wrong :p
My thought on it is that PHP is a dynamically typed language. If I want to break out of that model I want it to be strictly typed.
Dynamic behavior is not bad, and strict behavior is not bad. I fear the in-between.
Also, my return type RFC now disallows return types on constructors, destructors and clone methods.
15:22
Why isn't returning from a constructor an error?
oa-res-27-90:~ ajf$ php -r 'class Foo { function __construct() { return true; } } $x = new Foo;' -d display_errors=On -d error_reporting=E_ALL
oa-res-27-90:~ ajf$
@AndreaFaulds would be a nice improvement to have that :)
@Ocramius Since returning is pretty harmless, we should just raise an E_STRICT
@Danack thanks for sharing.
@AndreaFaulds Backwards compat?
As this was possible some time back in the past.
It was? Did that make new return something else?
@AndreaFaulds can we also kill PDO's way of doing __construct? :P
hrhr
@AndreaFaulds well, there was the saying that return &$this; being the work-around in PHP 4 to have a reference to the object instead of duplicating it all over the place when passed by value.
Or was it the other way round? $obj = &new That();
It'd be the other way round.
yes that one.
@LeviMorrison I'm still not sure on that count. Basically, my dilemma between "fully strict" and "semi-strict" (as proposed) is this: The fully strict approach invites people to cast arguments before passing, in which case they get infallible, accepts-everything casts. The semi-strict approach will work "usually", but has the danger of randomly breaking when instead of '123' the form contains '123 '. And breaking as in fatal error.
An additional complication is this: I think fully strict types will play a lot better with generics
You could consider to keep the fatal error catchable as it currently is with type hinting parameters.
15:36
@NikiC It'd be possible to change our string->integer conversion rules
Just catch them with your error handler and the code continues as if nothing wrong has been passed.
I think trailing whitespace should be permitted. JS permits it.
@AndreaFaulds that was just a random example
Oh sure, but it's a particularly problematic one
The point is more: Semi-strict hints may work with casual testing, but may break down with unexpected input. Strict hints on the other hand force you to actually validate and cast your data
just think get_user($_GET['id']). Will work when you test it, but will also fail spectacularly in production.
of course similar issues already exist with l zpp, so nothing really new
15:42
so the question is: should it fail in production or not?
no, that isn't the question. if it doesn't satisfy the hint, yes it should fail. the question is more whether we might catch this outside production by making it stricter ;)
@AndreaFaulds E_DEPRECATED in PHP 5.7, E_COMPILE_ERROR in 7 would be my preference
It can't actually use the return type so it can easily be deprecated and removed.
@LeviMorrison You can't remove it, and there's no real point in erroring. Just emit an E_STRICT.
@AndreaFaulds never emit E_STRICT
@NikiC Why would it fail in production?
15:52
there will be an RFC to remove the E_STRICT category altogether
Yeah, I'm working on that.
What, why? :/
@AndreaFaulds because $_GET['id'] was not validated or not validated properly
@NikiC but isn't that already possible today?
@AndreaFaulds Because it's a stupid error category
15:52
It's like a precursor to deprecated.
Why not just deprecate?
@NikiC And (int) is going to magically validate it?!
@AndreaFaulds no, of course not. how did you get that idea?
First I'm reviewing all of the E_STRICT emitted in Zend/
I think most of them are good candidates for E_COMPILE_ERROR
I think so as well
there was one that was strictly informative wrt trait properties
@NikiC Well, it's a choice between people doing get_user($_GET['id']) and it erroring if id doesn't look like an int, and people doing get_user((int)$_GET['id']) and getting garbage
15:55
@AndreaFaulds That's two possible choice, out of a larger set of possible choices.
I don't see how you can validate an id
Another choice (with strict types) is that the developer gets a type error when testing and properly validates his input.
@AndreaFaulds check that it's a number ^^
@NikiC That's what the int typehint does :)
@AndreaFaulds typehints are not validation. Because you can not handle the invalid case properly.
Strict types allows the user to make the conversion. While that may be a burden, it is strictly more powerful.
15:56
@LeviMorrison The user can make the conversion anyway
@AndreaFaulds Not exactly.
@LeviMorrison What?
@NikiC Sure, but they will stop you passing something obviously not an integer to something expecting an integer
@AndreaFaulds non-zero positive integer probably?
@hakre Yeah, I guess. I'm not sure what the point of validating it is, though
@AndreaFaulds I'm referring to "validation" as in "the user entered invalid data" here.
15:58
If you get a garbage id, user lookup will fail
@AndreaFaulds it has to fail with a custom error, not with a type constraint violation.
@NikiC Well the strict hint will do nothing for you there, nor would a non-strict hint
@AndreaFaulds the strict hints prevent you from writing code like that.
@NikiC No they don't.
@AndreaFaulds they do, because they will immediately error out.
15:59
Add an (int) and you still have equally bad code.

« first day (1429 days earlier)      last day (3747 days later) »