« first day (1168 days earlier)      last day (3795 days later) » 

12:00 AM
@Patrick Yeah, but you have to realize that php is loosely typed.
So, sometimes it's int(0) and sometimes (string) ""
 
@PeeHaa Sorry, FileSystemIterator ;)
 
hehe
 
I don't see anything wrong with passing in some native thing tbh
 
@PeeHaa Do you see anything wrong with not passing it in?
 
12:01 AM
@Jack, i would love to understand your opinion better. Why would you ever do something like that? or when.
 
It doesn't really couple it as it's native to the language, right?
 
@RonniSkansing I'm not saying you should; what you should do is make sure variables are of the type you expect them in.
 
@Jack yea, i agree. In the same sense i would not do $pdo++
 
But, say you have something like $quantity = $_POST['quantity']; $quantity++;
 
null is a special value
 
12:03 AM
Yeah, null is its own type.
 
@Jack yea, that is a clear example. I am having a hard time seeing why that should not release a notice
 
@Jimbo You are still coupling it with makes it crap to test the class to which it is coupled
 
Because heritage :)
 
@RonniSkansing Because it's expected behavior that incrementing NULL results in NULL.
 
@PeeHaa Hmm, well I understand why coupling is bad, but something that's native to the language - it's basically the equivalent of calling a function like glob() right?
 
12:04 AM
What if you want to mock some method from that class? You can't if you instantiate it from within the thing
 
Also NULL and FALSE should result in NULL
same as NULL and TRUE
 
@hakre hmm?
example?
 
@Jack say you call a function that returns a number. but you messed up somewhere and there is no return so NULL is coming back. incrementing that to 1 might make bug hunting quite hard
 
(NULL === NULL and TRUE) === TRUE
 
@hakre okay. You both said it, ill go read up more on null in C
 
12:06 AM
@RonniSkansing I think NULL in C is 0
 
@hakre It's (void *)0.
On most systems.
 
@hakre i think that is c++
 
@Patrick So you're saying raising a notice there would help debugging, right?
 
I'm a total noob with C, just saying to give some context for my "I think".
 
@hakre well no, actully you might be right
searching through my C bin and looks like it is 0
in the source
 
12:08 AM
@RonniSkansing Not always.
 
@Jack yes. to me it makes absolutely no sense to allow inc/dec of null and booleans. Strings I can see how it could be useful in some cases
 
@Jack Actually I like the notice for the string increment. I think it's hardly never used and you also show the alternative with that function.
 
@rdlowrey lol ^_^ you should talk to them though
 
@Patrick for booleans I'm biased. Those are merely 0 and 1 in PHP, aren't they?
 
Booleans are stored internally as LVAL.
 
12:09 AM
Well great. Thanks hakre and jack for having some patience with me there.
 
So yes, they're effectively 0 and 1.
 
@hakre I don't know. If ++ always sets it to true and -- always to 0 then it also would make sense imo
 
0 as a pointer looks like null
or is , in C
 
@hakre So would you agree with @Patrick to raise notices when you try to inc/dec null variables?
 
@Patrick interesting approach.
@Jack nope, not for NULL.
 
12:11 AM
@hakre I'm a bit worried about not being able to find BC breaks if we silently remove null++ behaviour.
 
PHP should have already an undefined variable warning and apart from that, incrementing NULL is expected to give NULL. Nothing to warn about.
 
@hakre @Jack but I still fail to see where using ++ or -- on any of those types would make sense. I think it's far more likely it happens due to a coding error and then a notice would help fixing it.
 
@Jimbo Look at it this way. What do you loose when you just inject the thing? Nothing. What do you gain. Moar testability .
 
@hakre Sometimes the null is caused by a missed return statement in a function.
 
@Jack but isn't it then sound to keep it NULL? the miss is straight-forward and not hidden.
 
12:12 AM
@PeeHaa I'm just trying to be lazy :P I've already re-written the tests / code to allow a DirectoryIterator to be passed in. All will be good :-)
 
;-)
 
lol
Get the jQuery.antiValidate plugin it has plenty of jQuery to solve your problem. — Benjamin Gruenbaum 7 secs ago
 
Iterators? Where and when?
 
blah
 
@hakre heheheheheeh
 
12:13 AM
@hakre Well yes, keep it null and raise notice :)
 
