« first day (1622 days earlier)      last day (3312 days later) » 

1:03 AM
@NikiC Pretty cool!
 
That commit looks to me more like annoying changes to make it strict compliant [yeah, that's just my personal unpopular opinion]
 
user895378
@NikiC I have started to come around to this opinion too.
 
user895378
I've been forced to admit that nullable types might actually be useful.
 
I don't deny the usefulness of nullables. I just think we don't need a special dedicated syntax which only handles nullables but nothing else.
 
@bwoebi What other things would you handle by a special syntax together with nullables?
 
1:12 AM
@kelunik I mean … type|null … this will then only be a special case of type1|type2
 
@bwoebi I'd just use Foo? $foo or something like that.
 
Yeah, that's what I don't want.
Also… question: Imagine following debug session
phpdbg> watch $a->b
phpdbg> watch recursive $a
phpdbg> watch delete $a

Should the watchpoint $a->b be overwritten by the recursive watchpoint (and thus removed by the watch delete $a) or should that watchpoint persist? I tend toward the former …
 
1:26 AM
people like discussing things which are totally hypothetical for now… but not the real issues…
 
@NikiC if only to type existing code well, nullables are important
Obviously optionals are preferable, but existing code doesn't use optionals
 
@Andrea what do you mean with optionals?
 
@bwoebi Optional<T>
Like Haskell's Maybe
 
Generics which actually may be passed null directly … that sounds a bit special.
 
what
I never said that
 
1:36 AM
or how do you imagine that to work?
 
it's not a type hint
it's a type you use instead of null
Optional<int> $foo;
$foo is an Optional object
data.Maybe a (Haskell)
 
that's everything but definitely not performant.
 
So? OOP isn't performant
But it makes for better code (usually)
 
@Andrea WHAT?
 
@bwoebi OOP isn't performant.
Purely imperative code with less abstraction will always be faster
If optionals are "unperformant", so is object-oriented programming
 
1:43 AM
Using imperative code instead of OOP is microoptimizing. OOP generally is a way to structure your code. It doesn't really make a performance difference.
It only depends on how OOP is implemented in your code whether it's performant or not.
As you know… you can put OO mechanisms into C (with structs and function ptrs etc.). It doesn't make a real difference to purely imperative code.
But it's definitely unperformant to wrap and unwrap instead of just passing through.
@Andrea It's rather a problem of interpreted languages to not hardcode at which offset to fetch something because dynamic. In a static system you perfectly can optimize OO away...
 
@bwoebi No, it does
OOP is about abstraction
Abstraction comes at a performance penalty. Always.
 
And abstraction is not equivalent to perf decrease.
no.
 
Abstraction always leads to a performance penalty
Perhaps a minor one, but it's there nonetheless
That doesn't mean it's a problem
In fact abstraction is a good thing, usually
 
Whether abstraction leads to a perf penalty is completely dependent on the implementation of the compiler.
 
This isn't true, and moving the performance hit to the compilation stage hasn't eliminated it, you've just shifted it
 
1:53 AM
No, a smart compiler could analyze it and optimize it away (for example by specialized functions).
 
So you've made compilation slower
Abstraction almost always has a performance penalty somewhere
 
Yes. But it doesn't matter at that level.
 
Depends.
 
Sure…
But that requires that you already write a so optimized imperative code that compiler doesn't need to optimize anything.
 
My point is performance does not matter in this case
Optionals are slower than nullables, this is true
Abstractions almost always introduce a performance hit, but it's very unlikely this'll be a problem
 
1:57 AM
Also, where's the advantage of Optionals?
@Andrea agree.
It depends a lot on how you design your abstractions how they will impact perf.
 
bwoebi & Andrea, are both of you on non Windows?
 
@KalleSommerNielsen yes
 
@KalleSommerNielsen yes
 
Just curious, what your test summary is for a: configure --disable-all --enable-cli && make && make test
Windows is just, ugh
For master that is
 
I kinda quit PHP development
there's always a few broken in master though
Almost always
 
1:59 AM
@KalleSommerNielsen doesn't travis already tell you?
 
yeah but some things are platform-specific
stuff will fail on OS X which doesn't on Travis, ditto for Windows
 
@Andrea While I agree with your point, absolutions are not good :-)
 
