« first day (1366 days earlier)      last day (3808 days later) » 

22:07
Actually, this is the only RFC about scalar type hinting which might be okay, but I'm still not sure if I'd really want it…
e.g. just like I want to pass a "0" from the db to a boolean parameter, but which couldn't be passed through as it'd be lossy. ("0" !== (string)(bool)"0")
@bwoebi ...which is insane in itself, but that's another story
You have been watching irc?
@tereško Ugh....you will either love that series or hate it. I recommend not reading it if you actually like thinking about what you're reading.
Short version and not too spoilerish, there are some major internal consistencies with the story line, that make the reading of all 3 books be a great big 'meh'.
it's actually an audiobook for falling asleep to
=P
22:24
@DaveRandom nope, not on this computer…
@DaveRandom the issue is that values returned from the db are always strings…
@DaveRandom could you quote here or tell me the essential point?
DEUTSCHLAND!
0
Q: Access Profiler without a request on a PHPUnit Symfony2 project

saamorimHow can I access the profile on a unit test context where there is no request? In my case, I'm making tests to a data access layer that uses some other DBAL, doctrine2 in my case, and I want to assure that only a certain number of queries are made for performance issues. Don't want to put http ...

this is weird ^ ^ ^
@bwoebi Pretty lengthy discussion about the appropriate bool behaviour
(inconclusive)
Personally I'm in favour of replicating if() behaviour, which is just (bool) cast behaviour
@DaveRandom Dude WTF!
It seems to be all-or-nothing though
22:33
@PeeHaa Sorry, I mean "I do have a canadian bank accoont eh?"
@PeeHaa what does that mean?
@DaveRandom :D
one quick but very abstract question:
that's not quick
22:34
@zerkms fish
do you think that in general scalability (in comparison to monolith) increases latency?
E_ON_TOPIC
@bwoebi I'm getting more and more meh on this proposal
oh right, I must have been asked about headers already sent thing
that would be OK_ON_TOPIC
@zerkms wow. shit is abstract AND broad
42
22:37
@bwoebi In the current form it's probably still too weak, but people are pushing towards even weaker
@PeeHaa what does it lack to be answerable?
that's why I had put "in general"
@NikiC agree.
Zeev wants to push it to "just accept all scalars for all types"
A specific use case would help
at which point it's totally useless
22:39
@PeeHaa it would never be specific enough to be answerable then :-)
As it currently stands you are asking whether wiping front to back is better than back to front
@NikiC the issue is that it never can fit everyone's needs.
A good point in favor of strict typehints is that it's absolutely clear how they behave ... no room for discussion
@zerkms That might be true :-)
@PeeHaa well, having multiple web front ends behind a load balancer
22:40
@PeeHaa depends on what you have at the front
does increase latency, increases throughput and makes the solution scalable
true or false
?
That would be some crucial info @zerkms
@NikiC I actually think I'm pretty happy about it, just not about booleans and the fact that there's no object hint…
But just in it's current form…
And I'm also wondering whether we (internals people) are misrepresenting what the community wants. I does seem like the strict hinting has the strongest community support, as odd as that seems to me (I would expect people to fight for the reverse ^^)
@DaveRandom :-D
22:41
@NikiC I don't want scalar type hinting
@bwoebi yes, booleans accepting everything is meh
/me is a community
@NikiC well, we were talking about it
@zerkms Does it increase latency noticeable? If yes you are doing it wrong?
@NikiC everything is meh, but only accepting lossless is also meh.
22:42
@ircmaxell we are?
I think 2 ways make sense: booleans support casting from everything (meaning array() is valid input), or nothing. Otherwise things start getting really weird
only accepting bool for bool would be okay to me ;)
@PeeHaa I don't have it set up, it's a theoretical question
ex: 0, 1, ‘’, ‘0’, ‘1’, true, false and null
@NikiC we as in Andrea and myself
@PeeHaa obviously when you have to establish 2 TCP connections it's slower than to establish just one
22:43
Yes but the problem with theoretical questions is that it is hard to answer
@NikiC don't confuse vocal community with largest community.
measure that shit
And also don't confuse what people say they want, and what they will be happy with...
if it is noticeable you are doing it wrong
@zerkms if you put a gun to my head an demanded an answer of me, I would say that yes, the ability to work efficiently at the large scales means that you can't operate as efficiently at the small scale, and it follows that efficiency is relative depending on the scale you are working with. It's probably approximately an inverse exponent. But that's totally just pulling numbers out of thin air, and I didn't even give any numbers
22:43
@NikiC that's where we ended up with... At least my view
@PeeHaa see - dave got the point :-D
@ircmaxell looks fine to me.
Note his last sentence
@bwoebi well, why not 2?
heh. Poor Singapore. That anti-gambling advert kinda backfired :P
22:44
@ircmaxell good
because that would enable foo($flags & FLAG_SOMETHING)
Also note he is apparently Canadian so he sucks
though likely people will resist that ...
@ircmaxell too lossy
it's also annoying that rfcs are being heavily discussed while they can't be opened...
22:44
@NikiC amen to that
@PeeHaa I see it, the question was about "in general". Like - "most likely it does than not"
@ircmaxell either only these or we accept everything, again.
@bwoebi or only bool, which is even better
@bwoebi well, the other option is to only accept booleans directly...
@zerkms Again: impossible to say without specifics and/or pulling numbers out of your ass
22:45
or treat it like an if() statement and let whatever in
I don't like either
@PeeHaa I'm not expecting the exact number or precise answer, just an essay like, as Dave provided
@ircmaxell which might be annoying… people then will just prepend automatically always !!
@PeeHaa may be based on own experience. Like "we did that and got that"
only accepting a subset of values is dangerous, because then it becomes a runtime question whether something is valid
Yeah but any answer would be useless
22:46
If we only accept bool, then it's more of a ct questoin
In that case: option A
@PeeHaa depending on how to use it - I'm just collecting statistics
I.e.: If it works with the current data, it is highly likely to work with all other data as well
Because something returning a bool will likely continue returning a bool no matter what
@zerkms Statistics based on thin air or even worse than "normal" statistics
whereas a value going from 1 to 2 can easily happen
22:47
Still Option A
@NikiC just like strpos?!
@PeeHaa what is "A"?
I have no idea :P
@bwoebi Not talking about function return values here
@NikiC yeah, but when we pass them to another function…
22:48
@bwoebi But would you directly pass the result of strpos to a boolean parameter? No, you wouldn't.
you'd pass false !== strpos
only accepting bools makes sure that you do
(instead of treating a 0 return values as bool false as well, which is not the correct interpretation for the return value of strpos)
Hey :)
@ircmaxell actually there is a 3rd way: not having a bool type hint at all
I see myself writing func(!!$objFromDb->integer) … that displeases me too.
@Farkie yo dawg
@DaveRandom did your friend ever get confirmation?
22:50
I'd rather prefer issues with strpos here.
@Farkie /cc @PeeHaa
ahh
@bwoebi I highly doubt that you'd have to write that particularly often
Should have said it was in here, would have jumped in
(paypal/phpnw @PeeHaa)
22:51
And even then, I'd argue that from a code clarity perspective, fun($i != 0) is a lot better than fun($i), where it's totally non-obvious that you're actually passing a boolean cond there
@Farkie iirc he wasn't here at the time
@NikiC Each time I have a boolean field in a table…
and that's really often enough to make that displease me.
Fair enough :)
@bwoebi yes, you'll have to handle that
btw, how are bools returned by the db?
I could imagine that they're returned as '0' and '1' , is that right?
@internalsPeople if I RETURN_ZVAL() do I need to addref? stupid question, ignore me
22:54
@NikiC yep
@DaveRandom indeed ^^
@NikiC boolean is just a shortcut to tinyint(1)
@Farkie ...in MySQL
not everywhere
Yup
So, bottom line: I'd much prefer forcing you to write that one boolean cast than making bool a documentation-only typehint
22:55
thought I read MySQL, guess I just assumed :(
slow page
(somewhat tangentially related at this point)
@Farkie yeah, you need to add shared.php.net to abp to view the page ...
22:57
ad block pro
It works for me, somewhat slowly, and I haven't changed anything
oh right
(didn't work, though)
I just browser the unfiltered internet because I live on the edge
I don't know what adverts look like anymore :D
22:58
it's fine, I have it slowly
without css
@Farkie are you going to the manchester digital bbq thing next week?
I am, on Thursday
yeh I may get in on that action, sounds like it might be interesting, looks like there are a few people going who I've wanted to meet for a while and also some people who I've not seen for ages
@NikiC Actually, I'd like it accepting true, false, 0, 1, "0", "1". Nothing less, nothing more.
That's really easy to know...
Cool :) Hopefully see you there :D
23:02
@bwoebi That's precisely what Andrea suggested in irc a while ago
@bwoebi I don't like it, but I'd probably still take it over accepting everything
Oh also '' and null were in her list
The more I think about it the more I would be OK with just not having a bool type hint at all. There's only really one thing you can do with a bool, the point of scalar type hints is to remove the ambiguity in things you can do lots of things with (numbers and strings).
I would like to see a more strict type hint - but I be happy with the proposed rfc as long as the following sentence holds "Conversion is allowed only if data-loss does not happen."
@DaveRandom no.
just no.
lol
@NikiC so then you are in favour or what? strictly bools?
23:12
Hey @Farkie
Hiya
Let me check my mail
but what exactly should introducing a strict boolean hint solve?
if it still supposed to accept some non-boolean values - what is the difference
@Farkie Nope no mail yet from PHPNW. Is my paypal confirmation of any use to you?
Yes I can
Ill have a look tomorrow at the office
23:17
Is that you or do I need to write an intro
i need help with a ?
I can't explain any better than the on hold box does. Pick a specific coding question and ask that. You are asking for three very broad answers here. — Andrew Barber ♦ 16 hours ago
Awesome. Tnx @Farkie!
np, ill delete that msg now lol
23:18
What happened to oem warehouse :(
Bed time! Gnite all
@zerkms exactly. If it accepts stuff other that bools, all you get is the knowledge that it's a bool -> you gain nothing. If you accept only bools, no-one will ever use it because the only thing you can ever do with a bool is test it for truthy-ness -> you gain nothing. I get the point of implicit number/string casts, but bools just seem pointless after I've thought it through. Apparently that's not a popular opinion though :-P
@Farkie nite
Night @Farkie and thanks again
what's wrong with this question: stackoverflow.com/questions/24717429/…
@DaveRandom if one wants strict typing - why not use c# then
23:20
@zerkms It's not strict typing, it's implicit casting, there is a difference
I can't explain any better than the on hold box does. Pick a specific coding question and ask that. You are asking for three very broad answers here. — Andrew Barber ♦ 16 hours ago
@IGotRoot Seriously? "Three main goals for me to understand how to do the AJAX implementation before the main question will be marked solved: " - I'm not sure it's possible to explain how that is too broad a question.
@DaveRandom honestly I didn't read that RFC, thought it's another one about scalar type hints :-S
my php is working perfectly
At least somebody's PHP is working perfectly because my PHP is far from perfect
23:21
i can't seem to get the parts to communicate with each other
@zerkms It is, but it does type conversions (sometimes) instead of rejecting every value of the wrong type
@DaveRandom oh god :-S
@zerkms wiki.php.net/rfc/scalar_type_hinting_with_cast#conversion_rules just that table should give you the basic rundown of what's proposed
I'm predicting GIGO
gigo for what?
23:23
@IGotRoot it's not about your question
@zerkms given how often it comes up, we need a name for the "just use java instead" logical fallacy
can you at least give me a hint on what to ask to break this question apart: stackoverflow.com/questions/24717429/…
@NikiC that would be handy
juji
JUJI - just use java instead
23:26
@IGotRoot it's not arrogant enough
how so?
It must express the superiority of one that uses it
I'm great and Java is win and unless you use it you're a poopy headed knuckle fuck.
emm ... what is the subject and why is there shit in Dan's brain ?
23:28
lol
@tereško I have something yummy for you stackoverflow.com/q/24727414/251311
i wish i knew how to ask a great question about ajax
I've tried googling this; Cannot modify header information - headers already sent by (output started at .
@RahulKhosla and?
23:30
I get that error, im pasting my code if anyone can help?
@zerkms thanks for adding another drop in my symfony-hate-bucket
@RahulKhosla so have you realized why it happens?
575
Q: How to fix "Headers already sent" error in PHP

Moses89When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain header() and setcookie() calls. What could...

@tereško not symfony-specific though
23:31
the code kinda is
the code is. It's more about the whole approach
performance-alike test that checks number of queries performed
how do i move it to approved?
@zerkms I've read through the question @DaveRandom sent. But I still don't see where I went wrong.
23:32
@RahulKhosla so tell us - why it happens in general
... I don't even ...
what's the fucking point ?!
@tereško I don't see either. That's why I found it funny )
@zerkms I assumed it was because of some whitespace or html code.
@RahulKhosla whitespace? Where did you get that?
Whitespace after ?>
575
Q: How to fix "Headers already sent" error in PHP

Moses89When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain header() and setcookie() calls. What could...

23:35
@RahulKhosla the first line in a first answer in a Dave's link provides the exact explanation. Haven't you read even one line from there?
@zerkms This? Functions that send/modify HTTP headers must be invoked before any output is made. Otherwise the call fails:
yep
this phrase clearly states the reason
"Functions that send/modify HTTP headers must be invoked before any output is made"
Bold the whole thing ... there we go :-)
@zerkms Its basically saying, it needs to be set first, before any output from echos etc is made?
@RahulKhosla that's right
23:39
<?php /* I could call header() here :-) */ ?>
I will be output!
<?php /* I can't call header() here :-( */ ?>
@RahulKhosla don't you agree it's pointless to output something if you redirect user later
If you see my code, I've put it inside an if isset.
@RahulKhosla I see your code and I see outputs before header()
not sure how it relevant to isset()
If button is clicked, run this query, update the table, and then redirect to link.
So?
How is it still relevant?
must be invoked before any output is made
this is a strict requirement
23:40
You're saying I should; redirect link, run the query, update table?
nope
run, update, redirect
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/photo/download.php:63) in /Applications/XAMPP/xamppfiles/htdocs/photo/download.php on line 73
run and update doesn't imply you need to output something
In lighter news: I am totally piss drunk and will try to have some rest now
Noight roomsters
Night @PeeHaa
23:42
@PeeHaa now I see why you were that grumpy
s/grumpy/realistic
;-)
@zerkms header ("Location: ".$row['link']); is line 73.
BTW I always start fronit to back when wiping
So doesn't that have anything to do with it?
more to the point, what is on line 63...
23:44
@RahulKhosla that's right, and output on line 13
<h1><?php echo htmlspecialchars($row['name']); ?></h1>
And it is output isn't it?
no it does say 63
damn you
oh
sh*t
23:45
Mmm
@DaveRandom how is it possible?
@DaveRandom a buffer?
No I suspect a typo in the pasted error message
Even buffering doesn't screw with line numbers
@DaveRandom never worked with implicit output buffers but I could accept it to output the line that started overflowing it
<?php echo $special_person; ?>
No it's just treated as one string afaik, the first line no would be reported
23:48
@RahulKhosla anyway, did you get the point?
No.......
it still should work.
<?php foreach ($downloadStmt as $row) { ?>
<h1><?php echo htmlspecialchars($row['name']); ?></h1>

if (isset($_POST['downloading'])) {
header ("Location: ".$row['link']);}
Also that would imply a buffer size of a couple of hundred bytes in the file shown @zerkms :-P
@RahulKhosla how the hell it should work if you have output before?
@DaveRandom that was my first thought then I found few loops there
It worked before, when I didn't use any sessions. Not sure how.
omg
get a time travel machine and get to that "before" moment then
do you understand why the error occurs?
23:51
@zerkms oh right yeh
@RahulKhosla don't output <h1> in a loop, there should only ever be one h1 on a page
Oh also don't give elements the same id="" attribute in a loop either, there can only be one element with the same id on a page (it's an identifier, it's unique)
I hope it will be somewhere in near future when projects like scala/clojure will arise for php vm
so that it was a single interop with php but with nice fp flavour
As I understand it, there's not enough separation between the language and the engine so it would be quite difficult to do
I don't speak from any real position of true understanding there though
but it was some php vm experiment wasn't it
the one built on llvm

« first day (1366 days earlier)      last day (3808 days later) »