« first day (1566 days earlier)      last day (3365 days later) » 

8:10 PM
I have a form with a post method and action to another php page. Once I click submit, I am directed to the new page. I have several variables stored as session variables. If I use session_start() at the top of the page, I am given the error: {Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent...} but if I {var_dump($_SESSION);}, its NULL. Is there something I'm missing on how to pass a session variable?
I assume that error means that I already have an active session
 
@radleybobins there is something else on the rest of the line "headers already sent...."
?
 
@danack it cites the line where I declare session_start()
"output started at URL_REMOVED.php:2) in URL_REMOVED.php on line 2"
 
Okay, seems that my statement that PHP has a stronger OO model than Ruby or Python was ... controversial ^^
For many people it seems that "strong OO" model is the same as "everything is an object". Which ironically is not even the case in Java...
 
@NikiC depends on your definition of OO
"object model" and "object oriented model" are different things
 
I rather like the "everything is an object" paradigm.
Less mental overhead.
 
8:18 PM
@DanLugg is it though?
is it really?
 
@ircmaxell That and what is important to you when writing OO code
 
yup
 
@ircmaxell I think so, easier to make assertions about what things "are".
 
@DanLugg how do you figure?
 
Value types are just immutable
 
8:18 PM
I put a lot more value into being able to enforce certain preconditions using interfaces and type annotations than being able to dynamically monkeypatch all the things
 
@NikiC I'd argue monkeypatching is not an OO paradigm, but procedural code via methods
 
Monkeypatching as in Ruby's monkeypatching?
 
yes
 
yup
 
Yea, it's a powerful feature, but I dunno...
 
8:21 PM
powerful, and evil
 
I have the feel that if you define a class in Ruby you get 5% the code you write and 95% is just magic.
 
^^
 
just like another language operator: goto. Powerful, and evil
 
Powerful and eval()
 
OK, I'm off to the beach, later
 
8:22 PM
Later!
@NikiC eval'ing a monkeypatch, there's some fucking magic.
 
y'know
Being able to have copy-on-write classes would be awesome
Like, PHP 4-style
 
eval("goto {$_GET['evil']}");
 
@AndreaFaulds like structs that need to be explicitly passed around by ref?
 
@AndreaFaulds ah ... no
 
@DanLugg Sorta.
 
8:25 PM
@DanLugg I prefer everything is a value.
 
if you want immutable, do proper immutable
 
@NikiC Why not ;_;
@NikiC That's rather inefficient, though
Especially for larger chunks of data
with each modification, a new allocation
 
Reference types all the things, method definitions promote immutability
 
@Narf looks like the default phar stub
 
@marcio Not familiar with it
 
8:28 PM
class Int implements Numeric {
    private static extern function doAddOp(Numeric $a, Numeric $b) : Numeric;
    public static function __add(Numeric $a, Numeric $b) : Numeric {
        return self::doAddOp($a, $b);
    }
}
 
private static final extern abstract friend const function doAddOp()
@DanLugg I corrected your typo
 
Ah, thanks.
final inline extern static internal friend partial abstract const function __magic();
 
@NikiC missing zend_always_inline and void*
 
What's the friend modifier? ^^
 
s/friend/fiend/
 
8:32 PM
@bwoebi C++
 
@NikiC but C++ is not your friend
 
basically you can allow friends to access your privates ;)
5
 
lol, hmm, I think employing that policy is why I have so few friends.
 
OH @nikita_ppv: "Basically, C++ allows you to give friends access to your privates"
 
Insta.
 
8:34 PM
yeah
my phone buzzed right away
 
lol
 
FYI somebody asked for friend on bugtracker bugs.php.net/bug.php?id=34044
> I would strongly urge the PHP dev crew to reconsider adding a friend declaration in a future version of PHP. Allow friend classes to access protected, but not private, properties and methods - similar to inheriting classes. This will allow for the development of complex, multi-class modules that expose reasonable and well designed public interfaces.
 
@marcio The real question is, if your friend is in class Bar, is he really your friend?
 
@Machavity well I have a low bar for programming languages, but not for friends
 