@Jack Throw a NullException even ^^
 
Ooh, exceptions in core .. that's so naughty.
 
@Jack Yes, I was just joking. I would not seriously suggest that.
 
Okay, well, thanks for the feedback ... time to give it some more thought. /cc @Patrick @hakre
 
This might be worth something
"The language definition states that for each pointer type, there is a special value--the ``null pointer''--which is distinguishable from all other pointer values and which is ``guaranteed to compare unequal to a pointer to any object or function.'' That is, a null pointer points definitively nowhere; it is not the address of any object or function. The address-of operator & will never yield a null pointer, nor will a successful call to malloc.[footnote] (malloc does return a null pointer when it fails, and this is a typical use of null pointers: as a ``special
 
12:18 AM
but it's a pointer, whereas in PHP it is a value (object).
 
@hakre but should that change the use and meaning of null
why have a null if it does not work like a null pointer
 
Take a look at your SQL database. It has NULLs, too, but no pointers.
 
,@hakre thanks i will do that now
hmm yep, it null nomatter what i pull on it
well i am to high to think of all of these different null nulls... hehe thanks for the input, it was needed
 
null is simply a special type of value with a range of exactly one value.
Just like how booleans are values in a range of either false or true.
 
@Jack Unit
 
12:26 AM
Is that the formal definition of something that can only have one value? :)
 
In the area of mathematical logic and computer science known as type theory, a unit type is a type that allows only one value (and thus can hold no information). The carrier (underlying set) associated with a unit type can be any singleton set. There is an isomorphism between any two such sets, so it is customary to talk about the unit type and ignore the details of its value. One may also regard the unit type as the type of 0-tuples, i.e. the product of no types. The unit type is the terminal object in the category of types and typed functions. It should not be confused with the zero or...
 
Okay, cool hehe
 
time to drop my progeny off at school ...
 
23
Q: What is () in Haskell, exactly?

MaksimI'm reading Learn You a Haskell, and in the monad chapters, it seems to me that () is being treated as a sort of 'null' for every type. When I check the type of () in GHCi, I get >>:t () () :: () which is an extremely confusing statement. It seems that () is a type all to itself. I'm confused...

@Jack Although null is not really the unit type because of casting and stuff
 
12:30 AM
@hakre WTF are those "webservices" I see in those idiotic comments?
 
@PeeHaa no clue, but I'd say that question deserves a simple on hold. user is too lazy to learn how that works I'm pretty sure.
 
Obviously it should be on hold :) Just thought it was odd / fishy that three commenters came with the same non existent technology :P
 
@hakre incrementing null should TypeError probably
 
stackoverflow.com/questions/20793119/… << is that a 10.k user question?
 
@BenjaminGruenbaum in PHP? that would make the world fall apart.
 
12:34 AM
@RonniSkansing 374Q and 21A ...
 
In JS null+1 is 1, and undefined+1 is NaN
quirky and silly.
 
@HamZa thanks, i will check that next time
 
@HamZa ow lol just commented the same
 
@RonniSkansing The funny part is when you click on some of his "most voted answers", you'll see that he's answered his own questions ...
 
@HamZa lol great, i will do that now
 
12:35 AM
That's the type of person I hate. Asking so much without giving back ><
 
asking a lot is good if the questions are high quality.
I'd rather have more users asking interesting questions than more users answering bad questions
Rep whores that google-paste answers are a lot worse than people ask interesting questions.
 
@BenjaminGruenbaum hehe nice point of view ...
 
Though that guy you linked to is pretty horrible indeed :P
 
makes me feel better about my below 200 points
lol
 
12:41 AM
I am starting to think that instead of passing a session object to my controller and to whatever else needs it I should create a mapper for it... Is that a sensible approach? If so, what about flash message storage?
 
user image
3
 
hehe
Well thanks for the talk and wise minds. Have a great night guys, I am going to bed. Have a good one
 
blah
 
user image
6
^ another reason you should take care console log is always clean ^^
 
hehehe, I loved that one
 
1:00 AM
Ah golden !
 
1:28 AM
God, Java questions are so horrible stackoverflow.com/q/20793412/1348195
restores faith in tags like js and php :P
 
2:28 AM
woah github support is fast
 
