« first day (448 days earlier)      last day (4514 days later) » 

user47322
4:08 PM
oh man
 
user47322
php is so shitty
 
user47322
<?php function f() { array_map("f", array(1)); } f();
 
user47322
segfaults as well
 
array_map = call_user_func with sugar, so yeah ;)
btw I would assume that that segfault is alreday fixed in 5.4 ;)
 
user47322
i'll find out
 
user47322
4:12 PM
PHP Function List

archive/2012.php doesn't exist. Closest matches:

ziparchiverararchiveziparchive_open
 
user47322
oh php
 
doesn't look so: codepad.viper-7.com/tNzXMd :(
 
user47322
see the only way to fix it would be to special case the call_user_funcs somehow
 
user47322
so they turn into a regular call that happens on php's fake stack
 
user47322
i guess just one more special case wouldn't really hurt php too much!
 
4:17 PM
how do i specify the bitmask for ReflectionClass::getMethods to only include protected static methods?
 
user47322
rtfm
 
user47322
rtfm*
 
user47322
oh wait lol
 
user47322
there are none
 
@Gordon ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_STATIC ?
 
4:18 PM
@CharlieSomerville there is enough manual to tell you that it has to be a bitmask of ReflectionMethod::IS_* constants. I just cannot seem to figure out the right combination.
@NikiC this will also include public, public static and protected methods
 
@Gordon wtf
 
user47322
oh php
 
@Gordon doesn't make sense to me
sure you did it right?
 
Morning folks
 
@NikiC let me check again
 
4:22 PM
@Bracketworks morning
 
@NikiC PHP manual dilemmas?
 
sup yall, i just got enough street cred to speak
im new to php, pretty good with asp.net. ... in asp.net you can pretty much do anything because you can use c#. is it the same with php?
 
@NikiC and when i do & the result is empty
 
@Gordon obviously
 
user47322
4:26 PM
@user875234 how come you're switching over to php from .net?
 
nope, just expanding my horizons
 
user47322
not a lot interesting going on here :p
 
like i usually use iis and asp but am now using php and apache for a new project
just wondering how much power php has to get the project done
 
user47322
well it's turing complete!
 
user47322
but seriously, there's not really any reason to use php over anything else these days
 
user47322
4:28 PM
especially if you're starting a new project, you're probably better off picking a better technology
 
well i want to learn php. ..could you say, set up an interface on a web page to allow users to chat on irc with php?
 
It probably should do & filter == filter
 
@user875234 likely all the power needed. there is very little php cannot do. it might not do it pretty, but php can do almost everything. and quickly.
 
cool cool
 
4:31 PM
@CharlieSomerville you are so language racist! :P
 
plus if you run PHP on the LAMP stack, well, you've got the full power of Linux.
 
user47322
@NikiC i'm a firm believer in using the best tool for the job
 
user47322
and php in my mind has a very narrow problem domain where its the best
 
Charlie, what are some examples?
 
user47322
if i wanted to setup a script that pulled in my last.fm stream and outputted some info
 
user47322
4:33 PM
i'd use php
 
user47322
otherwise
 
user47322
i'd use something nice
 
@CharlieSomerville narrow = all web development apart from long polling? That's not really narrow, honestly
 
user47322
if i were building an application
 
user47322
i'd use rails
 
user47322
4:33 PM
@NikiC i never said php couldn't do it, i said php isn't the best tool for the job
 
@CharlieSomerville It isn't?
 
user47322
php is a truly terrible language, and if you're building anything that extends beyond a couple of scripts lying around, you should use something better
 
user47322
for your health
 
Why do some people use php, python, rails, linux and other people use windows and .net? I program in .net and I find it is a very practical tool and I have never been limmited by what it can do
 
@CharlieSomerville sounds like trolling to me
 
user47322
4:35 PM
@Gordon i'm not trolling, i'm just speaking the truth
 
@CharlieSomerville then why dont we agree with you?
 
user47322
so in php 5.4, you guys are getting syntax like new Blah()->foo(), foo()[0] and [1,2,3,4]
 
