« first day (1920 days earlier)      last day (3253 days later) » 

@Scott ...did you give me reddit gold?
01:06
lxr.php.net/xref/PHP_MASTER/Zend/zend_strtod.c#3702 … wtf is this thing… a single macro hell…
01:17
@ScottArciszewski the mystery is ruined!
@bwoebi makes it K&R C where necessary, I'm guessing
I think we imported that code mostly wholesale from somewhere
@bwoebi anyway, there's a new state-of-the-art in float to string conversion, we should use it :)
also we should get rid of EG(precision) D:
it's a horrible hack which I assume is only there to avoid stuff like 7.000000000000002
@Andrea right, I was looking at exactly that pdf
but it's unnecessary if you have a decent dtoa
@bwoebi :)
@Andrea there still are the real rounding errors by the way
I spent about two hours reading it
@bwoebi oh sure there's rounding errors but obscuring this by printing things with less precision is silly at best and potentially dangerous
right, that's what round() should be for…
01:20
yeah
I'm just mentioning it
the default should be -1
-1??
@bwoebi IIRC when it's -1 we print the shortest accurate representation, but I may be wrong
#ifdef IBM
@Andrea -1 what? EG(precision) ??
01:22
@bwoebi yeah
$ php -r 'var_dump(ini_get("precision"));'
string(2) "14"
$ php -r 'var_dump(ini_get("serialize_precision"));'
string(2) "17"
Oh, we don't do what I thought
Actually I misunderstood what precision does, but... why do we have this?!
PHP deliberately inaccurately converts floats to string by default. Why.
same inaccuracy as %lf has in the C stdlib?
Wes
Wes
@Andrea isn't precision only used for float to string?
@Wes yes, that's the problem
@bwoebi oh god really? D:
01:31
@Andrea AFAIK
also why the hell does PHP not use serialize_precision for var_dump
Wes
Wes
how is that a problem?
apart that should be hardcoded and not an user setting
you know, var_dump, which is supposed to show the contents of a variable FOR DEBUGGING
@Wes it doesn't print floats with full accuracy. it lies to you
Well, honestly, if the "full accuracy" matters, you're probably not actually going to get a truly accurate value anyway.
01:33
Short of emitting the binary contents of the float, which is kinda silly.
@jbafford no, but the problem is this makes two non-equal values appear equal
yes, but you're not supposed to compare floats by equality anyway.
@jbafford Due to error, yes, but you can account for error.
You're supposed to compare them by a relevant epsilon for the calculation.
PHP discards far more precision than is in epsilon
01:34
Only when displaying
$ php -r 'var_dump(1.00000000000000100, 1.0, 1.00000000000000100 === 1.0);'
float(1)
float(1)
bool(false)
@jbafford which means you will be confused when debugging
They're floats. I'd expect to be confused when debugging.
But, maybe I'm just a jaded ex-C programmer. ;)
Wes
Wes
@Andrea wat :P
(also the sage advice: if you can avoid using floats, do so)
@jbafford floats are fine
for certain use-cases, they're absolutely fine
01:38
Yeah, I know. I was being facetiously hyperbolic.
Well, it's sometimes sound advice
yeah, absolutely. Like, never, ever, do currency math with a float.
@Andrea lol why ask then? I'm not exactly a good liar :P
@ScottArciszewski ah, true, I suppose you're the only one it could have been :p
hehe :)
your answer was more calm than the one I wanted to write
01:40
ah
I try to stay calm generally
Also, the more public something I say is, the more subtle my passive aggression
yeah, that's a great attitude :-)
My RFC introduction emails tend to be quite similar, but there's something you might not pick up on
:P
I just say it like it is
filters are overrated
It usually says "Please read it and tell me your thoughts" - the "Please read it" is me very subtly moaning about people not reading my RFCs in full before responding
@Andrea so subtle that nobody actually notices ^^
01:42
I used to say "Please read it.", but that's a bit too obvious
@bwoebi yes :D
I view subtlety as a form of overhead
there are situations that call for it, but generally
it's more work on the sender and receiver to communicate the message
put another way: if subtlety is a knife, I'd rather be a greatsword
@ScottArciszewski you can better shoot with knifes from distance…
yes, at the cost of needing to throw them
javelins, yo
did I mention that I <3 scalar type declarations?
I no longer need to see how data enters a method to know what's a string and what's an integer
ikr
they are nice, but I'm still not sure whether the strict mode were a great idea…
01:49
they catch my slip-ups
@bwoebi strict mode is the best feature and catches stuff weak mode doesn't
that's more of a religious thing IMO
a lot of people rag on PHP's type system
one nice real-world example: if you blindly do file_get_contents() and it fails, you'll get a TypeError if you pass it to something wanting a string
01:50
@Andrea … and a warning.
most people don't have warnings turned on
@bwoebi oh sure, but for quick test scripts I don't set up error handlers. actually, I never do, maybe I should...
hey, at least PHPUnit does it for me
@ScottArciszewski a lot of people have them on but don't make them do anything beyond writing to a log file
I use strict mode in Halite but most of the time it's passing objects around, not scalar types
01:51
@Andrea log file? that's what stderr is for…
it did catch a few bugs with how I was using certain features, though
@bwoebi web server stderr goes into a log file, yes, it's basically the same
so I s/null/''/ and everything passed :P
@Andrea ah yeah, I always forget about PHP's webserver integration :-D
01:52
too much CLI usage
@bwoebi I use PHP on the command line as a calculator
anyway, I'm like a month behind on this project, need to get caught up
ciao
@Andrea heh, me too ^^
PHP is a calculator I can trust because I know what it does
I have no idea what precision and such OS X/Windows/w/e work to :p
@ScottArciszewski cya
I just wish php -a would print the result nicely…
without explicit print/var_dump
01:53
it would be nice if we had that
I personally just do php -r 'var_dump(...);'
I never use php -a
I use php -a when writing a lot of small things…
I sometimes am annoyed about having to type that var_dump^^
it'd be nice if there was a command-line option that did var_dump for me
--use-var-dump-please-so-i-do-not-have-to-type-it-out
@PaulCrovella :D
PHP is weird but I kinda like it
Maybe I have Stockholm syndrome
lol
01:58
it's the _ in var_dump I really dislike
vardump? nah, that's awkward
I've had two-letter helper functions for print_r and var_dump for years.
function v(...$a) { var_dump(...$a); }
:-)
in a global auto_prepend_file
02:00
My finest hour
and then be annoyed each time on another server why v() doesn't work…
Hello All, Sup?
@bwoebi there should be function_alias(...). I should implement that
INF.0? wtf.
@Andrea I was just thinking that
@jbafford I was fixing it so floats would be exported as floats, so I checked if the string representation had a . in it, and if not, append .0
@jbafford we already have class_alias so its absence is conspicuous
02:01
heh. oops.
@Andrea yeah, I was also just thinking that :)
TIL infinity can be written as decimal number xD
I can't believe I screwed that up, it's so obvious
@bwoebi if only :p
@Andrea And your oops will be forever enshrined in the halls of 3v4l. ;)
you know...
@jbafford until 7.0 becomes unsupported, yep...
and even then it might stick around if "unsupported versions" is checked
that'd actually be pretty awesome if 3v4l could be used as a source of test scripts for new php builds
If it's not already covered by a test in php-src, almost every feature in PHP has got to be in 3v4l somewhere. An alert if something ever changes would be useful.
02:08
interesting concept
that would require having new PHP versions be run against all the scripts on the site, though, which might be a bit expensive
yeah, there's always a hitch :)
Yo guys, any idea how can i search for a "assets pack" for characters like Fun Run does? (paid/free)
@RoiMulia you might be asking in the wrong place (this is the PHP chatroom), but the Unity Store?
@Andrea i guess i am haha, Sorry for the off topic
though that probably works best for 3D stuff
@RoiMulia no worries!
02:13
Thanks. :) , and its a 2D game but i might work something out haha
there's lots of places to get sprite packs, you should be able to find some by simply googling
Actually my main problem is that i have no idea how to phrase such a search, my best shot was 2d Characters Assets
 