hmm about 40 fails on travis
wait that was expected fails, 0 fails
 
@ircmaxell That's probably true :)
 
for code that does identical things, the abstraction will be slower than the imperitive version just due to the lack of indirection
however, the code rarely does identical things ;-)
Abstraction can actually open some performance doors that would have been unreasonably expensive with imperitive (due to generalization of algorithms, etc)
 
@KalleSommerNielsen Yep. I sometime get one or two filesystem fails but usually just works.
 
but in general, yes, OO does have a performance cost that we accept as a tradeoff for developer time and productivity, so I agree @Andrea :-D
 
Hmm
 
Yes. The point is just to keep that cost on the not-so-hot paths of your code.
 
Assuming infinite developer time, abstraction always has a performance hit ;)
 
2:06 AM
@Andrea well, that's not a good assumption, is it :-P
 
@ircmaxell Nope :D
 
Optional<T> is not a valid replacement for nullables. Because it affects everything
 
uhhh
@bwoebi please elaborate
 
@bwoebi I said that.
37 mins ago, by Andrea
@NikiC if only to type existing code well, nullables are important
37 mins ago, by Andrea
Obviously optionals are preferable, but existing code doesn't use optionals
 
You can have Optional<T> … But why do we need to support that in core? Userland is enough for that.
@ircmaxell I said replacement and not alternative.
 
2:09 AM
Nobody said it requires core support
Though it is the kind of basic data type that Spl ought to have (and doesn't)
 
@bwoebi which is why I asked you to elaborate rather than to say no :-)
 
[insert rant about how deficient and awful Spl is here]
 
we'd need generics for that :-P
 
You wouldn't need generics but they'd be better for type-safety
 
better? :-P
 
2:11 AM
;)
By the way, if PHP ever does get generics, I think they should be done in a way that allows you to fall back to mixed (possibly at the discretion of the class author)
I mean, not requiring you to specialise your type declaration/construction if you don't need it
No idea if that's practical. But it'd be nice (and in keeping with the PHP tradition) if both List and List<int> would work, say.
 
yeah, class Foo<T>... then new Foo() <- shorthand for new Foo<mixed>()
 
yup
Would mean you could add generics to existing classes :D
(anyway, I should get back to more important things, this chat is a distraction :p)
seeyas
 
@ircmaxell Yeah… you'd exclude code which is meant to be fast (new objects aren't that cheap after all that you could create them en masse…)
 
yeah, agree
 
1 hour ago, by bwoebi
Also… question: Imagine following debug session
phpdbg> watch $a->b
phpdbg> watch recursive $a
phpdbg> watch delete $a

Should the watchpoint $a->b be overwritten by the recursive watchpoint (and thus removed by the watch delete $a) or should that watchpoint persist? I tend toward the former …
 
Anonymous
2:24 AM
@Andrea get self-imposed timed suspension
 
@sam_io hello stranger, what brings you to these here parts?
 
Anonymous
@crypticツ do I know you oO :)
 
Half of the test failures on Windows seems to be related to eol is +1 in length -.-
 
what does watch recursive do?
 
3:08 AM
Hello php masters, can i ask some help again.I just want to know how to do the unit testing in my program, I am still newbie with this word "unit testing" .can you help me how to perform this ?
 
@sam_io oh, your 365 day suspension is over :-D … saw that you recently were on the list of members active in this room…
@ircmaxell a recursive watch… aka set watchpoints recursively on each of the children (means properties in objects and elements in arrays)
 
Ah, nice
 