user47322
congrats, everyone else has had that for years
 
user47322
php is playing catch up
 
@CharlieSomerville and?
 
user47322
4:36 PM
and even when php does introduce new features, they're often half-assed
 
none of that missing syntax stopped us from building our applications
 
@Gordon Yep, definitely trolling now.
 
user47322
@Gordon: so is trolling seen as saying something other people might not necessarily agree with?
 
@CharlieSomerville no, trolling is coming into the php chat room and bitching about the language with no proper arguments
 
@CharlieSomerville No. It's perfectly okay to say that PHP sucks, we say that all the time, but only if you have valid reasons to say so ;)
 
4:38 PM
i mean, we all agree that php is quirky and ugly. but its also very capable
 
user47322
all that missing syntax you're only getting now
 
@CharlieSomerville didnt prevent us from gaining 70% market share
 
user47322
what by being easy for beginners to pick up?
 
user47322
ok so php is great because you can pick it up, dump a script in /var/www and you're done
 
@CharlieSomerville So what? It's not like writing list($foo) = foo(); over $foo = foo()[0]; is a mission critical problem ;)
 
4:39 PM
okay
 
user47322
right so all of these little problems
 
user47322
by themselves, aren't a huge issue
 
why should i use php instead of asp.net?
 
user47322
@user875234 i dunno how mono is these days, but it was flaky last time i tried it
 
user47322
@user875234 so i guess if you wanted to deploy on non-windows
 
4:40 PM
oh okay
there's that
 
user47322
anyhow, but all these little syntax quirks add up
 
@CharlieSomerville It's more than just that. PHP is not only easy to get in, it also has a great community, the best documentation of all languages, scales very easily (much easier than Java e.g.), runs everywhere, etc.
 
user47322
and makes php a really awkward language for expressing yourself
 
user47322
how does php scale any easier than anything else?
 
user47322
i also disagree on the doc front
 
user47322
4:41 PM
php has fairly comprehensive docs, but so do many other languages and frameworks
 
user47322
i wouldn't call the php community great
 
@CharlieSomerville Mainly because it doesn't share data between requests (apart from sessions). This makes it much easier to scale to multiple servers
 
user47322
@NikiC plenty of things don't store data between requests
 
user47322
@NikiC that's not unique to php
 
user47322
@NikiC i could grab my asp.net app or my rails app, chuck on another server and boom
 
4:42 PM
@CharlieSomerville you didnt ask for unique. you asked why it scales well
 
@CharlieSomerville I could argue about pretty much anything, but there definitely is no better docs than PHP, that's for sure ;)
 
user47322
msdn is fairly good for .net
 
user47322
rubydoc is excellent
 
user47322
seriously have you seen msdn?
 
4:43 PM
@CharlieSomerville I have and I always hated it ;)
 
user47322
@NikiC it's terrible for the winapi and stuff
 
user47322
but for .net it's brilliant
 
its fairly decent, java is pretty good too.... but i learned from a noob on up and its useful enough to make something happen
 
user47322
 
4:45 PM
@CharlieSomerville msdn got better over time though, it now starts to match up to PHP quality. Then again: I could argue "you are getting good documentation only now, we had it always", just like you did with the syntax. So ...
 
@CharlieSomerville may i ask which framework you consider your favorite?
 
user47322
@Gordon: if I had to pick one I'd say rails
 
@Gordon oh, good move
 
@CharlieSomerville yeah, that figures, because your attitude is totally railsy
 
user47322
lmao
 
user47322
4:47 PM
rails people just like to feel ~superior~
 
user47322
but it's not just that
 
user47322
i do a lot of non-web development as well
 
user47322
and i use ruby primarily
 
user47322
i've used plenty of languages and ruby is the one i have the most fun using
 
user47322
but we're not arguing why ruby is good, or why $x is better than php, we're arguing whether or not php itself sucks
 
4:48 PM
but what can ruby do that c# can't?
 
user47322
@user875234 nothing
 
so why use ruby?
 
user47322
preference
 
