« first day (1033 days earlier)      last day (3931 days later) » 

7:00 PM
I'm so happy. I fixed by Ubuntu
 
If you declare a function using the syntax: function name(){ }, then it is hoisted, just as in Javascript.
However, if you assign an anonymous function to a variable (supported by PHP versions 5.3 and above), then it is not hoisted, just as in Javascript.
 
function foo($i) {
 return bar($i);
 function bar($i) {
  return $i*$i;
 }
}
echo foo(3);
// Fatal error: Call to undefined function bar()
@Michael PHP 5.3.6 ^ tehplayground.com/#XZjIjtKMB
 
I'm smelling PHP
 
php shit hoisting
 
@rlemon I guess it doesn't work when a function is defined within another function.
 
7:06 PM
function foo($i) {
 function bar($i) {
  return $i*$i;
 }
 return bar($i);
}
echo foo(3); // 9
this is the kinda shit I dislike when working with PHP
I suppose JS is full of them, but I'm used to JS :P
 
@rlemon What I want to know is, why are you declaring a function in a function
 
@Michael makes no difference what my application is, that is not for you to understand. the point is: y u no work PHP?
JS does it correctly.... PHP fail.
 
Does anyone know this,do web sockets store any data on the client side?
 
user1596138
@rlemon What's wrong with this? It makes perfect sense that it'd be 9...?
 
@Jhawins see block above
the perfect sense is that bar is not hoisted
 
7:11 PM
@Jhawins He moved the location of the bar() declaration.
 
in the nested function - outside of a nested function apparently it does get hoisted.
 
user1596138
@rlemon I wouldn't expect that to work.
 
user1596138
You can't call a function before it's defined?
 
you can in js
function decs are hoisted*
 
user1596138
Really? I started with PHP, so I never knew that.
 
7:12 PM
* depending on how they are declared
foo(); // error
var foo = function() { return 'foo'; };
 
user1596138
It's pretty easy to function without it.
 
foo(); // 'foo'
function foo() { return 'foo'; }
sure, it is. but PHP is still stupid
 
user1596138
Yeah that makes sense now that I know. But I would've expected the first one to fail anyway haha.
 
// php
function foo() {
 function bar() {
  return 'a';
 }
 return 'b';
}
echo foo(); // 'b'
echo bar(); // 'a'
// js
function foo() {
  function bar() {
    return 'a'
  }
  return 'b'
}
console.log(foo(), bar());
ReferenceError: bar is not defined
 
@rlemon wat
 
7:15 PM
function scopes - hoisting - none of it is there.
JS has tainted me
 
@rlemon No I mean that makes no sense. xD
 
ahh, so PHP doesn't execute anything past the return statement. I presume this is what is blocking the function from being hoisted.
 
@rlemon I know what you mean.
 
the function scope shit is crazy
 
user1596138
@rlemon I understand why you're so miserable now.
 
user1596138
7:18 PM
I'm used to it. But I end up writing my JS as if it were PHP.
 
Doesn't matter if it comes before a return statement: tehplayground.com/#KpdTfI1eO
 
but this makes no sense
wait. variable scope
nvm
 
user1596138
Ah.
 
why bar() is accessible from te global scope.
 
user1596138
@rlemon All functions are always global.
 
haha
 
user1596138
Yeah, reversing the echos in your playground would throw an error.
 
user1596138
You can't do that in JS. I had trouble with that for awhile.
 
Oh yeah, if you call the outer function a second time, you get an error xD tehplayground.com/#zomYRSlxV
 
user1596138
@Michael Yeah because you're re-declaring the inner-function. You can't do that.
 
7:23 PM
Yeah
 
does someone have any good javascript project ideas?
 
user1596138
There isn't much of a reason to nest a function in PHP. lol
 
user1596138
0
Q: possible JS "file browser"?

aDroidmanWhat I have been looking for is almost like a music player. Where it will display folders (artists) and then display the contents of that folder (music). This will allow for me to upload folders and files using FTP and then my users to play or download the files. I do not need any type of reading...

 
user1596138
Lol "I do not need any type of reading..." He has been told to go back to the drawing board before...
 
@Michael @Jhawins so basically, PHP is stupid.
so so stupid
I need to invent a combustible lemon that I can use to burn PHP down.
 
user1596138
7:27 PM
Eh, I like this way a lot better.
 
I used to use PHP a lot pre 2003
now every time I have to use it, 1) i'm trying to use deprecated methods. 2) holy shit is it ever silly.
I know @RyanKinal knows what i'm talking about
;) ;)
 
Yep. Absolutely.
 
what was wrong with split() ??
if anything split made more sense to me than explode
 
It wasn't explode()
Yeah... but... explosions.
 
lol
 
7:31 PM
@rlemon Use preg_split() instead.
 
Seems a pretty obvious choice to me.
 
there are no many annoying nuances
 
:secretly fears that he's on the "shafted" side of the rift:
 
basically I didn't do any web programming at all (and little programming all together) from late 2006 to early 2010
JS got better, PHP got more funky if you ask me
 
FUNKY!
 
