« first day (2025 days earlier)      last day (2919 days later) » 

8:00 PM
@PeeHaa ublock was taken over by someone who then sold to ads, ublock origin is the original dev
 
I know
9 mins ago, by PeeHaa
Can I drop ghostery now I have ublock origin?
;-)
 
:P
 
@PeeHaa good boy
:D
 
:D
 
8:01 PM
@PeeHaa yes, but today was a public holiday so that was also good. Did you have a chance to use that silly Github api?
 
@abr Is it the homepage giving you a 404
you may need to change the .env file I believe
 
0
A: Catching multiple exception types in one catch block

Joe WatkinsComing in PHP 7.1 is the ability to catch multiple types. So that this: <?php try { /* ... */ } catch (FirstException $ex) { $this->manageException($ex); } catch (SecondException $ex) { $this->manageException($ex); } ?> and <?php try { } catch (FirstException | SecondException $...

I want to say more ... but ...
there is no more to say is there ?
 
@Danack Nope sadly not. Have been distracted by other shiny things
 
@abr check your .htaccess file and make sure it is configured to linux
 
@Danack So you are drunk? :)
 
8:04 PM
use php artisan to check if other pages work
 
Not yet......went shopping earlier and didn't take hip flask with me, so only recently started teh beers.
 
it sounds to me like a server configuration error.
 
@JoeWatkins :-D
 
@JoeWatkins I'd rather edit the top answer...
 
well it's not wrong
I guess it will be pretty stupid one day ...
 
8:07 PM
no, but providing an update doesn't hurt
 
> But it would probably be better to use multiple catch blocks as described in aforementioned answer.
 
yes, it used to be
 
even though you can catch multiple exceptions doesn't make that bad advice, I don't think ...
 
@PaulCrovella do I need to create a 1M relationship between the thread table and posts
 
@Dannyw24 can you tell me what was wrong with that code yet ?
 
8:11 PM
@JoeWatkins I was trying to pass my foreach loop a non array object
public function setColumn() {
//output the column values
if(is_array($this->rows)) {
foreach($this->rows as $row) {
echo $row . "</br>";
}
}
}
 
@Dannyw24 you need to burn your thread table in a fire
 
3 hours ago, by Joe Watkins
function __construct($DB_con)
    {
        $this->db = $DB_con;
        $this->rows = $rows;
    }
this code ...
 
@PaulCrovella Okay I'll do that
then I'm left with posts and users
 
@JoeWatkins automagic $rows var?
 
oh the $rows variable was been defined there
 
8:13 PM
was ?
 
I've since updated it
 
> if(is_array($this->rows)) {
is that how you updated it ?
 
No I removed the $this->rows = $rows; line
 
ok good, you seem to understand now ... that really drove me crazy earlier ...
 
Haha I was tackling 2 different errors
one with the foreach loop and another with that.
 
8:15 PM
@bwoebi undef, yeah ...
 
I've been frantically doing php again after leaving the military wanting to get back into development
hence my poor knowledge
 
where are you from ?
 
Yorkshire, UK
Was Based in Midlands
 
brother is sgt in rlc
 
I was a Medic in the airforce
SAC only did 2 years wasn't for me.
Did my paramedic training though
 
8:18 PM
forces aren't for everyone, suits my brother, but ... almost nobody else I know ...
 
It is a lifestyle that divides you from people, the airforce isn't so bad but in the future
they are combining all into one, making airmen work on ships
Take the Ebola crisis for example they sent Army/RAF medics to spend 6-12 months on ship with no Naval Training
I've worked with alot of them
 
the bit I don't like, is the very real possibility that you will have to shoot at, and kill, strangers ... even if you get to travel the world, even if you help a million people ... there's something uncomfortable about that ...
 
There is but its taught like this
shoot or be shot
I can use a rifle and will never be comfortable with it
the pay isn't great either tbh
 
the other alternative is not to join up in the first place ...
anyway, I'm glad people do it ...
I understand it's necessary ...
but I can't help but choose the third alternative ... for me ...
 
haha its true
I will maybe join the reserve for some fun days out
 
8:25 PM
the "shoot or be shot" thing I get, but that's also what they told the other guy
I'll pass, thanks.
 
@PaulCrovella waiting on your expert knowledge :)
@PaulCrovella I've read that article completely and get the whole thing. it did a poor job of explaining primary keys
 
I believe it. Like I said I only skimmed it to make sure it wasn't total rubbish.
 
@PaulCrovella it was a good introduction though
 
at some point (sooner rather than later) you're also going to want a copy of amazon.com/SQL-Antipatterns-Programming-Pragmatic-Programmers/… .. it's mostly very good.. there are some questionable bits when he deviates from talking about sql, but it's a worthy book despite. pdfs are available on the interwebs if that's your thing
 
I'd say it's good but not great
 
8:38 PM
@JoeWatkins The rainbow guy is grating on my nerves reddit.com/r/PHP/comments/4hhufe/…
 
Wordpress: Putting the suck back into PHP7. Literally
 