@ircmaxell yep… may be useful with deeply nested arrays ;-) Question is now just whether it should overwrite prior watches or if they should re-appear upon deletion.
 
Not sure...
 
What would you expect?
I'd say overwriting and leave a notice that it was overwritten
 
3:52 AM
hi do you always do php unit testing ?
 
4:42 AM
morning
 
5:32 AM
Moornings
@jemz yes whenever it is possible
 
hello Intelligent devs
 
@boyee Why do discriminate us, non-intelligent devs? :( /me creates drama
 
lols
 
5:59 AM
@RonniSkansing,is there a good tutorial for using this for a beginners like me,using php unit ?
I already downloaded the php unit via composr
 
morning
 
zan
boyeebird
 
notice me sempai
 
@jemz whenever client pay good , so we can spend extra time on project
 
6:16 AM
hi
 
$products = $params['cart']->getProducts(true);
$nbTotalProducts = 0; what this line do
 
@AddMakes, I think it initialize the $nbTotalProducts to 0 ?
 
ok thanks jemz
 
@AddMakes lol , come on its assignment operator ; you know what it do ;)
 
6:24 AM
mainly i was confused on first line
 
@AddMakes are you coming from C Background ( -> used to be for pointer ) ?
 
@Null pointer i dont have much knowlege of pointer
 
pointer is beauty of C , quite confusing at first and than you love it :D
 
ok
 
@NullPoiиteя Pointer syntax sometimes is ugly… a fixed size array of pointers… or a pointer to a fixed size array…
(I mean things like int var (*)[2])
 
6:37 AM
true
 
That's very badly googleable :x … stackoverflow.com/questions/18662581/…
 
and that is why i am not that good in C :D
 
C has a few mythical dark edge cases… but for most things it's fine ^^
 
hi. need some help with wordpress.
 
6:45 AM
(And sometimes I hate C for being so low-level and allocating memory repeatedly raises big red flags in perf…) In other languages it's just normal and nobody notices.
 
exactly , we have to take care of memory in C more than in any other language but its kind of thing which makes C most powerful
but some time i think i have 16gb of ram and why the hell i am taking care of those bits
 
@NullPoiиteя Oh… we really should have written the PHP interpreter in Java… We anyway have TOO MUCH RAM!
 
With each layer being a bit more inefficient it multiplies…
 
but we know how to add more RAM ( just kidding ) , for large scale application , poor memory management will be worst nightmare
 
6:54 AM
Exactly…
 
7:30 AM
moin
 
posted on March 26, 2015 by kbironneau

/* by flazer */

9
 
^^^ LOL
 
7:53 AM
LOL
 
8:09 AM
Hello.
I need help regarding this Q.
Your code seems some error in it. Please post working code again. and make sure to follow question posting rules of SO. Stackoverflow Formatting RulesTesting 43 mins ago
If anyone is willing to help me I would be greatly thankful. Thanks.
-1
Q: Class not found in C:\wamp\www\system\core\Loader.php on line 303

truеOK, I am new to PHP so I plead you to have understanding. I have made my new application, however I can't figure out why is it complaining about. I get very odd and strange error db->query($sql); if ($query->num_rows() > 0) { $row = $query->row(); foreach ($row as $key => $val) { $this->$key =...

 
@truе if you are new, why are you using codeigniter? ...
 
Need to learn it.
I am new to Codeigniter, not PHP (*)
 
@bwoebi There is nothing about Optional<T> that is inherently bad for perf ;)
 
@truе why? it's crap and outdated
 
@truе you can get codeigniter here or on their IRC
 
8:21 AM
good meurning!
 
I need to learn some logic. Codeigniter was/is great example for it.
 
@truе define logic. and codeigniter is only a great example for writing horrible code
 
get codeigniter help *
 
@ircmaxell i downgraded to php 5.6 and the 64 bit int problem disappeared. unrelated, how about casting syntax in constant expressions const A = (int)(self::B / 4); or/and intdiv() support?
 
Sergey, can't even register there. :-/
 