If he's buying drinks, yes.
 
8:39 PM
@NikiC why… why…
 
besides, the person said "complex, multi-class modules that expose..." so he/she is probably wrong.
 
@bwoebi it's useful in some cases, actually
If you need to tightly couple the implementations of two classes yet not have them share a common base class
 
It is…
 
@AndreaFaulds why not go for inheritance?
 
@marcio because they have nothing in common…
 
8:41 PM
that
It was useful to me when I needed to wrap a shitty C API
 
like a Connection class and a Resultset class. And you don't want to have a public API to feed data into the Resultset.
 
there was like, a View class which could have an Image added to it
wrapping some C function like view_add_image
You want the View to be able to get at the Image's underlying handle
 
I think most of the uses of friend classes can be solved by inner classes.
 
But the View and Image otherwise must have nothing in common
 
@bwoebi oh, good example (not saying I link friend modifier)
 
8:42 PM
@LeviMorrison Or private classes?
 
Or as in Java does it and have package-level private, and normal private.
 
@LeviMorrison Ooh.
 
@marcio What I do in this case is binding a Closure to that class and use it to access the private API.
 
@bwoebi ewww
An option might be an abstract cl- wait, but I want it to be private to the module :1
 
Why ewwww?
 
8:45 PM
@AndreaFaulds that's the currently cleanest way
 
@bwoebi Super-hacky...
 
You don't even have to bind it
 
@AndreaFaulds not very hacky.
 
Just return it from the class that you want private access to\
 
How can I convince my client to use PHP where he wants to use Python for a website project. The project has a REST api and Payment system. There will be community inside it (like forum etc). I am quite equal experienced in both. But when it comes to website I want to use PHP. It has many good frameworks and solution to a lot of common problem exists already. But when it comes to python there isn't that much frameworks. I mainly use python for running tasks, celery, scrapy etc.
 
8:46 PM
@nikita2206 Then I implictely expose the private API…
 
@shiplu.mokadd.im There are a few good Python web frameworks
Flask, Django, etc.
 
@shiplu.mokadd.im Quote him three times the price for a python version.
 
not hacky at all, this is predicted by closure binding implementation
 
@shiplu.mokadd.im why not a mix of both then?
 
@AndreaFaulds There is actually one. DJango. Recently Flask. I used both. Maintaining Django app for about 3 years now.
 
8:47 PM
@bwoebi if we talk about Connection, ResultSet example then you return from Connection something like new ResultSet(function () { return $this->doSomething(); });
You won't expose it
 
When it comes to PHP it wont be a one name. You'll name at least 3 very good framework.
or 5 may be
 
@shiplu.mokadd.im oh, really?...
 
@AndreaFaulds looks like this:
\Closure::bindTo(function () use ($data) {
    $this->feed($data);
}, $resultset, ResultSet::class);
which doesn't look too awkward…
Reflection was much worse.
 
@salathe try name some.
 
@shiplu.mokadd.im Ok, here's my list of very good PHP frameworks…
 
8:51 PM
Here is mine:
 
but... what about codeigniter
 
:D ^
 
@bwoebi Ew.
My list of good PHP frameworks:

* yolophp
 
My list of good PHP frameworks:
looks empty…
 
you forgot yolophp
 
8:54 PM
lolphp?
 
