« first day (1822 days earlier)      last day (3123 days later) » 

6:01 PM
no, the author of the class did
the user didn't necessarily write the class
and just having __toString doesn't mean it produces a substitute for the class's content
 
@Andrea and how that's better than casting it yourself if you are still going to pass the exact same thing as the "implicit" conversion? (I'm arguing only for objects with __toSomeType methods only ofc)
 
@marcio ...what?
 
ok, you will get a nice error message saying you passed an object but if you implemented __toString it means you don't want the error, you want casting.
 
If you want implicit casting, use it. Making an exception to strict_types for objects implementing a given magic method doesn't make sense.
 
Anonymous
6:08 PM
Hmm, protonmail.ch is written with PHP and Javascript
 
@PaulCrovella it actually does, because you specified this behavior and that's explicit enough. It's not really an exception to the rule.
 
Personally I'd probably be fine with __toString passing strict_types
 
@marcio You didn't necessarily specify it though. You specified strict_types, whoever wrote the class of the object you're passing around specified __toString
 
@Danack Nah, YAML FTW
 
@PaulCrovella ... and?
 
6:17 PM
You said "you specified this behavior" - I'm saying that's not the case.
 
what's the impediment to use the object that has a __toString as a string? The behavior is still explicitly specified somewhere.
 
sure, and "5" is explicitly specified to cast to (int) 5, but we don't let that through either
 
so, is "5" an object with a __toInt method? No. Bad argument.
 
huh?
so you want to use strict types, except you want a pass for objects (only) because their conversion happens to be specified... while anything else whose conversion also happens to be specified doesn't get a pass because they're just not objects
it's starting to sound like zeev's proposal
 
Yes, I'm talking explicitly and only about objects with __toString. You brought an example with a scalar value ^^ but I gave my opinion enough already.
 
6:40 PM
@marcio just because an object has a __toString method doesn't mean whoever wrote that class meant for the object to be implicitly convertible to string. Although it might be true in some places, in others it isn't.
class Foo extends string {} on the other hand....
 
@NikiC nice… Closure problems solved :-D
 
@Danack we've talked about this before and my opinion was that this is definitely not a job for extends... but if you insist.
@Danack so whoever implemented __toString doesn't necessarily want implicit string conversion... can you give an example?
 
@NikiC now what about git.php.net/… and git.php.net/… … shall I make them master only? As we're far into RC cycle by now…
 
@marcio any Imagick object.
 
@marcio For example yesterday someone in here was really hot on using __toString() for debugging
 
6:50 PM
having a massive string of bytes where the filename is meant to be is not useful.
 
@NikiC __debugInfo(), hello!
 
ohai
 
That's an incorrect use of __toString(), yes, but people do use it like that and you don't want to implicitly cast to a debug representation
 
Abe
@NikiC ahem.
 
@Abe Sorry, I couldn't remember which name you use this time
 
Abe
6:51 PM
i said it can be useful for many things, including debugging
 
It's annoying if people rename every other week
 
lol
 
@marcio oh, a class that holds AWS secret + key. Even though they can be representing as a string, and there may be a __toString method on the class that holds them, I never ever ever want to accidentally use them where a string is meant to be used.
 
Abe
i'm sorry for that. i'm actually surprised that people put effort remembering who i am. i am the village idiot, after all
 
@Abe It's okay wes.
 
6:53 PM
@Danack so it's just wrong usage of __toString, as you can't tell the concat operator to please do not convert me to string anyway ^^
 
@bwoebi I think dmitry wanted those as PRs for master
 
@NikiC ah those too? well…
 
The property one will probably go in directly, the method one might be slightly improved wrt LSB
 
@NikiC and how?
 
Abe
@Danack <3
 
6:55 PM
@marcio and now you're moving the goalposts. You asked "so whoever implemented __toString doesn't necessarily want implicit string conversion... can you give an example?" You now have two examples.
 
@bwoebi Maybe restructure a tad bit to avoid code size increase
 
@NikiC code size increase?
 
@bwoebi I mean not inlining zend_vm_stack_push_call_frame twice
 
@NikiC hmm, I wonder if it really gets inlined twice or compiler is smart enough to not duplicate common branch independent parts… let me check out the asm…
 
@Danack yes, two examples of wrong __toString usages. The concat operator case is not 'goalpost' and frankly I can't believe you think returning your ASW credentials on a __toString for debug purposes is acceptable.
 
6:59 PM
@bwoebi I don't know either. But I wouldn't be surprised if it is not ideally deduplicated
Also I hate reading x86 assembly
 
@NikiC it isn't that bad… it just has sometimes a lot of instructions/instruction combinations you don't know all by heart
 
@bwoebi It's not so much the instructions, it's the operands
But the instructions as well ^^
 
@NikiC what's the issue with these? src vs dest?
and yes, it's deduplicating the double fcall
 
@bwoebi I feel like it's full of implicit operands ^^
@bwoebi how well?
does it go down to a cmov + and?
 