8:31 AM
actually that could be extended also to similar math functions, fmod() and such
 
@truе please. do. not. use. codeigniter. for. new. projects.
 
Do you have any other suggestion, Patrick?
 
@truе tutorial
if you REALLY have to use a framework (but you don't), then use something more modern than CI. Silex is ok I hear... But seriously, component based development is the way to go
 
OK, thanks Patrick! I will take a closer look at Silex. It's first time I hear about it.
 
@truе no. first you should read the link that I posted...
 
8:55 AM
hi all, got a quick question.. i've got a table full records of name and email and I made a form to be filled in by every record in the table.. but how do i do this? I understand I get the id and generate the form dynamic but how do I send the links of the form to the ones who need to fill it in?
Do i need to generate an url for every record? OR can I do it dynamically
 
This looks very cool @Patrick
 
Good mourning
 
@Patrick the only downside to you approach is that younger developers will miserably fail at making the architecture themselves because they don't know how it's made in any of the frameworks
 
@SergeyTelshevsky but the frameworks are not a good example with their active record models etc
 
@FrontpageExpert Supporting casts would be possible relatively easily
 
9:04 AM
i guess the same wouldn't apply to functions?
 
Nope
 
eheh :P
 
@Patrick doesn't matter, I first started by looking into CI (it was years ago), understood how the whole system worked and downsides of it (singleton, god object, tight coupling, un-modularity), then it was fuelphp (static static static), then there was laravel where I got basic understanding of DI and only then I came to understanding how the approach of building component based apps is better than everything else.
 
@SergeyTelshevsky it took me years to unlearn the bad habits I acquired from CI... :(
 
Need also to note the experience with symfony & zend where you must learn a feking huge amount of their architecture based approaches to even start building a simple app.
 
9:08 AM
I don't think someone new has to go through all the bad learning first that we did
The goal of the tutorial was to avoid exactly that
 
@Patrick I honestly think that this was the best experience for me
 
@SergeyTelshevsky Well it wasn't for me, it crippled me and until I found this chat I thought I had things figured out. But I didn't even know about DI...
 
And not only the concrete downsides, but as a whole process of thinking that something is sooo good but with time you understand that it was all bad. (I thought the god object/singleton approach was really easy to use)
 
There has to be a better way to teach than to start with all the bad things
 
the best experience for me is just writing lots of code
 
9:11 AM
I doubt you'll not do mistakes if you don't know them
 
@SergeyTelshevsky with "CI" you mean "continuous integration", right? Right !?
 
I wrote a lot of code on top of CI, but it was always hard to finish projects and things would take longer and longer. I took this for granted. "That's just how development is".
Turns out it was like that because of horrible coupling that makes changing things hard...
 
@SergeyTelshevsky you will do mistakes, there is just no getting around that - and that's not a problem
 
Like smelly code, you won't even know you have smelly code in your app if you don't know what that is and are unable to recognize it
 
@SergeyTelshevsky which is exactly what happens if you use something like CI. how does a beginner know which parts are bad?
 
9:13 AM
@tereško of course, what else can it be!?!?!?
 
@SergeyTelshevsky that's all stuff learned over time, with or without a framework
 
@Patrick exactly, beginners don't work on big LT projects, that's why it's better to put your shoe in that pile'o'shit before it gets serious. Beginner won't know until the moment they ask a question on SO/forums and get answered with something like "it can't be done in CI", "you'll have to change 123123 lines of code to do that"
@PaulCrovella I don't recommend CI in any way, I only say it's best to start from something like silex as that will at least turn you to a right direction
 
I wonder if there is a way to improve the quality of content in php.lv forum
it might improve local scene
 
making up your own component based structure is harder for the unexperienced beginner than it is for someone who knows what not to do
 
s/harder/impossible
 
9:18 AM
sometimes I have a hard time expressing my thoughts the right way
and you all've been there. you have to make money and build something fast, they don't learn you about singleton's, statics and their alternative "right ways" in universities
 
@SergeyTelshevsky all that time spent learning framework specific stuff could be spent to get better at programming. People just need to pointed in the right direction
 
I only tell this as it's my opinion based on the latest projects I create - I write code and as soon I start to smell something like singleton (my collegue wrote that to get Auryn injector anywhere in the app) I go berserk and kill it with fire before it has babies in other parts of the app.
 
I never went to uni, but I have written plenty of bad code quickly for money. And looking back on it I see what was wrong and what I could do better, so I do things better. Next month I'll see even more, and do even better.
 
There was this one guy who came in here who had no clue. He followed my tutorial and built an app for school which ended up better than a lot of code I've seen in the past. Of course it was not perfect, but I was impressed (stuff that was not in the tutorial)
So I think it's possible even for beginners as long as they have the right resources at hand (tutorial, this chat etc)
 
Most importantly they need intellectual curiosity.
 
9:24 AM
Aaaaaaaaaaaand another year older...
 
Happy PeeDay
5
 
:)
 
@PeeHaa HaaPee birthday!
 
holy sh*t
jsut won 100.000 euros
 
9:28 AM
Thanks :P
 
What I mean is I don't think any newbie will be able to build it the right way
10 mins ago, by tereško
s/harder/impossible
 
@SergeyTelshevsky I would argue there is no right way but a lot of wrong ones. And most if not all frameworks teach wrong ones
 
@SergeyTelshevsky this seems pretty decent for a beginner project wouldn't you agree? github.com/HassanAlthaf/AccountingSystem
 
"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better." - Samuel Beckett
^ sums up my position.
 
9:33 AM
@Patrick of course, how long has he been into php?
 
posted on March 26, 2015 by kbironneau

/* by Sami */

 
@PaulCrovella mine too, the only addition I'd like to add is that it's faster and better to learn on other's mistakes (the whole point I'm trying to tell here)
@PeeHaa so where's the cake?
"You must learn from the mistakes of others. You can't possibly live long enough to make them all yourself." - Sam Levenson
 