user47322
i used to use C# until my windows hard drive borked
 
should new developers use ruby or c#?
 
user47322
4:50 PM
so i swapped over to OSX and found C# a pain to use so I gradually moved away
 
@CharlieSomerville Let's say it this way: People don't like it if you come into a PHP chatroom and start flaming about PHP. There is a reason that we all are PHP developers and not Python developers and not Ruby developers and not Java developers. PHP simply is a language that is a very good business choice. Probably better than Ruby or Python. I don't know the exact reasons, but the mere fact that PHP is the most widely used language for the web shows that clearly. The market is always right...
... and the market says that PHP is good ^^
 
@Gordon Not web specific. Web specific should have PHP at the top
 
user47322
anyhow
 
user47322
i'm gonna log off
 
user47322
4:51 PM
almost 4am
 
user47322
thanks for the great work with php-parser nikic
 
@CharlieSomerville night
 
nighty night
 
user47322
oh hi
 
user47322
@zzlawlzz
 
4:53 PM
@NikiC should I file a bug request for the ReflectionClass::getMethods()
 
hey @CharlieSomerville
 
Hello hello hello.
 
@Gordon I asked on .pecl but nobody replied :(
@CharlieSomerville Oh, we are one age ;)
 
hi
 
4:57 PM
@hakre done
 
ha
<?php class c { static function f(){ forward_static_call(array('c', 'f')); } } c::f();
segfaults
 
@NikiC thanks
 
what is the correct behavior for ->current() if there is no current?
exception, null, false?
 
@NikiC null i guess
 
5:03 PM
@NikiC According to docs it returns false: php.net/manual/en/function.current.php
 
but that's function current, method current could be anything
 
ah touche
 
and documentation is not very clear apparently... there is only one way to know
 
5:04 PM
@nikic its not listed what it should return when there is no current. but when is that going to happen anyway?
 
@Gordon many calls
 
$it = new ArrayIterator(range(1,2));
$it->next();
$it->next();
$it->next();
var_dump($it->current());
gives NULL
although I guess it could raise an Exception for the internal pointer being out of bounds
 
hm, wondering which exception to throw
for a stack / queue / dll
 
1
Q: Nginx & PHP5-fpm + CodeIgniter or Kohana = 404 error?

zzlawlzzOk, this is not a rewrite error because I did not touch the conf file. I used http://www.farinspace.com/install-and-configure-nginx-server/ to make the web server. The thing is CodeIgniter & Kohana does work on http://url.com/sub/ and http://url.com/sub/index.php But, it does not work with...

 
5:23 PM
@Gordon I'll go with null I think
 
Some iterators throw exceptions if there is no key() or current() (e.g. valid() is FALSE).
 
@hakre The question is what is better
 
I would say to not throw. The multipleirator does because the result is undefined. e.g. one of all is invalid.
so it's valid and not valid. which does not map to bool.
but normally if it's a flat iterator return NULL.
 
on the other hand it could be helpful debug info
 
because there is no current.
 
5:28 PM
Because NULL could be just a normal value ;)
 
could be, but when does this happen?
I mean NULL happens as values.
But when you iterator, when do you go out of bounds?
That normally does not happen.
Otherwise you wouldn't use an iterator, right?
 
@hakre see my example above :) you just have to next() it out of bounds
 
@hakre Not with foreach, but with manual iteration
What would be the appripriate exception to throw?
I used UnderflowException everywhere else
though here probably OutOfBoundsException is more suitable
 
AreYouKiddingException, ItDoesNotWorkException or WtfException
 
So OutOfBounds? :P
 
5:35 PM
@Gordon +1 for WtfException
 
I'll just ask @ircmaxell later
 
@NikiC If you manually iterate, use $it->valid() before you obtain the value.
Otherwise this would not be a manual iteration.
The normal behaviour in PHP is to not throw an exception on next().
 
@hakre you could use while($it->next()) though
 
@Gordon nope, abstract public void next ( void ), see edit: php.net/manual/en/class.iterator.php
 