I just wrote that thing, but this is a bit ugly I think. I'm too tired to rewrite it... If you have some ideas to make it better, thank you (Deferred and all() are coming from amp).

http://pastebin.com/9cHh135M
 
@Danack the stuff about password hashing in the browser irked the hell out of me.. ffs https is not a "compromise"
it doesn't bother me that it wasn't entirely comprehensive, there are a lot of ways to go off the rails and the book had to end somewhere
 
abr
@Dannyw24 was taking a shower, taking a look at those files, i'll return :P
 
...
 
abr
8:48 PM
ty
 
@abr no problem
 
can anyone see why this is considered a failed run? The failing test is an XFAIL...
 
@NikiC Is it only me, or why does tests/lang/bug71927.phpt parse constants in the first three cases (where it's surrounded with whitespace)
 
@bwoebi no such test?
 
@NikiC in master?
oh
dmnit
I created that test
 
8:57 PM
lol
 
ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt returns int(4) for me @JoeWatkins
@NikiC could you repro the issue with valgrind on non-debug?
@JoeWatkins same for the server testcase, it's int(4) there too
 
@bwoebi was that on a specific test?
 
@NikiC nah, simple Aerys install
just start it
valgrind php bin/aerys -d -c demo.php @NikiC
I don't even know how to track this down to a specific file…
 
@bwoebi can you check what track origins gives you?
 
@NikiC no further information
 
9:08 PM
hm, lemme try
nope, not seeing anything
I tried release/debug with and without zend alloc
no valgrinds either way
 
@NikiC I know right, doesn't know when to give up ...
@bwoebi I'll fix that
wait I don't understand how it returns 4
 
@bwoebi attach gdb to valgrind, check what's going on (or at least get the file)
 
@NikiC What symbols do I need to break on?
I've never attached a debugger directly to valgrind…
 
I guess it's just an implementation detail ... bit strange though
 
@bwoebi err, I don't mean to the valgrind process but via vgdb
it should automatically trap if you hit a warning
 
9:15 PM
vgdb?
oh
 
@bwoebi You run with --vgdb-error=0 and the remotely attach gdb
 
Ah, interesting
 
@PaulCrovella I've redesigned my database after watching a video tutorial its makes much more sense now.
My way was so silly.
 
gravatar is annoying me ...
 
@NikiC composer ClassLoader.php (I had to try like 10 times before finding something not optimized out :x damn non-debug builds ^^)
 
9:23 PM
Still if someone could explain what primary keys do
 
in addClassMap function
 
@bwoebi That function does not look particularly interesting
do you see what is uninitialized?
 
can we reproduce this easily bob ?
 
no. But looks related to array typehints in general
valgrind /Users/Bob/php-src-X/sapi/cli/php -r 'function a(array $t) { var_dump($t); }'
already shows the error
@NikiC it's all optimized out shit, how am I supp… oh, I could look at the disassembly where it stopped…
 
this is without --enable-debug, right ?
serious wtf is wrong with gravatar
 
9:29 PM
@JoeWatkins yes, that's the issue
 
@bwoebi ah
that's odd
 
in debug mode I don't get the error
 
To make sure we're not chasing the wind here ... did you do a clean build?
 
I can't reproduce on 7.1, is it 7.1 ?
opcache settings ?
 
@JoeWatkins yes, master, no opcache
@NikiC yes
 
9:31 PM
can't reproduce enabled or disabled :s
zts ?
 
@bwoebi release only bugs suck...
 
yes
 
hey internals gurus :)
is there any way to write tests (phpt or whatever) for the http stream handler?
 
   0x00000001003b1a94 <+1124>:	movzwl -0x38(%rbp),%ebx
   0x00000001003b1a98 <+1128>:	movzbl %bl,%edx
   0x00000001003b1a9b <+1131>:	cmp    $0x7,%edx
   0x00000001003b1a9e <+1134>:	setne  %dl
   0x00000001003b1aa1 <+1137>:	test   $0x1,%bh
these are the instructions immediately preceding the jump branch where it breaks
 
I can test manually using the -S web server, but not sure if there's an established way to automate that...
 
9:35 PM
@IMSoP you can unregister the standard handler and install your own
 
$0x7 is IS_ARRAY
 
yah
@bwoebi it oughtn't be going into that branch
defaut_ast should be null
 
@JoeWatkins don't suppose there's an example anywhere so I can see what you mean?
 
@bwoebi Is one of param_ast or list not optimized away?
Would be nice to know what default_ast is
 
all three optimized away
 
9:39 PM
bah
 
but ast isn't
 
ah, that's good enough :)
So ((zend_ast_list*) ast)->child[0]->child[2] should be it
 
(gdb) p ((zend_ast_list*)ast)->child[1]->child[2]
$31 = (zend_ast *) 0x100000040
not null.
 
@bwoebi why child[1]?
 
because i == 1
weird
 
9:41 PM
wat
 
(gdb) p ((zend_ast_list*)ast)->child[0]->child[2]
$32 = (zend_ast *) 0x0
 
that function only has one param right?
 
(gdb) p i
$29 = 1
yes
 
and ast)->children?
 