3 hours later…
04:48
am i the only one whose online here?
05:00
@MaryDaisySanchez no ;-)
sings Matching with regex into HTML is fun :-D
m̡o͠r͞n͏i̡n͜g͡
hehe, bobince style
can i have some logic on you guys?
just ask
how do you create a dynamic menus with unlimited submenu tree
just like wordpress
05:16
that's not quite a PHP question…
Also, I guess you can look that up…
sorry i just need a logic i'm making my one cms but i'm stock on the menu leveling thing
@MaryDaisySanchez so, what do you have until now?
good morning ALL
05:34
Wtf
that page seriously replaced dots (.) by &#46;
wtf.
Hi
Any way to get value from hash bang url ?!
Like : mydomain/gallery/view/246/gallery-title/#!/page=2&order=desc
@NewCod3r parse_url will help
i need to get page number and order from url
fragment identifiers (stuff after a # in a url) aren't sent to the server
well, they are when peehaa screws up, but they aren't supposed to be sent
THIS CODE WORK FOR ME ?
function parseHashBangArgs(aURL) {

aURL = aURL || window.location.href;

var vars = {};
var hashes = aURL.slice(aURL.indexOf('#') + 1).split('&');

for(var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');

if(hash.length > 1) {
vars[hash[0]] = hash[1];
} else {
vars[hash[0]] = null;
}
}

return vars;
}
with javascript
?!
05:50
javascript is where you'd have to do it, yeah
how to marge using php for get value !
06:05
TIL strptime() isn't implemented on Windows
lol
moin
06:20
> "tm_year" Years since 1900
php.net/strptime … wtf????
I know, it comes from the strptime(3) function, but nonetheless, wtf…
dude, there are better options for date parsing.. strptime shouldn't even be a thing any more
@PaulCrovella for locale dependent parsing?
Months name is in German, strtotime only know English
Have I already said that I hate locales being process wide? <.<
@bwoebi i can't do any 4 leveling with dynamic
@PaulCrovella no intl installed :-P
06:33
you just gotta make everything difficult, don't you
nah, really no intl installed … Also I'm generally avoiding these extensions as they aren't installed by default on many targets.
but there's nothing in ext/date matching my needs except strptime() :-/
I wouldn't support much locale-dependent anything without intl. If I had to, I'd still avoid strptime anyway (anything OS-dependent may as well be undefined behavior) and hack up some preparse translation ala str_replace
06:48
morning
Here if you're around @JoeWatkins
@rdlowrey @Danack @Jimbo is there a way to unshare something in Auryn? and is it enough to $injectedObject = null to kill the object with all it's dependencies? (if they were not shared)
@SergeyTelshevsky no, it isn't.
use a separate injector then.
the design of injectors is that you set it once up early and then don't touch it anymore.
@bwoebi thanks, I'm concerned about memory consumption in long living processes. I have an iterator that creates the same object until something happens, should I make a __destruct and unset every dependency manually?
user924016
Mornings, hope you all had a good weekend
06:57
@SergeyTelshevsky if there are things which target different usages, you really just should use two injectors
user924016
@PeeHaa sorry never got to the wp trimming =/
@bwoebi nope, not usages, as I have said, it's not "twice", it's "indefinite" and depends on a 3rd party RPC. (Currently I'm talking about the second part, not unsharing objects, that was dumb).
Hi
Anyone knows solution for my question?
http://stackoverflow.com/questions/34848652/how-to-change-captcha-error-language-from-contact-form-7-google-recaptcha
@SergeyTelshevsky and setting to null … sets the variable to null, the object value is left untouched
that's what I'm asking, GC should clean that up if there's no references to that object left, is it a proper way?
07:09
@SergeyTelshevsky sure, then it should clean it up
(when it's not referenced by the injector, obviously)
Good morning peeps
@bwoebi yeah, does $injector->make() leave any internal references if the object was not shared?
Yay, work server has been under attack during the weekend, yay for clean up duty :_:
@rtheunissen I'm here, but didn't get the early start I thought I would ... tomorrow ?
sorry ...
07:19
No worries, managed to get all the way through the democratic debate while it's pouring outside. Now is good, otherwise tomorrow is easy as well, even a later start is fine.
I would start now, but in 40 minutes gonna have to stop for school run and whatever ...
moin @JoeWatkins
moin @Leri
tomorrow will give us a better chunk of time @rudi
I doubt it'd take more than 30. Let's do tomorrow so there's no rush.
Sounds good. Night everyone
okay cool, sorry for letting you down ...
nn
07:23
@SergeyTelshevsky surely not.
Not at all, it's like office hours, easy to keep busy with something else.
Catch you tomorrow.
07:35
Does anyone knows if app code hosting service exists?
@SergeyTelshevsky If you weren't using the injector, how would you solve your problem?
@Jimbo yeah, I was asking to know if the injector has side effects like leaving references
I don't want to buy a package at SiteGround that contains all tools needed, I want just the computing of an website
Databases stored somwhere else than that server
o/
@feniixx wtf is app code hosting?
@Patrick e.g. heroku provides compute servers hosting... kind of that is what I want
but cheaper
I just want to host one website per instance
07:43
@feniixx buy a cheap vps?
@Patrick the thing is that they pull you with a lot of other things
like pro email, etc... things you could get elsewhere better like google apps
and you can find coupons to get that down to 12 I believe, if you are really cheap
I don't want to compromise the website just for money either
07:47
I have no idea what you are talking about tbh
I don't either, I just want to know if there's such a thing
somewhere I could just host website code (html,css,js,php) only
@Patrick Single core with 128 mb ram is... um... waste of money...
@Leri how so? I have a couple of small sites running on them
@Patrick How many users/day?
@Leri not worth tracking/day
If it needs more, I can always upgrade. If not, why bother
07:59
@Patrick Basically, I have my own dedicated server that can handle up to 25 sites with descent load, I think that's a better way. or as you go cloud (but gets problematic ones traffic increases)
@Leri but it's a trade-off against protection.
@bwoebi protection from what? Well, the largest trade-off is the maintenance and its costs (i.e. constant updates, monitoring for vulnarabilities, etc.)
@Leri well, if someone breaches in, all your sites are fucked, not just one.
@bwoebi Agreed and all you can do is backup everything and every-time. If you have fallback servers and don't store too much sensitive information (e.g. credit card info) you are pretty safe.
Good morning people
When you change the A record to point a domain to the ip where your hosting your website do you also need to change the nameservers on the domain hosting site or just adding the A record is enough?
08:23
@RonniSkansing no worries :)
@kelunik I might look into windows at some point when it starts annoying me enough
morning!
MSXML2::IXMLDOMNamedNodeMapPtr pPrefixAttrMap = spNode->Getattributes();
if (pPrefixAttrMap->getNamedItem("name"))
{
How i change the value of the name?
f (pPrefixAttrMap->getNamedItem($name)) ?
Mornings
or that's not what you mean?
08:32
@Naruto name is a attribute i want to change its value?
@PeeHaa o/ did you haveanother chance to look at my friday problem?
<file name="D:\\TestFolder\\Client\\LocalOldFile"/>
@Naruto Uggghhhh. Had the chance but forgot about it :P
ah dammit :P
It's ok I knew what I was going to propose.
moment
08:36
Oooo.. you're going to propose? to who? ^^
To you ;-)
awwwww
:-)
that's just nasty lovely
btw, is it an idea to make an init function in my class? with a try catch in it? instead of doing it in the constructor?
moin
08:47
@Sean o/
@Naruto What about something like this (I didn't had time for coffee yet mind you) gist.github.com/PeeHaa/c4c2152379c8f728d0bb cc @Wes @FlorianMargaine
Ow btw, I'm not passing the variables to the class, since I'm just declaring them with a fixed value for this one
I'm a fan of RAII-like thinking, so I prefer something like this gist.github.com/ralt/6ed8d70c995208ca6c90
@PeeHaa i've never used get() like that before, so you just call $object->get() then?
@FlorianMargaine I've only got 1 remark: plz don't use @ in $result = @ftp_login ($this->connection, $this->username , $this->password); :P
08:56
@Naruto I didn't touch this bit, but this one is actually a valid usage :)
it lets you handle the error properly without having an unnecessary warning
mm.. I would just write it in the if all together
note that the way I'm showing has a fair drawback: it creates a new connection (and closes it) every time you call withConnection
I wish php had try/with.
or python's contextmanager
I would probably take the lazy way out.
@Naruto Yes to get the ftp stream resource
@PaulCrovella Solid advice :-)
mm.. let me play with some of you ideas :)
09:08
class FTP implements Disposable {
    private $stream;
    public function __construct() {
        $this->stream = ftp_connect();
    }
    public function __dispose() {
        ftp_close($this->stream);
    }
}