@hakre But still exceptoins are more helpful, aren't they?
 
5:40 PM
@NikiC: I don't think it's helpful to break with the usage-pattern that de-facto already is there.
 
@hakre oh, right
 
However, I'm a friend of Exception driven programming.
No tests, just exceptions.
The execution is the test ;)
 
@hakre isnt that abusing exceptions for control flow and much slower?
 
But actually I've learned it's an anti-pattern and should not be taken up to the max.
@Gordon yeah it's a poor-mans solution. You should not really do that.
 
Well but current() with no current is a programming error, isn't it? so shouldn't the programmer know of it?
I mean, I would be glad to return null as that's much easier
just not sure whether it makes sense
 
5:44 PM
@NikiC You can always create an RuntimeExceptionThrowOnInvalidIteratorStateIterator that you decorate your iterator with at any later time.
Then the programmer can use it and will know, fully know, that there will be an exception and that it's intended to get an exception.
Until then, I would not expect an exception there, because the internal state of the iterator would not be left in a state that it could not operate successfully any longer.
 
@NikiC actually, it's neutral behavior to return null
 
I would only throw an exception if some external action puts the iterator into a state, that it's internal state is already broken so no recovery is possible.
That would be sort of an Exception.
 
at least when we consider that you would usually not iterate an iterator without calling valid() or foreach
moving beyond existing values is not breaking the iterator
 
exactly.
 
valid will always return false after that so its consistent
 
5:48 PM
and returning NULL for current() seems okay in my eyes as well, because there's nothing for current().
This can differ depending on the type of iterator.
 
great, thanks, then I can save me figuring out which exception to use :)
 
@hakre so I did phpinfo(); and there isnt any $_ENV But i do see all the $_SERVER variables
 
@zzlawlzz: okay, fine. what's the URL of that page?
 
wait should i do phpinfo on my subfolder or the main?
 
does not matter.
 
Check this page: jung3o.com/test.php/test
it's returning 404.
on apache, it would not.
the two frameworks you make use of are making use of that apache behaviour
 
hm
 
but as you're running on nginx, this does not work (by default configuration).
just for the explanation what happens.
so you can understand.
nginx configuration that should cure that is: gist.github.com/383516
 
oh ok thank you
 
however, you need to configure it.
 
5:55 PM
yes, ofcourse
 
learn about all the instructions in there from the nginx documentation.
so you understand what this does.
because you might need to change the one or other value.
and if you first understand how that works, it helps a lot.
you might still need to tinker a bit with it until it runs, you could start with the phpinfo page to get the index.php/test request working for example.
 
is this what you wanted? jung3o.com/test.php/test
 
oh it works! thank you @hakre accepted on the issue on stackoverflow!
 
@NikiC: I would have expected you would use whitespace more wisely like so: list->current = NULL;
;)
@zzlawlzz cool to see you got it running that fast now! congrats and welcome to the league of nginx server tweakers!
 
6:13 PM
@hakre hum?
 
funny. i actually bothered to write a test for the only uncovered line in the distillate writer only to find a bug in it :)
 
posted on January 07, 2012 by Fabien Potencier

Up until now, our application is simplistic as there is only one page. To spice things up a little bit, let's go crazy and add another page that says goodbye: <?php   // framework/bye.php   require_once __DIR__.'/autoload.php';   use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response;   $request = Request::createFromGlobals();   $response = new Res

 
@NikiC be sparse with vertical whitespace, it's distracting while reading, e.g. what's make the one or other part of the assignment that important?
Don't use it to align = under each other.
 
@hakre huh? you don't align assignments?
 
No, I don't divide assignments that way.
 
6:21 PM
@hakre I do :P
 
yes, I did as well ;)
but if you read that again, you'll see that it distracts while reading the code.
it looks nice from above probably, but we don't read in columns the code we write.
it's just not how the brain works.
btw, you don't do it here:
list->current = list->current->next;
list->current_index++;
:)
 
i think im done with InterfaceDistiller.
its stable 1.0.0 now
 
wow
You should enter something here: Copyright (c) <year> <copyright holders>
 