(As long as you don't consider Amp/Aerys etc. a framework)
 
I would actually add Laravel, Kohana, Zend,
 
There's Yii that uses arrays for EVERYTHING :D
 
THese are my personal preference.
 
8:55 PM
@DejanMarjanovic le funny original joek
 
But there are more
Yii, Symfony2
 
@AndreaFaulds Had a proper laugh at John.
 
@shiplu.mokadd.im echo Zend->is()->not()->a()->good()->framework()->exclamation
 
@shiplu.mokadd.im if you like a lot of boilerplate there are the micro frameworks too.
 
@Machavity Dont want initiate a fw war. I believe thats your personal opinion.
 
8:58 PM
@shiplu.mokadd.im So is your list ... everything about frameworks is a personal opinion
 
@shiplu.mokadd.im Meh, Meh and Meh as a "MVC" framework.
You know you know framework when you start to hate it.
 
Also, Symfony is now just a black hole, the appalling remainder of a code supernova that exploded and breed the universe with heavy composer packages now used as building blocks for other frameworks.
 
So true…
 
9:19 PM
@bwoebi ones never knows what happens inside the bundle system because of the singularity of YAML files being compiled to arrays so enterprise systems can have at least 400ms response times on hello world benchmarks.
 
(though, I wonder… how much time is an application really running and how much time is it in stuck mode, fetching I/O?)
 
400ms on dev environment?
 
needing 400 ms is one thing, needing 400 ms processing (CPU) time is much more critical…
@MarcelBurkhard 400 ms is far too much in dev env too.
 
well in dev it compiles all twig templates first ...
and reads all yml files
etc.
on every request, live
 
why that?
 
9:26 PM
@MarcelBurkhard I'm just joking, in the end it's all a trade off
 
from all bundles (including vendor)
@bwoebi because dev mode is for development as in you want to see what you've just done without clearing the cache all the time
don't know if checks filetimes
 
@MarcelBurkhard yes, sure… Then do stat() checks in dev and cache…
 
yeah it still needs to check filetimes on a lot of files
you ever used APC with stat 0 ? You'll know the difference
If you put the files on a ramdisk it'll also be a lot better I'm quite sure, I don't think its 400ms CPU time
 
9:44 PM
how much CPU time in prod?
 
ask @marcio
 
@bwoebi At least in part that's why Symfony's 'every thing is done through a single event manager' sucks. I'm trying to find a bug report, but there was a guy complaining that his code was slow.....because 1200 classes were being loaded for each request.
 
@bwoebi from ~40ms to ~120ms (that involves database interaction etc). But most if it is autoloading.
 
1200… You're serious…?!
 
@bwoebi if you a lot of bundles you easily get that number, autoloading...
 
9:49 PM
@bwoebi No......all of the events are done through a single event manager, and because a lot of things could need to process api.symfony.com/2.5/Symfony/Component/Security/Http/Event.html then they all need to receive the event.
 
@MarcelBurkhard still… how many bundles are that? 80?
@Danack that's so flawed…
 
@bwoebi Laravel is actually a good trade-off + for optimization it dumps framework's core classes that are loaded every request into a single file.
 
@bwoebi I know - and it seems a deliberate trap. Fast initial development and system processing times, and it's only 1 year down the road when you've written a years worth of symfony code that you realise how fucked you are.
 
@marcio it's not the number of files that matters... Opcache handles that
 
@FlorianMargaine For 1200 classes, it's still a slowdown factor.
 
9:51 PM
For the 1st request, yes
 
I mean loaded and instantiated....not just in memory.
 
@FlorianMargaine (in case no opcache :), but there is no excuse not to use it I guess)
 
Are we going to use build systems like in js for php code now? :D
 
@FlorianMargaine no, not just then. Upon each request, opcache still needs to copy the op_arrays, do pass_two() on them, copy all the hashtables of default properties etc. etc.
 
Okay, anyone have a good color for a wall in my office?
 
9:53 PM
@bwoebi that depends on the classes, not the files tho, no?
 
@LeviMorrison white… maybe a little bit yellow, but really not too much…
 
Right now they are all white with grey shelves and fairly neutral carpet with blues and browns in it.
White is a no-go.
 
@FlorianMargaine on the classes.
 
The purpose for painting isn't just for aesthetics; too much white is hurting my eyes during interviews.
 
9:54 PM
for the core classes symfony does the same, so no advantage from laravel there
look at the file bootstrap.php.cache
 
By 'too much white' do you mean 'too much cocaine' ?
 
actually I think its generated at some composer afterUpdate event
 
@bwoebi so laravel's idea doesn't matter...
 
@Danack Most definitely I do not ^^
 
@FlorianMargaine laravel still doesn't provide sooooo much classes.
 
9:55 PM
@LeviMorrison I personally prefer a warm peachy white....I think if the white is hurting your eyes it sounds like a problem with the lighting level, rather than the wall color.
 