3:19 AM
3
A: Getting the first sheet from an Excel document regardless of sheet name with OleDb

MarcoSee http://stackoverflow.com/questions/1164698/using-excel-oledb-to-get-sheet-names-in-sheet-order

Wow, some way to gain upvotes for referencing another question.
 
@Jack I remember 1 algorithm I've read in a math book in 5th grade of primary school
 
I can't remember whether we actually learned such an algorithm in primary 5 ;-)
 
It wasn't a school book but just a book with interesting math challenges
 
Ah, this one is pretty approachable, though.
 
the one I remember is suitable for manual calculations on a paper
it's like: x^2 = y^2 + 2yz + z^2
where x^2 - is a given number number
so x - its square root
y^2 - is some number less than a given one
z^2 - is something we may omit because of it's small
then we just calculate 2yz = x^2 - y^2 and find some z
then repeat until get required precision
 
3:38 AM
It has some similarity with Newton.
 
Hello, room.
It's been a little while.
I hope you are all enjoying your holiday season, whatever the reason it may be.
Happy holidays, cryptic.
 
@LeviMorrison can you fix this typo us1.php.net/manual/en/language.types.array.php#example-86 I do believe it should be 'hello' instead of 'hallo' in the example code and output. Nothing serious =oP
 
... do you really not have more pressing things for me to fix?
lol
But yes, I'll fix it.
 
147
Q: Where is the best place to put <script> tags in HTML markup?

mipadiWhen embedding JavaScript in an HTML document, where is the best place to put the <script> tags and included JavaScript? I seem to recall that you are not supposed to place these in the <head> section, but placing at the beginning of the <body> section is bad, too, since the JavaScript will have ...

Hmm, I personally find the accepted answer way too generic to be getting so many upvotes.
@crypticツ No, it must be Dutch! =p
PHP must be inclusive to all languages, just like how double colon is still in (broken) Hebrew :)
 
:)
Hey Jack, would you back an RFC to remove ; as a case statement separator? Just gauging general interest ^^
 
3:53 AM
Example? Do you mean removing the ; behind break?
Or generally, as a statement separator?
 
As in:
switch ($var) {
    case 0;
    case 1;
        // the semi-colons are valid
        break;
    default:
        throw new Exception("Not 0 or 1");
}
 
Why is there no ; after default? :)
It looks really bizarre now, btw haha
 
Because I can't stand using it in too many places ^^
My overall goal is really to simplify the PHP grammar; it makes it easier for people writing tools.
In my opinion good tooling is essential for a language/platform to succeed.
 
Not sure whether trolling or serious ...
 
I realize this particular case is rather uninteresting and doesn't really help that much.
 
3:59 AM
I think the : should be replaced by
 
@crypticツ Fixed.
 
case 0 → break;
See how nice that looks? =D
 
It's great, Jack. Really great.
 
Thanks :)
 
4:09 AM
But, but ... what about $ab = 123; echo "${'a'.'b'}"; :)
That would totally wreck my workflow heh
 
^^
Do you know what the php result on techempower is? techempower.com/benchmarks/…
Is it an average for all projects of a language or something?
 
Woah, what's this then.
Hmm, Aerys is missing as a possible FE.
 
It's not even public yet ^^
 
hehe
wow, slim has some serious latency issues when it comes to database access.
senthot.com <-- anyone seen this?
 
Yes, have just seen :D
 
4:23 AM
How the heck does that go faster than php-raw? I've got no clue.
That benchmark is just hopelessly confusing and it seems not moderated.
 
maybe they compiled that framework in to php extension and written by C :D
 
@Jack I'm actually going to contribute to that repo.
o.0
Going to clean up the PHP submission because it doesn't follow some of the requirements; how shameful.
 
You mean this repo?
 
Yeah.
 
4:36 AM
Is it a requirement to use persistent db connections?
I don't think that be a good practice ...
 
Eh, they aren't using async queries at all.
If I was really querying 5 or 20 different things per page I would be using async queries.
 
That's only available for mysqlnd I thought?
Certainly PDO doesn't support async.
 
@Jack Yes, but if I'm really using 5 or 20 queries per page then I'd definitely use whatever necessary to get async queries lol.
 
Well, for sure :)
 
I am not sure what driver they are using.
They don't say.
 