try ($client = new FTP()) {
    $client->doSomething();
}
I wish I could do this.
@FlorianMargaine You could use the using pattern to emulate this
@FlorianMargaine quick question.. if you use @ with the ftp_login, why don't you do the same for the ftp_connect?
@MadaraUchiha yeah it's like C#'s using
@Naruto I didn't write this code, ask @PeeHaa
@MadaraUchiha and yes, see chat.stackoverflow.com/transcript/message/28194079#28194079 but it's not as nice as language built-in :)
class FTP implements Disposable {
  private $stream;
  private function __construct() {
    $this->stream = ftp_connect();
  }

  public static function using(callable $consumer) {
    $instance = new FTP();
    try {
      call_user_func($consumer, $instance);
    } finally {
      $instance->__dispose();
    }
  }

  public function __dispose() {
    ftp_close($this->stream);
  }
}

FTP::using(function($ftp) {
  // use here, will be cleaned up
});
@MadaraUchiha how do you pass arguments to FTP constructor?
(e.g. login, pass, etc)
09:12
posted on January 18, 2016 by nlecointre

/* by DannyFeliz */

@FlorianMargaine Modify the using static function.
@MadaraUchiha which totally sucks :)
@FlorianMargaine No more than modifying the constructor.
@MadaraUchiha you have to modify both anyway
(you pass the arguments to using which passes them to new FTP)
@FlorianMargaine Pass a data object (associative array) as a single argument and you're golden
Wes
Wes
09:13
@MadaraUchiha eeeeeeeewwwwwwwww
@MadaraUchiha ^
Wes
Wes
js ruined you :D
@Wes JS has destructuring... vOv
I can do this just as easy:
Wes
Wes
@PeeHaa no idea, haven't had my coffee too
FTP.using = (fn, {user, pass, host, port}) => {
  // ...
};
09:15
still sucks
If PHP doesn't have that, it should have that.
@FlorianMargaine Not exceedingly, no.
(compared to the try I showed)
@FlorianMargaine Oh, yeah, absolutely.
Also, my solution doesn't handle the case when __dispose() throws
You need extra shite to handle that
and if we go with current available cases, I'd just go with
$conn = new Connection();
$conn->withConnection(function($client) {
   $client->doSomething();
});
C#'s using and Java's try-with-resources are much better solutions.
09:16
16 mins ago, by Florian Margaine
I wish php had try/with.
I think @Andrea would love to tackle this.
hint hint
oh yeah
I made an init system yesterday
#!/bin/bash
agetty tty1
I had kernel panics after logging out of my tty :D
@MadaraUchiha I plan on making an init system in lisp, with a built-in swank server, so you could REPL to the PID1 process and manage services and stuff
@Naruto ftp_connect doesn't throw warnings. login does
!!docs ftp_connect
[ ftp_connect ] Opens an FTP connection
Can someone remind we why we don't just recompile without JIT if we hit the PCRE stacklimit?
@Danack ^
!!ln -s docs rtfm
09:36
@ircmaxell I eagerly await your expanded discussion on this topic as I think it holds real value not just for the PHP community but for application developers at large!
@ircmaxell For example, if I am writing a value object, under your classification we could call this object's role a representer. I can use this key word to document the class by saying; Represents a foobar, for example. If we could create key words to classify all object roles these could be used to create guidelines for how to document objects which would be really helpful!
@NikiC … I can't think of any reason
@NikiC because the conversation about it just sorta fizzled out and nobody did that
10:14
Anyone who familiar with yo payments integration gateway??
10:27
-6
Q: QBE Advantages over SQL

ggtsdjsdkyxdmr6rkfc lkrQBE advantages compared to SQL

should be closed??
probably
@PeeHaa should have just checked instead of asked :P
@Naruto :-)
10:44
so, I'm an internet celebrity
user image
10
LOL
Nice :V
@FlorianMargaine hehe
google can be weird...

« first day (1920 days earlier)      last day (3253 days later) »