Another problem with Synfony, at least last time I actually check some internal code, is that sometimes it uses too much exceptions to control flow execution. The exceptions need to gather stack trace.
 
@Danack It's not just the overhead lights.
It doesn't affect me when I'm not looking at the whiteboard + white wall (such as when I'm working on my computer.
 
@marcio that's not only an issue of symfony…
 
But during the interviews I have difficulty looking at the candidates because they are in front of a white wall with a whiteboard.
I'm also looking to get more plants in the office to upscale my happiness factor, so I'm thinking maybe earthy colors to match could be good.
 
@LeviMorrison That's a bit weird. Do you have fluorescent tubes as the main light source?
 
9:58 PM
@Danack Yes.
 
of course, but I've seen loop code with try catch blocks AND the catch block were executed many times... actually the useful logic was inside the catch and not the try xD

That's the kind of usage I'm talking about.
 
@LeviMorrison You may be sensitive to flickery tubes....I don't really have a suggestion for how to address that, but I used to have a large headache at the end of the day, and then if I was working late, I would switch the lights off, and the headache would go away almost instantly.
 
i'm sensitive to radio :P
 
@marcio that's the worst, but the issue at its core is that exceptions generally shouldn't control flow. Exceptions should be bail out situations for whole libraries…
 
unfortunately all co workers like listening to radio
 
10:03 PM
@bwoebi in this specific requirement Laravel does a better job.
Let's not even talk about Zend.
 
Maybe. I've not looked at Laravel code since long time.
 
I hate Zend Framework more because when I want to google about the Zend ENGINE I only get zend framework related results. Such a waste.
 
tried -framework?
 
@marcio not sure why you google about the engine at all… lxr is enough…
 
most people call Zend Framework just Zend.
@bwoebi I started to dig inside zend engine a few days ago xD the only updated blogpost I found was on @NikiC blog, so I google a lot
 
10:07 PM
Symfony2: YML or Annotations?
 
@marcio oh okay
 
at least there is this chat room to answer some questions :)
@MarcelBurkhard toml LOL
 
@FlorianMargaine been using yml aswell but the new demo bundle in symfony 2.6 uses annotations, I hate that
 
is the PHP community less github driven?
I see so many crappy js projects with 12.000 stars
 
10:10 PM
nah its just that there is just JS for browsers basically
whereas there is php, rails, asp.net, jsp, etc... for server side web development
so you have way more people working with JS ...
 
seriously? there is this bash project that helps to print horizontal lines on terminal:
github.com/LuRsT/hr ----> 877 stars
and so many PHP projects that do useful things don't even get 200 stars
 
well, php is not hip
 
gotta say, the language isn't really something people want to play with... more like something people are paid to work with
 
I feel like the ratio of PHP people on github vs php user base is smaller than on other languages
 
10:13 PM
@marcio If you want to explore who/what is using a project yasiv.com/github/#/costars?q=LuRsT%2Fhr
 
@marcio that might very well be true, considering that spaghetti code php programmers don't give a damn about github and there are a shitload of those around...
 
@Danack thiziz cool
 
@Danack is there a way to make it only show projects that require given project in their composer.json?
 
https://github.com/php/php-src == 5,235 stars
https://github.com/facebook/hhvm == 10,856 stars

Just sayin'
 
@SaraGolemon with all the respect, I really admire your work, this seems more like hacker news effect
 
10:19 PM
and php-src is just a mirror whereas hhvm is not
 