@SergeyTelshevsky his first message here was during last summer when he turned 14, so I would say probably not too long :)
 
@SergeyTelshevsky Either you come over here or you will have to do with a picture of cake
 
Thanks to some pal I have fixed it finally.
A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: tour/index.php

Line Number: 92
 
9:38 AM
@SergeyTelshevsky I agree. Which is why new guys don't have to make the same mistakes we did and start with bad frameworks ;)
 
@PeeHaa picture :)
 
@SergeyTelshevsky One moment. Let me finish my coffee
 
is there a canonical "how do I json?" question we can use as a dupe target?
 
looks like today I will be listening to Rishloo as my "programming music": youtube.com/watch?v=gPTI-VC6D5o
 
@PaulCrovella please let me know ... if you find it
 
ThW
9:52 AM
Morning
 
morning
 
fuck, I'm trying to write one up but needing to write it is just too goddamn depressing
 
@tereško ty for the music, I like Tool this sounds similar
 
you're welcome
thought I would say that they are a lot lighter than Tool
 
10:08 AM
@FrankLiepert Yes that should work
 
But it doesn't :) ... tested with current master
 
no, it shouldn't work
 
@PaulCrovella ?
 
the constructor is blindly passing whatever it gets to setID which only takes an int.
 
oh niuce catch
I tought it was using a setter
 
10:10 AM
@FrankLiepert By work you mean it should throw an error, but doesn't?
 
Yeah @PaulCrovella is right
The class file is in strict mode
 
No ... it shouldn't throw an error ...
 
does anyone have a good link explaining how to do the UI in SinglePageApp in a microservice architecture?
 
Yes it should
@FrankLiepert Your second file does the call
$this->setID($id);
Passing a string to a strict int
 
10:11 AM
Sure, but I thought declare(strict_types=0); wins in this case
 