Probably optimized build incremented at start
 
9:42 PM
... you mean nobody actually tweeted @samayo's excellent reason for using php?
 
@NikiC yes, one child… I guess this is just i being incremented at loop start
 
@bwoebi that's super evil
 
super evil
 
Guess it saw that i + 1 is used twice in there
 
probably
 
9:44 PM
how to stop it ?
 
So the question is, with default_ast being null, how did we get in that branch?
@bwoebi what's the assembly before that snippet you posted?
 
it isn't null, is it ?
it immediately starts at ((zend_ast_list*)ast)->child[1]->child[2]
 
   0x00000001003b1a5a <+1066>:	callq  0x1003b1fe0 <zend_compile_typename>
   0x00000001003b1a5f <+1071>:	mov    -0x58(%rbp),%r15
   0x00000001003b1a63 <+1075>:	movzbl (%r15),%edi
   0x00000001003b1a67 <+1079>:	cmp    $0x12,%edi
   0x00000001003b1a6a <+1082>:	je     0x1003b1f5e <zend_compile_params+2350>
   0x00000001003b1a70 <+1088>:	mov    -0x80(%rbp),%rax
   0x00000001003b1a74 <+1092>:	lea    0x8(%rax,%r14,8),%rax
   0x00000001003b1a79 <+1097>:	movzwl (%rbx),%ecx
   0x00000001003b1a7c <+1100>:	cmp    $0x1,%ecx
 
@JoeWatkins Presumably it doesn't. It only starts i at 1
 
oh I see
 
9:46 PM
well
compiler is being supersmart
it realizes accessing a stack variable isn't a problem
thus it doesn't short-circuit
but joins the conditions and then jumps
bah
 
@bwoebi where do you see that?
 
oh. lxr.php.net doesn't list .phpt files
that's confusing
 
@bwoebi that sounds like a compiler bug then
 
/me sleeps, nn all
 
   0x00000001003b1a9e <+1134>:	setne  %dl
   0x00000001003b1aa1 <+1137>:	test   $0x1,%bh
=> 0x00000001003b1aa4 <+1140>:	jne    0x1003b1b40 <zend_compile_params+1296>
   0x00000001003b1aaa <+1146>:	not    %r13b
   0x00000001003b1aad <+1149>:	and    %dl,%r13b
   0x00000001003b1ab0 <+1152>:	and    %r13b,%cl
   0x00000001003b1ab3 <+1155>:	je     0x1003b1b40 <zend_compile_params+1296>
@NikiC ^ that's the whole asm … it's first fetching %dl - before the jump
and then using it
and then look at these and's
 
Anonymous
9:56 PM
Meh, to lazy to check, but is it important to prefix cronjob command with $ nohup?
 
@NikiC not sure, looks like a legit optimization as it's everything guaranteed to be reachable and side-effect free … just valgrind ist giving false positives then, IMO
 
Anonymous
Not sure if I log in to my machine, I could interrupt a process
 
@bwoebi but the uninitialized error already happens before dl is used?
 
@NikiC I'm not sure about the accuracy here … if you look at the full asm, there's also some movzwl+movzbl (to read the zval part) etc.
 
@bwoebi mov doesn't count as use
 
10:02 PM
@NikiC yes, and that one is compared then
 
as I'm reading this asm, it does to the IS_ARRAY comparison first, but it only stores it in dl
and then first branches on something else
 
yes
 
@bwoebi is that branching on the Z_CONSTANT?
 
yes
which is the issue
0x00000001003b1aa1 <+1137>: test $0x1,%bh
^ is the comparison (IS_TYPE_CONSTANT is 0x1)
 
okay
now I get what it's about ^^
 
10:04 PM
which is unitialized
 
but does the default_ast branch happen before that?
 
0x00000001003b1aaa <+1146>: not %r13b
^ the default_ast var
it's right after the jump
 
k
 
and then is merged into the AND
 
I love compiler bugs.
I haven't been following closely enough to give any input on this one but I've found and reported a few different bugs to Intel for their compilers.
 
10:07 PM
@bwoebi So this must be either a bug in the compiler or in valgrind, depending on the perspective
@bwoebi You use clang right?
 
@NikiC yes
Apple LLVM version 7.3.0 (clang-703.0.29)
@NikiC valgrind possibly should only report when it actually would alter the result of the program … but I guess that's too hard to detect though
 
@bwoebi What is LLVM 7.3.0 supposed to be?
 
I honestly have no idea
@NikiC I think 7.3 is because XCode 7.3 …
 
wow great job apple
 
sigh
 
10:19 PM
Yeah… LLVM definitely isn't at 7.2…
 
morning
 
10:48 PM
pssst, if you use apple products, you're part of the problem
 
11:06 PM
Signs it's time to go to bed:
> zend_mm_heap corrupted
 
@Danack developing on an ext?
or in legit code?
 
echoing out strings mostly.....
the only extension being used is PDO.....
 
I always like repro codes ^^
 
11:33 PM
Not on old versions you don't....
 
oh :-(
 

« first day (2025 days earlier)      last day (2919 days later) »