i didnt it on purpose
but thanks :)
i might remove that line altogether though when more people suggest to fill it in. you are the second ;)
 
6:37 PM
well the MIT license does not work w/o copyright holder.
 
@hakre all licenses work without. its by convention
 
Read your own license text, specifically this part: "The above copyright notice and [...]"
If you remove the copyright message, the license would contradict itself.
If you don't fill a name, then I would say there's doubt.
Dunno if you want to have doubt in there.
It might be that you don't want to put your personal name in there, so choose an alias name.
but I wouldn't leave it w/o an author.
 
> Under the Berne Convention, copyrights for creative works do not have to be asserted or declared, as they are automatically in force at creation: an author need not "register" or "apply for" a copyright in countries adhering to the Berne Convention.
> As soon as a work is "fixed", that is, written or recorded on some physical medium, its author is automatically entitled to all copyrights in the work, and to any derivative works unless and until the author explicitly disclaims them, or until the copyright expires.
@hakre i chose not to fill it in because its a collaborative work
i started it but edorian helped out as well
so i'd have to put both names and then probably every name of whoever contributed
and i refuse to play the bump copyright year game
 
@Gordon I can understand that, however writing nothing in there is just not helpful. You don't need to name every author anyway, put your two names in there, done. You can add "and contributors" as well.
@Gordon That's a game I never understood. Folks updating the copyright statement only because there is a new year. They probably have no clue for what that line is good for ;)
 
@NikiC Sup?
 
6:56 PM
@hakre Well theres nothing to align there ^^
 
dinner now. laters
 
@Gordon oh crap, you reminded me that I need to do that as well :( Thought that I didn't have any dates anywhere but the licenses do contain it :(
@ircmaxell Whether ->key()/->current() should throw exception when not ->valid() but we already decided not to ;)
Is there some SO site where I can ask whether it's safe to use MIT/BSD without the copyright notice?
Is that suitable for programmers? Probably not
ah, I think programmers is suitable
 
@NikiC hrm... yeah, I can agree with not
 
@NikiC , are you thing about using code , which has been published under MIT/BSD license ?
 
@ircmaxell by the way, I'm nearly done with Queue and Stack. Only need to sort out ->map() and ->filter() (need to find out how to create objects ^^)
 
7:06 PM
@NikiC what do you need to figure out?
 
@tereško no it's about my own code (scroll up a bit)
@ircmaxell Nothing. Only need to find out how to do it ^^
 
@NikiC new?
 
IIRC , in BSD license the first item is that it has to be redistributed with license notice attached
 
@ircmaxell Yeah. Only in C ^^
@tereško Yes and I wonder whether it is safe to remove that :)
 
Oh
you have queue implemented in C already?
 
7:10 PM
Anybody got a suggestion on this question? stackoverflow.com/questions/8750354/…
 
@ircmaxell Yes: github.com/nikic/SPL-Datastructures/blob/master/spl_ds_queue.c Shares most of the implementation with the stack
 
@NikiC Holy cr@p! Nice work
 
hates C
 
@tereško As in "hates C as C++ is much better" or as in "hates C"?
@ircmaxell I'm proud of it too :P
 
> C : language which combines the power of assembler language with ease of use of assembler language
 
7:13 PM
@NikiC you own the copyright anyways regardless of the number (or name) being there or not and you dont need to bump anything because the year is to indicate since when that copyright exists. i added it to the Distiller now though. dunno why.
 
laters
 
@Howdy_McGee I suggest setting up a CRON job. You don't want each browser to increment the count but to simply increment the count in a normalized fashion
 
cron jobs dont run by seconds :/
the lowest cron job on my server is an increment of 3 minutes
and there's got to be a way to do it without cron jobs if the website linked in my post does it
 
@Gordon What you own and what you document are two pair of shoes. This can even legally make a difference. Just saying, but IIRC in germany you need to state the author for "werke im sinne des urheberrechts" formally.
 
they do it via setInterval / ajax to php file
 