7:33 PM
My problem is that I didn't actually keep up with the new features of PHP. I know that closures kind of exist now, but I have no idea how to use them.
I've heard something about namespaces, but I'm not entirely sure what their purpose is.
And, honestly, I don't care much.
 
i'm sure they don't work like c# namespaces
that would be too cool.
3:33 here
I don't often look down to see that
/back to work
 
user1596138
[tag:tags]
 
@CharlieS Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
He did not know the power of the thumb.
(@SomeGuy)
 
Just running some logic with you guys
 
7:39 PM
I'm still laughing. XD
 
I'm making a php web app to add to my portfolio.
does this seem logical :

    /*
            * Registering the plugins - There are two loops, once for the default pages/plugins
            * and one for the custom installed ones. With the custom installed plugins there is
            * an option in the plugins.ini file that allows you to disable/enable it. This is not
            * the case with the default plugins as there should be no reason to disable them as
            * they are key to the apps functionality.
            */
 
> so basically, PHP is stupid.
 
Zirak: Burned a homeless man with my thumb.
SomeGuy: Wha?
Z: Burned to a crisp.
SG: Hahaha, okay, weirdo.
Z: He did not know the power of the thumb.
SG: I would so star that, if this was on SO.
 
@Zirak And now it is!
 
Is there any way I can use a Mongoose Schema from a different .js file in the same folder?
 
7:41 PM
@Blue Don't see why not.
 
where do you guys chat?
how do you have these private conversations?
who do you talk shit about?
 
user1596138
Somebodies jealous!
 
throw new (function() {
    "bone"; for /*each*/ (dog ="" in yard ="") {
    try { !"to" + "hit" + "the" + window;} finally {
    if (/dogs/) {return this + bone = "then"}}}
    return /to/+(location./*and*/reload());
});
 
@SomeGuy - Sleep deprivation makes even the simplest logic seem alien.
Cheers
 
@rlemon It's a secret.
 
7:42 PM
was there a non-disclosure agreement signed? if not you are entitled, nay, expected to tell me.
 
Zirak: But enough about my pregnancy - we need to talk shit about rlemon.
He's so fat.
SomeGuy: Hahahahahaha
Zirak: And his feet are large.
 
@SomeGuy Perfectly reasonable conversation.
 
@Jhawins ty
@Shmiddty googling "dowry"...
oh.
 
user1596138
!!define dowry
 
@Jhawins dowry Property or payment given by one spouse or his/her family to the other spouse or her/his family at time of marriage. (In some cultures, the dowry is given from wife to husband, in others vice versa.)
 
7:45 PM
in france, it's usually the bride's mother that gives the dowry to the groom
but that was decades ago, noone does that anymore
 
@SomeGuy Fat === pregnant. Large feet === swollen because i'm fat... assholes..
Zirak isn't the only one who got knocked up that night
 
Simultaneous JS Room babies!
 
@NSchleder Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
(function () { return "Hello World"; })();
He's so cute.
 
user2507193
Anyone know how to use anchors within expandable/collapsible jquery lists?
 
7:49 PM
he doesn't do anything though...
 
!$(function() {
  $(document).ready(function() {
    return 'Hello World';
  });
});
i'm considering putting him up for adoption
 
Oh...what an...adorable baby.
 
Why did you cover your eyes when you said that?!
 
user1596138
unwiredview.com/2013/01/17/… //Kind of interesting. Probably not new news to anyone else. I'm behind on Google's stupid (consumer-hardware) ideas.
 
7:52 PM
@FlorianMargaine It's a trick.
 
@SomeGuy care to explain? :P
 
> Yes, we know that Project Glass are virtual reality glasses
 
Nope. :P
 
^ false
Glass is an Augmented Reality system, not Virtual Reality.
 
@Romiox Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
7:55 PM
@FlorianMargaine save 2 chars on your IIFE
 
@rlemon which iife?
 
all of them
idk, it's a jStupid thing I see all the time
 
but... there's no iife
 
@rlemon You don't have one in your code!
 
instead of (function() {

}());
 
7:56 PM
That's what I thought, but you didn't have one, so I was just confused.
There are other characters you can use to turn function declarations into function expressions.
 
don't worry, I know what it's used for
 
it saves two chars and on your (normal) IIFE (that you would use in this case)
 
But () is obviously the most readable.
 
crockford added the option called "stupidity" on jslint to allow that
 
yea
it is pretty stupid
 
7:57 PM
but what I'm saying is that you don't have an IIFE there
 
but people do that instead of an IIFE
 
you non-english people have mis-understood me
@FlorianMargaine yes
 
!function() {
}(); // IIFE
 
go look at half of the jQuery crap
well SORRY mr I fucked up my closing
assholes. jsholes.
jsholes. damn that needs to be a tag on the room
 
7:59 PM
$(function() {
}); // Calling jQuery with an anonymous function. Which is the same as doing:

$(document).ready(function() {
});
 
we are rude bastards.
 
that's what you did ^*2
 
Does anyone know of a way to create video thumbnails using jQuery?
 
listen, pick apart my joke all you want. I don't care :P
you understood me, so fakk off :P
 
yeah
I'm just fucking with you :D
 

« first day (1033 days earlier)      last day (3931 days later) »