4:42 AM
The use of bindParam() is kinda silly actually.
 
4:56 AM
Well, supposedly you are safest if you specify the data-type.
I've always just passed an array to execute.
 
Safe shmafe.
 
@Jack It seems you cannot issue more than one async query at a time for the mysqli driver o.0
Seems fairly useless to be async if you can't actually, you know, use multiple queries.
 
Then ... why is it there in the first place?
Exactly.
 
Yeah, I don't get it.
 
Wait wait, didn't they give a usage example of this?
It seems that you can loop them and then use poll().
 
5:08 AM
In the docs it keeps mentioning out of sync errors and such if you try it.
I think the key is that those are 5 different hosts?
 
Oh
 
Bah, it may just be the the user comments and examples just suck.
 
Wouldn't be surprised ... but I think you may be right about the multiple hosts requirement.
 
N2P
hello, anyone has worked with MQTT and SAM ?
 
It seems you have to use one connection per query?
All of the examples doing multiple queries do this, even if they connect to the same host.
 
5:23 AM
@LeviMorrison Yeah, because each connection is not multiplexed.
That would be ideal actually.
 
So basically all DB drivers for MySQL suck at async queries.
 
Each query would be able to run on a separate channel.
How does Postgres fare in this?
 
Much better.
rdlowrey and I actually have been modifying ext/pgsql so you can have the socket in PHP-land.
You can do multiple async queries without that, but the socket allows nice integration into libevent.
 
So, Postgres supports multiplexing then? :)
 
5:29 AM
That's nice ...
 
Well, maybe.
It only uses one socket for multiple queries and allows you to get results back nicely.
I don't know that it supports multiplexing; I assume it is required for that to work.
 
It seems that the result sets basically tally with the query sets.
But it wouldn't be possible to, say, get the result of the last query back first (if it finishes first).
So, it works more like an asynchronous queue from what I can tell.
 
I'm not sure on that; I'm very new to postgresql
 
Based off of this.
 
Oh, that's garbage.
 
5:32 AM
lol
 
We had to make some internal improvements; see rdlowrey's branch for details.
 
I see .. well, I know even less than you about PG heh
Async all the things!
He should use more macros hehe, this gets repeated quite often.
 
5:55 AM
> Changing the reporting mode is now be per-request, rather than per-process.
That's some superb grammar, PHP.net.
 
That's perfectly legal lolcats grammar.
Or ye olde pirate grammar.
> Changing the spanking asslicking mode is now be per-request, rather than per-spanks. -- according to pornolize.
 
6:34 AM
@Jack I have async mysqli working.
It actually worked first try.
I love it when I do that.
(The time delay was getting a new PHP version built with all my deps ^^)
 
Oh yay!
So it does support multiple queries over the same connection then?
 
m59
When used in pairs, it's the Manga operator: ^_^ Not to be confused with o_OPekka 웃 Sep 1 '10 at 13:13
lol
 
hehe
var o_O; or private $o_O;
 
Morning.
 
Hmm, array_map(<=>, $array) ... hehe
 
6:49 AM
@Jack Haven't tried. I just used multiple connections.
 
Ah
So still not as nice as PG then hehe
 
@rdlowrey I'm having issues with Aerys on leviathon; is ext/http v2.x not compatible?
 
If my answer is misleading, let me know so I'll delete. ^
 
For now I've switched back to 5.5.1_gcc-4.7.2 instead of 5.5.7.
@Jack Going to try using one connection.
 
cool, preparing for the potential good or bad news heh
 
6:56 AM
> Commands out of sync; you can't run this command now
What a horrible piece of garbage.
 
$ sapi/cli/php -r '$a = true; var_dump(--$a);'
bool(false)
=D
@LeviMorrison Ah ... that's sad =(
 
var_dump(o_O ^_^ O_o); //string(1) ""  WTF??
mornings
 
Hmm, oh yes, haha
 
@AlmaDo huh? morning, btw.
 
@AlmaDo Hmm, I get something else btw.
I get 0x7f ... in binary.
 
7:01 AM
that's it string representation I guess..
hi, @Leri
 
@AlmaDo Well, it's the DEL character heh
 
(:
 
This yields the same: o^_^O
 
hehe
 
7:17 AM
morning
 
morning, @JoeWatkins
 
Funny that o, _ and O would have this particular property :)
 