still figuring out… not that easy to map source and optimized asm
well, not that well
It's deduplicating some things…
yeah, you're right… blows code up too much
compilers… sometimes they're smart, sometimes I overestimate them…
 
7:24 PM
sent an email to internals about the int/integer and bool/boolean issue
 
I just now realized how rarely I have installed FreeBSD while being sober \
 
@tereško Before the start of the install or by the end?
 
start, actually
I think it's basically twice + every time I installed it at work (about 4 times in past 7 years)
 
7:50 PM
I need some ideas...I have a website that I created for my boss at work so that he can view my work for approval. If you hover over any of the project files you will see a tooltip telling you the status of each file.
I have to manually change the status every time something is approved. There has got to be an easier way for me where I don't have to copy and paste the block of code.
 
@benlevywebdesign If only there were some web based coding language that could help you with that...
 
I know, PHP
 
Honestly, it looks like a simple table (maybe SQLite if you don't want something heavy like MySQL) and then loop through results
But nice design. Props for Font Awesome
As simple as it is, you might even be able to skip a DB altogether and put it into a giant array (the data set is small enough to do this). If you ever did have to go DB it wouldn't be hard to convert
 
Thanks. I originally just started uploading my files for myself so when I went to work I could just browse to the folder and download them. Then I was like well maybe I can just style the default index(folder structure page) and decided that would be more work then worth it so, I took my main website and used that as the base page layout and it just snowballed from there.
The thing is that for each file link I have this basic block of code where I change it according to the file name etc.
 
8:03 PM
It looks like this:
<a href="promos/national_oatmeal_day.pdf" data-toggle="tooltip" data-html="true" title="<div class='statprog'>Status:</div><p class='progmargin'> Final Document </p><div class='statprog'>Upload:</div>Yes"> National Oatmeal Day </a>
I have the href="promos/FILENAMEHERE" part and then the parts that change is the title="<div class='statprog'>Status:</div><p class='progmargin'> Final Document </p><div class='statprog'>Upload:</div>Yes" part
 
@benlevywebdesign Programming 101: identify where the common things are and then move them to where a script can automate them
 
I'm having some issues getting debugging to work with Eclipse PDT. Is this a good place to ask?
 
@MorganThrapp I doubt anyone here uses Eclipse. Sorry
 
@Machavity I know the common things I think...
 
Can you recommend a better debugger/editor then?
I'm not set on using Eclipse.
 
8:06 PM
@MorganThrapp netbeans.org (free) or jetbrains.com/phpstorm (paid)
 
most people here use phpstorm
 
@Machavity Thanks. :)
 
I personally use Komodo Edit (free)
 
@Machavity The main thing I want to make faster is changing the status of the document on the tooltip hover.
 
I use Pycharm for some personal stuff, but this is non-open source for a company that wouldn't like it if I used PHPStorm without paying for a license. :P
 
8:32 PM
@benlevywebdesign how are you currently storing the status?
 
I'm not storing it anywhere. I have just been manually putting it in.
 
ohh editing the markup?
 
Yes, it is not really that much work because I have to add markup for the new files anyways when I need to add new files it would just be nicer not to have to copy and paste the markup.
I just now made a file with the status markup as templates that i'll use. it will be better than me copy and pasting little chunks at a time
 
9:07 PM
Anyone knows/uses/recommends any framework/add-on for PHP-Unit Testing?
 
@MenelaosKotsollaris phpunit is already supposed to be a unit testing framework. What do you need exactly?
 
@MenelaosKotsollaris do you mean other than PHPUnit?
 
Well I am generally new to TDD and I would like to introduce that logic to my project. Nothing complex, just simple-testing scenarios to my classes+functions (e.g: for different inputs check the given outputs)
 
most people use phpunit.de
 
I think this is what I mean and yes Danack+Marcio you are right most people recommend PHPUnit so I will give it a try :) thanks
 
9:14 PM
So, follow up to that recommendation of Netbeans, I can't seem to get debugging working with that either. :/ It stops at the first line of the file, but nowhere after that.
 
@MenelaosKotsollaris also I often end up using mockery instead of the built in phpunit mocking library ^^
 
Lol PHPUnit just became stable on October 2, 2015
 
that's when the latest version, 5.0, passed RC, there were other stable versions before
 
Anonymous
@MenelaosKotsollaris do you know how to write tests?
 
9:25 PM
Honestly, I have no idea xD; First time to sort things out
 
Anonymous
I can give you a trivial example, if you have never written a test before
 
Oh that would be really helpful! I have seen some tutorials in Java but never tried them in my project
 
Anonymous
It is something I wrote, for a one-class php library. here is the test github.com/samayo/bulletproof/tree/master/test
 
Anonymous
The test is running as you can see in the readme page
 
Anonymous
It all takes two files to actually run the test.
 
Anonymous
9:29 PM
Everything is simple as you can see from the code.
 
Anonymous
If this is your first time, you'll understand at least the basic concepts with it
 
I was always horrified by the idea that test scripts were always tripple-sized the project's code. Thank you I will study your example. Did you use PHP-Unit?
 