@FrankLiepert the scope of that is only for the file it's in
 
moin
happy bday @PeeHaa
18
 
Happy birthday.
 
Thanks @JoeWatkins @Leri!
@FrankLiepert Also note that there is no reason not to typehint the constructor which would solve your issue
 
10:30 AM
@NikiC As said, nothing inherently. You just can't afford it to wrap and unwrap in hot code paths.
 
my condolences on your birthday, @PeeHaa
6
 
happy birthday @PeeHaa!
 
tnx @tereško @FlorianMargaine :)
 
@PeeHaa How many years left until death?
 
@bwoebi I'm happy I lasted this long
 
10:41 AM
@PeeHaa And that's how long? :-) (aka how old are you now?)
 
31 years
 
omg, such an old fart
(j/k @JoeWatkins :P)
 
@PeeHaa 0b11111 :-D
 
:)
 
@PeeHaa your profile page says something different =P
 
10:55 AM
Yeah. The profile is a lie :)
 
31? Really.
You're ancient... like @rdlowrey
 
hi
 
@Fabor There a loads of people 31 in here IIRC
Now git off my lawn kid
 
So this is a PHP dev retirement center?
 
I'm so old my mom forgot my age on my last birthday.
 
11:05 AM
Yeah pretty much. This is were all old php developers end up to spend their last days.
 
you are kinda right
this room contains really few people under age of 20 .. and same is true for IRC and various development/tech forums
I actually find that a bit worrying
 
@tereško Am I not enough to fill up the under 20 category?
 
maybe they all are in some facebook groups, but I find that both unlikely and scary
 
@tereško :P
Luckily we have bob and nikita in here. Otherwise it would be a proper retirement center
 
somebody has to draw the bingo balls
 
11:16 AM
:D
 
Mar 18 at 13:17, by salathe
All of the coolest people are 31 now. Happy burpday @Joe :)
 
@PeeHaa I notice how you are not disagreeing
 
@PeeHaa counts as cool, now. :)
 
@PeeHaa Nikita is already twenty :-P
 
11:25 AM
@PeeHaa you have to close 31 questions today on the SO cake
 
@PeeHaa Happy birthday....
 
tnx @StaticVariable
@bwoebi I'm more than half older :P
 
You're 1.55 @NikiCs :)
Oh, and happy birthday @PeeHee!
 
buongiorno or good morning
 
@salathe Tnx!
 
11:39 AM
@PeeHaa Appeltaart!
 
:D
 
how can I avoid using die()/exit() when redirecting the user?
 
@SergeyTelshevsky Use a proper response object and just render that at the end of the code
 
I use symfony's response object
 
@SergeyTelshevsky Do you also have some bootstrap file?
 
11:42 AM
sure
 
/**
 * Run the application
 */
$frontController->run($request);
^ that is basically the last line of my bootstrap file
Which renders the response
 
I see symfony's $response->send(); does fastcgi_finish_request
@PeeHaa mine too
 
Then why would you need exit if it is the last line? :)
 
but I need to stop the processing of everything on redirect
 
Why?
 
11:43 AM
like if (fuckup()) { redirectToErrorPage(); }
 
if (fuckup()) { return response object }
Called it controller because I couldn't think of a better word:
 
class ThingThatDoesTheThingWithThatOneThing
$thing->doYerThing($thatOneThing)
 
class God {
    public function __construct() {
        throw new \Exception('God can\'t be created');
    }

    public static function CreateWorldAndDoEverything() {
        // magic...
    }
}
@PaulCrovella This is the proper way to do that. ^
 
@salathe Yea… quantity instead of quality =P
 
:P
 
11:56 AM
public function __destruct() {
echo "Fuckin' Nietzsche, man.";
}
also fuck so chat formatting. this never works right for me.
 
@Leri Magic is bad mmkay
public function __call($name, $args)
{
    $this->ignore();
}
 

« first day (1622 days earlier)      last day (3312 days later) »