Does anyone has a small(ish) framework(ish) thing in mind, that could be used in a personal project (so something new, I haven't used before but could use again) to mainly output json (to be consumed by js/java/c#)?
 
@SaraGolemon anyway, I think HHVM praise is deserved
 
@marcio I'm not saying it means anything, but people were talking about github stars :p
 
github stars is a sign of how much it was promoted…
2
 
@SaraGolemon How many PRs compared to PHP?
 
10:21 PM
Probably more :D
 
@SaraGolemon stop promoting hhvm too much… the poor php-src repo… :-D
 
Getting a PR into PHP is not a gratifying process :/
 
Nope ^^
 
@NikiC Yeah, we need to improve php-src's PR process
 
@SaraGolemon BTW, I would contribute much more to HHVM if it didn't take 1 hour burning my poor computer while compiling
 
10:22 PM
@NikiC agree :s
 
@marcio Ooooooh, compile /FASTER/ why didn't I think of that!
:p
 
I just don't know what exactly goes wrong there… I just know that something is wrong there…
 
well, if you didn't use C++, it would compile much faster
 
too late ^
 
@FlorianMargaine Nah, C++ isn't actually the problem
 
10:23 PM
shots fired
 
Full rewrite of hhvm, in pure C <3
 
Ugh, no.
 
@SaraGolemon come on, tell me the compilation doesn't spend all its time compiling templates
 
sorry, but C++ is superior here
@FlorianMargaine It does spend some time on it, but that's not the primary limiting factor
 
alright, trolling over, what is it then?
 
10:24 PM
how do you manage such a slow compilation on a daily basis?
 
only recompile the parts that changed..
 
@marcio they compile it on the powerful facebook servers :-)
 
I've hit make clean (by accident) and gave up of a bug correction 2 days ago
 
@marcio By having an insane dev server.
 
10:25 PM
@bwoebi lol, remotecc (was it this name?) is back
 
@bwoebi yeah, they might have render farms with quantum computers to compile that thing
 
@FlorianMargaine not sure what you mean…
 
Nah, just one box (per dev)
 
poor me :)
 
@bwoebi there is an old program to send the compilation on a remote server
 
10:27 PM
3 mins ago, by Florian Margaine
alright, trolling over, what is it then?
 
@SaraGolemon stand up ^
 
@NikiC talking of which - can you pull this github.com/php/php-src/pull/994/files ? (if you think it's safe....)
It seems an obvious fix.....but I'm always scared of obvious fixes.
 
While talking about obvious: github.com/php/php-src/pull/1035/files
 
lulz
 
I'm just wondering how things like this get noticed after being 12 years untouched..
 
10:41 PM
He says it stops rpmbuild from running - I'm guessing a new version of that tool checks dates validity ....
 
@Rangad maybe zhangjiayin is a savant, maybe the person can say the day of the week of any date until 3025 without even blink
 
@FlorianMargaine Only HHVM devs like @Sara can use that excuse, PHP compiles lightning-fast ;)
2
 
@AndreaFaulds I wouldn't go as far as saying lightning-fast :P
 
@FlorianMargaine ... compared to HHVM
 
☝︎
 
10:51 PM
@SaraGolemon So you have beefy work machines basically? Because if that's the case my beefy home machine can't be too far off spec and it's still what I would consider to be "too slow"
 
@Danack the RFC was updated... I'll keep the name because if I move the RFC now the people who already got the link will see a 404 page :/
 
@marcio That's not good reasoning....
 
@Danack if I move the RFC will there be a redirect?
 
@marcio I doubt it - but people can find it again by going to the RFC page, or just being sent an updated link. Having the wrong name for something that is going to be in PHP for ten years, just to avoid a few people having a 404 today is not good.
 
Holy fuck! It's tah PHP room!\o/
 
10:58 PM
well, the name is just for discussion... most languages have this feature without baptize it of a name.. but but ... yeaa, better move the RFC and put the right name.
 
Good night, good people ... and @PeeHaa
 
@PeeHaa Did you watch the news this evening?
 
OH
you guys were already talking about HHVM
 
@DejanMarjanovic Hellow balkan
 
seems that I arrived at that joke by reverse
 
10:59 PM
@Danack I may have been drinking. What news exactly?
The Dutch news? :P
BAM BITCHES FRIDAY!
 
@PeeHaa bbc.co.uk/news/world-europe-31051114 'hacker' with gun.
stormed the news room, and then didn't do much.
 
@Danack Yeap saw it
Pussy
The gun looked kewl though
 
Cops much bald, gun much fake.
 
Yeah bitches I haz gun! ok I will drop teh gun!
 
Damn brain stop, English write hard.
@PeeHaa "Whaaat? This isn't mine, I just found it on the floor."
 