@Jack @JoeWatkins Either of you used the built-in PHP cli web server on a domain before? Like, something other than localhost?
 
@LeviMorrison Yeah, but still internal.
 
7:27 AM
Meaning?
 
Not publicly available :)
 
Right, I'm trying to make mine publicly available.
But it doesn't seem to be listening correctly or something
 
Famous last words? :)
 
No, I am aware of implications ^^
 
hehe
is there something else already listening on the port?
 
7:29 AM
I have Apache and Aerys on the machine already; it's not like I'm starved for servers.
@Jack No.
 
So there are no bind() errors basically.
 
$ sudo php -S leviathon.homenet.org:80 -t php
PHP 5.7.0-dev Development Server started at Fri Dec 27 00:29:05 2013
Listening on leviathon.homenet.org:80
Document root is /home/levijm/Projects/FrameworkBenchmarks/php
Press Ctrl-C to quit.
 
It's possible that it doesn't want to bind on 0.0.0.0 by default?
 
I've tried localhost:80 as well.
 
7:30 AM
What says netstat?
 
Any one know about the Tigo money
 
@Jack A lot; what do you want me to grep for?
I'm not quite sure what you are looking for ^^
 
sudo netstat -ptan|grep php
 
$ sudo netstat -ptan | grep php
tcp        0      0 127.0.1.1:80            0.0.0.0:*               LISTEN      20400/php
 
7:33 AM
127.0.1.1 ??
Surely, localhost doesn't point to that hehe
Not allowing null values to get incremented breaks 12 test cases haha
 
Odd
My hosts file:
127.0.0.1       localhost
127.0.1.1       leviathon.homenet.org
But leviathon.homenet.org works under Apache and Aerys.
 
Yeah, the latter hostname should "just work"
What happens when you try to connect with browser?
Or curl
 
Connection refused.
Firewall?
Better delete it then.
 
Well, the router has some firewall; but it doesn't discriminate on port 80
 
7:38 AM
hmm
 
It's how aerys and apache both can work.
Stupid CLI server :(
 
Well, according to netstat it looks okay
Connection refused is the host OS response.
 
Stupid PHP, can't even download files with it! >:(
 
Yeah, (s)he should definitely learn another language.
 
Hmm...
My code doesn't run anyway.
Somehow it doesn't find mysqli o.0
It worked on the CLI just fine.
I hate dealing with various SAPIs; I don't miss this part of web dev ^^
 
did you previously compile the server without it?
 
@LeviMorrison I never have, what's the use case ??
 
When I run php dbraw.php it works correctly.
Via the built-in web server it can't find mysqli_report; probably because the extension isn't loaded.
 
A simple phpinfo() should reveal that.
 
7:45 AM
hm, there should be no functional difference between cli and cli-server, serve up a phpinfo() output and see if that leads you anywhere ?? possibly ini paths or something aren't set ...
 
@AlmaDo Probably used to Haskell where if is an expression :)
 
@Jack well, since second letter in PHP abbreviation doesn't mean "Haskell" - that code is crap :p
 
@LeviMorrison why are you using that server anyway ?
 
7:48 AM
@JoeWatkins I didn't want to reconfigure Apache or Aerys, but when it didn't work I got curious.
 
PHP is not Personal Haskell Prank?
 
@Jack ..
 
@LeviMorrison the built in server is a bit half baked, they were still adding mime types about a month ago ... it receives no testing, because we say it's not suitable for use ... I've never really found it to be very useful, I have used it before but I'm not sure I'd even expose it to public traffic, I don't think it would be very hard to make it work so hard it could bring effect anything else on a live machine ...
 
For your information, the built-in web server did not load mysqli, as reported by extension_loaded; the cli SAPI did load it.
 
that is strange
they are the same SAPI, there's no logical pathway there that I can see ...
how are you loading it ?? php.ini ?
 
Yeah.
Well
Not really.
I compiled PHP with mysqli support; that's all.
 
that's very very strange, they are the same SAPI module, they both use the same initialization the only difference is when you use server options a different function is called, but the SAPI should be initialized in the same way ...
 
This is 5.5.7 by the way; not master.
 

« first day (1168 days earlier)      last day (3795 days later) »