7:19 PM
@Howdy_McGee How do you know they aren't setting up a CRON job?
 
You can as well leave the license file out ;)
 
cause they do it by the second
via setInterval(func, 1000)
:/ i wish i could set a bounty on my question
 
howdy are you trying to count something real or just made up?
what i mean is if you need to add X amount every sec with X constant, you could work it out from timestamp, apologise if i got this wrong
 
7:34 PM
is there something similar to twisted/eventmachine/node.js in PHP land?
Has anyone written a web server in PHP that uses the asynchronous single threaded model?
 
7:45 PM
its counting something real
technically i'm supposed to add 1.5pnds every second
but i figured if I could get it to count 1 every second then 1.5 shouldnt be a big deal
 
@Raynos No. I have only made async requests using curl. That's the extent of it for me.
 
howdy: if you dont care in starting point do something like :( timestamp % (max_limit - min_limit / 1.5 ) ) * 1.5 + min_limit
 
8:06 PM
well i do have a number I have to start at
and then I have to increment up from there
brb googlin timestamp
 
8:33 PM
the number you start at is min_limit - but it could be any point in time
well parenthesis were wrong i was in a hurry
( timestamp % ((max_limit - min_limit) / 1.5 ) ) * 1.5 + min_limit
where min_limit is 1,000,000,000 and max_limit is 10,000,000,000
or 9,999,999,999
 
woah, I think I may have inadvertently found a bug either in SPLObjectStorage, or in non-blocking IO reads
SplObjectStorage it is...
 
@Uboonto I don't understand what timestamp is. All i see on php.net is a bunch of time functions
 
uploaded a phar of InterfaceDistiller to GitHub at github.com/downloads/gooh/InterfaceDistiller/…
 
actually, it is a bug in non-blocking IO reads (either that, or I'm just too fast for it)...
 
8:55 PM
back
@ircmaxell hum?
@ircmaxell Are you really sure that we want methods like ->map() and ->filter()?
I see the point behind them, but I think that then other methods could be called for
like ->reduce() etc
 
Howdy: time()
gives time in seconds since 1jan1970
you divide that huge number by your number, and take the reminder
will be a number from 0 to your huge number - 1
so each second will increase by 1 unit... if you multiply that unit by 1.5 every sec you have 1.5 units increase
so with that expression i wrote earlier you can work out how many units have occurred since a certain moment in time
 
9:24 PM
that seems like it could become a hassle but ill play around with it
 
@NikiC eih, I can see it's quite useful
 
@ircmaxell I can too ;) Only want to make sure that you are sure about it :P
 
9:44 PM
howy: $num = ( time() % ((10000000000 - 1000000000) / 1.5 ) ) * 1.5 + 1000000000;
 
hi all how are you?
 
I guess I just don't understand questions like
-1
Q: PHP | $value = $anothervalue = getValue() - does it have negative influence on performace?

simPodThis question is about code optimalization: What is better for performance and why (the first example is cleaner for human being->programmer->me)? $value = $anothervalue = getValue(); or $anothervalue = $getValue; $value = $anothervalue;

 
Uboonto u should submit that as an answer to my question
( timestamp % ((max_limit - min_limit) / 1.5 ) ) * 1.5 + min_limit
 
well, we could put a generic CollectionHelper together which does things like that to any arbitrary collection... (perhaps not a helper, but some kind of generic wrapper that does it for you)
 
rofl:
 
9:55 PM
@CharlesSprayberry hi Charles how are you doing?
 
 
@LondonBoy Pretty good. How are you?
@hakre Yea, that was pretty hilarious.
 
@hakre: yep, also got it to my twitter. mario rocks ))
 
not bad thanks, how is your project?
 
@zerkms the picture, the face, hugs + kisses @mario
 
9:57 PM
))
 
@LondonBoy Going pretty good I suppose. About as fast as I can go without pissing my fiancé off even more ;)
 
good to hear :) happy new year :)
 
@hakre: do you use twitter?
 
@LondonBoy Same to you
 

« first day (448 days earlier)      last day (4514 days later) »