Anonymous
 
Awesome, thank you!
 
Anonymous
np
 
9:53 PM
@Gordon "Protecting the rights of programmers"… okay, that's a bit off. But the 6 points are pretty good points :D
 
@MenelaosKotsollaris that's also a so called code-smell, so if you're horrorfied by that, it's a good sign
and good luck starting with PHPUnit.
 
Yeah I am sure I will find some "out-of-nowhere" errors I would have never thought of; there is a reason why almost everyone uses TDD in big projects..
 
10:14 PM
Why does PHP send duplicate headers? WTF
Apparently chrome doesn't like that
bleah, frameworks should use true the second parameter of header always. Silly God damn PHP frameworks!
Ahh it's Symfony's HTTP component!
 
10:30 PM
What! Son of a'! Who wrote this crap?!
 
"duplicate headers"... By spec, that's not only allowed, it's used consistently
no, you shouldn't use true as the second parameter of header(). You should use the appropriate setting
 
> Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)]
Location is not a comma-separated list.
You can only redirect to one location.
 
why are you trying to send multiple location headers?
sounds like your application is messed up, not the framework or the browser
 
***I'm *** not.
No, the framework does stupid things. The result is sending the same header twice, which it shouldn't. Someone clearly spent a lot of time copy/pasting code around and didn't realize this code path.
It's an edge case, which is why it took me a while to understand how on earth it was letting me send multiple location headers in the first place.
I only ever set header once. But clearly the framework has it's own custom shutdown functions that somehow forced the headers to be sent a second time which isn't obvious at all.
 
@Sherif Yeah, it's common knowledge that you better don't use frameworks ;-D
 
10:45 PM
@bwoebi Well I have been thinking of buying a bunch of logic gates, assembling my own CPU, writing my own instruction set architecture, and seeing where it goes from there.
I just have to find about 10-15 years to dedicate to it.
 
@Sherif Are you sure the logic gates will do what you expect them to and not have weird quantum side effects?
 
what the fuck
seriously what the fuck
 
@bwoebi I know, I'm taking a huge risk.
 
since when is "not using a framework" the same as "build it from scratch":
 
morning @ircmaxell
 
10:47 PM
I'm so sick and tired of people WHO SHOULD KNOW BETTER repeating that sort of FUD
 
@ircmaxell Well I haven't implied that, but Sherif seems…
 
relax man, it was a joke.
 
@bwoebi I know you didn't
 
Clearly neither of us believes in that FUD.
 
I don't know
 
10:50 PM
I'm not certain we use a framework at all where I work.
 
Ahh, clearly you just wish to take something out on me :) It's OK @ircmaxell. I apologize for whatever I did.
 
We have a templating library. A database library. Nothing mandates their use at all.
You can skip everything on any given page.
 
That sounds like a maintenance nightmare.
 
@Sherif not at all. I'm just so sick of that rhetoric. It's literally holding us back as an industry (even if you meant it as a joke)
 
@Sherif It's really not. I think that's why I shared it.
 
10:55 PM
@ircmaxell The rhetoric that technology isn't completely reliable?
 
no, the rhetoric that you must use a framework for all things
 
In practice everyone uses the libraries because they are useful.
There are some places that don't use them, but those are stand-alone tools (could exist completely separately and it would work perfectly still).
 
@ircmaxell I wasn't aware I implied any such thing.
 
10 mins ago, by Sherif
@bwoebi Well I have been thinking of buying a bunch of logic gates, assembling my own CPU, writing my own instruction set architecture, and seeing where it goes from there.
 
Dramatization of the burden of taking something that is already relied upon and rebuilding it because some tiny aspect of it doesn't behave the way you want it.
I think you just read into it a bit too broadly.
In any case, sorry if I offended :D
 
11:00 PM
@Sherif it was not offensive. That actually the point.
What you wrote was mostly sad and disappointing.
 
@tereško Oh well then I'm very sorry to have disappointed you. Certainly didn't mean to be the damper on anyone's day. I just felt like expressing my frustration with a current problem by being overly dramatic :)
 
11:43 PM
heeey, is this a by spec thing 3v4l.org/YI4an ?
 
@marcio That's my fault … well, mine and Ferencs
 
The error message looks very weird 3v4l.org/TD9s0 D:
> Argument 1 passed to NS\C::NS\{closure}() must be of the type string
but the behavior is there since 5.4
 
Is there a way in netbeans to find out what controller is being called by a button on a form?
 
@MorganThrapp 1) see the url that the form is targeting 2) look for the url on your routes 3) get the controller/method name. Or use a step debugger.
 
Alright, thanks. I thought I found it, but none of my breakpoints are working, so (I'm hoping) I just have the wrong controller.
 
11:57 PM
@marcio oh, yeah, that's actually the Closure scope
if you apply bindTo() there will be another scope
But as __CLASS__ etc. are like constants: guaranteed to be immutable, we need to make sense of these
 

« first day (1822 days earlier)      last day (3123 days later) »