11:02 PM
I lolled
IRL
In related news. I am intoxicated where is @DaveRandom so I have someone of my level to talk to :P
 
@marcio I just move them and put in the body of the old page "This RFC has moved to: <address>"
 
Other wikis have proper migration tools, but as far as I am aware ours doesn't.
 
cv with passion ^
 
@LeviMorrison +1 thanks
@LeviMorrison (dumb question, first timer here) when I put a new RFC on a list, it goes to the top or to the bottom?
 
@marcio Top.
And date it please! Not all RFCs are dated and it bothers me ^^
 
@JoeWatkins You had some thought about private class const and/or enums yet?
@marcio Could you please refrain from starring information you found to be uselful
As in you can show your gratitude, but stars are global
 
ok, but tell that for the people who stare rebecca.blackfriday links ;)
 
/me looks at rebecca pinned item. yeah that how i roll
Fuck too late :P
 
Ah, but Rebecca Day is a tradition!
 
11:18 PM
lololol
 
:D
 
pwnd by @PeeHaa
 
Hey @DejanMarjanovic, do you still work at a hosting provider?
 
@PeeHaa Could you refrain yoursefl from booooooze?
 
tbh the asshole was too fast so pwned by @marcio in this case!
Arrrrh. @marcio not fair!
@DejanMarjanovic Sure! Give me a few days
 
11:19 PM
@LeviMorrison Not full-time, there was no vacation time, can't keep up more than a year like that... what's up? :-)
 
I'm doing a side project and was told we need to move hosting. It's not my job necessarily to find it, but they did ask for recommendations.
 
Also: holy fuck @marcio! Dat github commit stats
I think the only person I know that is like that is @Ocramius
 
what commit?
 
> Public contributions
 
> United States USA
php.net myracloud
us1.php.net NEXCESS.NET
us2.php.net Hurricane Electric
us3.php.net C7 Data Centers
@LeviMorrison go Nexcess :-)
 
11:21 PM
@marcio Impressive
 
What specs do you need?
 
Very low space and bandwidth needs.
Email management of some kind would be a bonus.
Need at least PHP 5.6, or permissions to install it (as in a VM or something)
 
@PeeHaa I changed my job 1 year ago and now I have free time for FOOS projects :)
 
@LeviMorrison ramnode maybe?
 
@LeviMorrison Is it a personal thing?
@marcio Noice!
@LeviMorrison As in: for personal use?
 
11:26 PM
It's for a friend's business.
 
Is there a way to custom flag a post after I raised a (maybe incorrect) vlq flag?
 
@LeviMorrison ah k.
@Rangad ping a mod in here. You need to use four @ signs to ping a mod in chat
Right @@@@BoltClock?
 
@PeeHaa haha…
 
:P
 
@LeviMorrison Linode and Digital Ocean are both supposed to be good.
 
11:31 PM
I thought it was just @@ for superping @@PeeHaa?
^^
 
:-)
 
"ou need to use four @ signs to ping a mod in chat" --- is it true? o_O
 
@zerkms Now you know
 
@@@@BoltClock ;-P
 
In totally unrelated news: libre office's excel alternative whatever it is called is really not an alternative at all
 
11:34 PM
MS Office is good enough to not search for its alternative :-)
 
@zerkms Every version before the horrid and incomprehensible ribbon thing is okish
 
I'm used to it (tbh I didn't notice too much of difference)
 
@zerkms I hear several people say just that, but for some reason I am totally clueless where to find stuff with it. Perhaps it is just not Pieter proof
 
It takes some time to change your habits - that's right :-)
/me need to stop "fighting" in SO comments
 
@PeeHaa It's fine, so long as you never need to send or receive a document from someone.
 
11:38 PM
0
A: difference between "defined" and defined in javascript

trex005"undefined" is a string, and undefined is a variable containing the primitive value undefined (Thank you elclanrs). if(typeof x === undefined) should only ever be able to return true if undefined is reassigned to a string matching the type of x.

 
@Danack Meh kinda true, however importing a tab delimited text file screws up in the same way as excel + worse
 

« first day (1566 days earlier)      last day (3365 days later) »