« first day (1811 days earlier)      last day (3143 days later) » 

2:00 PM
@Danack I had my package names all borky.
Dildo cactus is a common name used for several species of long, narrow cactus, especially Acanthocereus tetragonus Pilosocereus royenii In addition, Dildo is a common name of Opuntia stricta, and Pilosocereus polygonus is known as the Bahama Dildo....
 
@Jimbo the problem isn't that injecting the template rendering engine is difficult. The problem is that the view/template layer can have it's own set of dependencies. Unless you're going to pass all of them into the controller, then you fundamentally need to use service location to get them from within the template.
 
Holy shit
@Danack Honestly I haven't actually abstracted out to a view yet, just get the data then pass to templating engine. What could the View need?
 
@Jimbo everything? Like the sidebar of navigation links. Maybe some adverts. Definitely a login/logout box - which one depends on the whether the user is logged in or out.
 
@Danack But the sidebar of nav links is just HTML. Twig has inheritance, that's what I use for that. Components are just twig includes to keep their seperation
 
2:04 PM
Basically everything that the controller isn't doing some operation on.
@Jimbo "the sidebar of nav links is just HTML" - think of cases where the nav links depend on whether the user is an administrator or not.
 
Or maybe you're using React for componentised HTML - still nothing to do with PHP or the view, it's handled client-sie
@Danack Ah yeah, and breadcrumbs.
 
That template gets compiled to PHP - gist.github.com/Danack/84e73c44adb4b7db96c5
And then Auryn injects all the things.
@DanLugg For that, I can only offer support, not help.
@Jimbo the obvious advantage of doing DI in templates (maybe with my Jig library) is that all of the templating layer can be unit-tested.
 
Anyone good at mechanics?
Im stuck!!
 
lol
"In PHP room, asks about mechanics"
 
Lol
No other place mate
Other rooms people r too badass
 
2:14 PM
Unit Testing is something I want to start doing
everytime I go about doing it though
I am stuck in the classic testing problems
'Why the fuck am I doing this'
'How the hell do I test this'
'To mock, or not to mock'
 
@HassanAlthaf Which?
 
user895378
@DanLugg omg how did I not know this was a thing
 
user895378
and: morning
 
morning @rdlowrey
 
'PhpUnit' or should I use 'PhpSpec'
 
2:16 PM
@rdlowrey Not sure, didn't know it was a thing either; I was looking for toy.
 
@EquinoxMatt Funny, you should go to PHPNW. My talk actually shows how something is "hard to test" and how DI can make it testable, and what a test looks like, including a mock
Or pay £25 to watch live ;)
 
@EquinoxMatt We are contractually required to plug PHPUnit. That has nothing to do with the author hanging out in the channel
 
I am looking to go to PHPNW next year, my first PHP event, might as well start locally!
@Machavity ;)
 
user895378
Is there anyone not using phpunit at this point?
 
user895378
No serious developers are using a phpunit alternative, I mean.
 
2:20 PM
I hear good things about Codeception, but yea, PHPUnit.
 
There is a lot of talk about phpSpec, but for someone new to testing, or wanting to try it, there is a hell of a lot of shite to wade through
and I have also heard of codeception
 
Some people want to use codeception for regression tests for their testers to use - I think that's the wrong approach. Testers are not coders, QA shouldn't need to write code
They need some automated test suite which is effectively point and click. No insult to their intelligence, but it's faster for a non-dev to point + click elements to test rather than learn the syntax and idiosyncrasies of a language
 
but then I tried to use it with Zend2 (same with phpspec) and it didn't support zf2 out the box, and I got frustrated
 
@DanLugg is that Code-ception or Co-deception
7
 
Code-ception... although...
 
2:22 PM
@EquinoxMatt they're for different things....phpspec is for making sure your code passes acceptance testing, which is not the same thing as unit testing.
 
Co-Deception sounds like the title of an action flick
 
Action/thriller
 
@Danack - but if you look at numerous articles say phpspec replaces phpunit
 
> I will not look for you, I will not pursue you. But if you don't, I will look for you, I will find you, and I will codecept you
 
2:23 PM
But if you look at real-world usage phpspec hasn't replaced phpunit :D
 
@EquinoxMatt I bet they're on something like sitepoint
 
Yeah
Bang on Jimbo
 
:D
 
I know I shouldn't trust everything I read, but the confusion for someone who wants to test
who wants to do it the god damn right way
there is a lot of disinformation about
 
If you are writing unit tests just pick one and write your tests.
Writing tests is the right thing – how tests are written is less important.
 
2:24 PM
@Jimbo so, selenium?
 
@EquinoxMatt honestly, I find reading articles or talking to people who like acceptance testing to be incredibly tiring all the time. They have the same air about them as religious zealots. And don't get me wrong, being a zealot isn't always bad - but when you ask "How do I unit-test this?" and their answer is always "write a user story1!1!" - I kind of make my excuses and leave.
 
LGL
@MikeM. Thank you, but I solved it, it was actually very simple.
 
@FlorianMargaine Selenium / Webdriver, yep. I was actually working on something with a front-end for that, basically form-based and an API for a point + click JS chrome plugin. Need to get back into that actually, would love to open source it for everyone
 
@marcio Can you experiment with parsing namespaces as a single token?
To see what all it entails?
 
@Jimbo ? do you mean e.g. the firefox add-on?
 
2:26 PM
@FlorianMargaine Yeah, Chrome plugin ,firefox addon, safari extension. Either way it'll just allow you to click on an element and the xpath + page url will get sent up to the API and added as a test case
 
@Danack - There seems to be a lot of stuff around BDD atm as well - the whole water is muddied
 
BDD, DDD and the worst: PDD
PHP Driven Development
 
@Jimbo ah, so the QA tester wouldn't need to bother about recording stuff?
 
@FlorianMargaine Yeah they would 'record' stuff, but they'd simply press a button the extension provides (like the x-debug plugin gives) in the browser, and then click on stuff. Each click / interaction will be sent up to the api. Then they click stop recording
 
@EquinoxMatt A lot of it is driven by the fact that people are have shitty code that is very hard to unit-test. Being able to give up on unit-testing and just write integration/acceptance testing makes people be able to ignore how crap their code is, and so makes them feel better about themselves.
 
2:29 PM
@Jimbo ah, so you mean they wouldn't even need the selenium extension/driver stuff
 
@LeviMorrison I did this once. It bc breaks token_get_all() output + bc breaks code like 3v4l.org/T7Rv8
 
@Danack - I will remember that! Thanks. I might give some unit tests a try on my current project
 
@marcio code like that should break... who the hell does that
 
@PaulCrovella emphasis is on token_get_all.
 
@FlorianMargaine Exactly, that'd all be running on the server
 
2:32 PM
@Jimbo and a simpler extension
 
Jimbo - did you used to work with Joeseph Gordan?
 
@EquinoxMatt Nope, why?
 
nvm - just curious :) small world the NW UK :)
 
@bwoebi auto capture thing will not work in this case right? $a = "foo"; $fn = $x ~> $y ~> $x . $y . $a;
 
@nikita2206 useless return ;-)
 
2:36 PM
@FlorianMargaine eh yeah, thanks :P
 
@nikita2206 It will
 
$fn("baz")("bar"); "bazbarfoo"
weird function, I guess
 
ok, that's awesome, although I don't understand how
 
@nikita2206 Try writing it expanded with closures.
$x = 'foo';
$f = function ($y) use ($x) {
    return function ($z) use ($x, $y) {
        return $x . $y . $z;
    }
}
$f('bar')('baz') // foobarbaz
 
@DanLugg with current explanation: "capture every cv from this function" it's not clear how the outermost function got $a in the cv table, for me
That's why it's weird for me. But it's good that it works this way
 
2:43 PM
@DanLugg remove the use() and try to guess what happens.
 
Agreed! Asking "why" just leads to disappointment.
 
(pretending there is auto import, ofc)
 
Why would it be any different?
 
for some people the logical thing would be that since the first function makes no reference to $x, then $x wouldn't be imported into the second function's scope.
some people = those proposing 3v4l.org/nVK6F
 
Some people think it's logical to make toast with a blowdryer.
 
2:50 PM
¯\_(⊙_ʖ⊙)_/¯
 
Sometimes I forget that they're compiled from inside out
 
@marcio Wait, why would ... what/
Wildcarding makes no specific mention either; why would it be any different?
@marcio The same argument could be made with unreferenced parameters.
$f = function ($x) {
    return function ($y) use ($x) { // KABOOM BECAUSE $x IS JUST CHILLIN
        return $x + $y;
    }
};
 
Ahoy hoy
 
Blowdryer toast. It's all blowdryer toast.
 
2:55 PM
@DanLugg IDK, I could infer this because the same people also proposed 3v4l.org/cBKEj
 
@marcio one of the more stupid suggestions...
 
Indeed.
 
Yo ho ho
 
@NikiC lolwut. sure, this is not under discussion.
 
It's why I sent a message asking people to stop proposing new use() syntax.
I went to bed wondering if I would regret it.
So far I haven't.
 
2:58 PM
@ircmaxell I read that in Mr Burns' voice. :)
 
@salathe precisely how I intended :-D
 
@DanLugg I'm going to dv one of your questions to fix your rep.
 
@BhawinParkeria isset($_FILES['userfile']) didn't work. isset($_POST['userfile']) did..
 
@anaslmt think you might have the encoding wrong on the form .. php.net/manual/en/features.file-upload.post-method.php
make sure you have enctype='multipart/form-data' on your form tag
 
@AlmaDo Please do, lol
 
3:03 PM
@NikiC @DanLugg perhaps I should just stop trying to dive into their minds that deep, the arguments are nonsensical. It looks like their problem with auto imports is because it involves change.
 
hi man
I do have that
 
@marcio That sounds like a reasonable assertion.
PHP 8 should go the way of breaking more shit, ie: closures auto import.
 
I'm just using isset to check if a file is selected or not when I click my submit button
and @BhawinParkeria said it's isset($_FILES['userfile']) but it didn't seem to work
 
looks like a memory_get_usage bug exists in PHP 7: 3v4l.org/fCTKW
 
instead with $_POST it did
 
3:06 PM
> C++ is not the best place for picking up syntax choices, quite frankly it's one of the least readable languages…
Glad someone said it.
I really wanted to.
 
@anaslmt okay... so you are selecting a file not uploading one... that makes sense then.
 
@ircmaxell You're using true.
 
oh i want to upload it, I just didn't add the code for that yet. for now i just wanted to obtain the name of the file so I can add it to the database
let me add it and get back at you
 
@NikiC and...?
 
you wouldn't expect it to change
not like that ...
 
3:16 PM
@ircmaxell true reports how much the allocator uses, not how much was allocated
So if no new segment has to be allocated, it'll just stay 0
of course could still be a bug, just saying that it doesn't have to be one
 
@LeviMorrison okay great… looking forward to it :-)
 
started uopz_assemble ... but going to sleep this evening ... probably tomorrow ... or monday ... /cc @ircmaxell
 
@nikita2206 it's just going through the AST recursively... ;-)
 
@NikiC u still here ?
 
@JoeWatkins ya
 
3:30 PM
can you tell me why first tmp var has an index of 8 here ?
 
@JoeWatkins tmp vars are indexed after the cvs?
 
but only one tmp var is used and there's not enough cv's to account for that
 
@JoeWatkins don't forget the execute data overhead
 
((c - sizeof(zend_execute_data)) / sizeof(zval))
accounted for
wait, do I need to align the ex data ?
 
#define UOPZ_VAR_NUM(c) (c > 0L ? c / sizeof(zend_string) : c) < zend_string???
 
3:34 PM
@DanLugg oh no.. missclicked :\
 
needs to be ZEND_MM_ALIGNED_SIZE I think
 
@JoeWatkins ZEND_CALL_FRAME_SLOT is the number of slots to skip
 
@JoeWatkins Also what's c in there? And are you maybe just looking for EX_VAR_TO_NUM?
 
znode_op->var
 
3:37 PM
@JoeWatkins in that case, EX_VAR_TO_NUM should do. Subtract last_var to skip CVs
 
hi man
anyone use joomla?
 
@NikiC for all cv/tmp/const ?
 
@JoeWatkins for tmps
 
@JoeWatkins for cv it's just EX_VAR_TO_NUM, for tmp you additionally subtract last_var. consts are separate
 
ah
#define UOPZ_ZVAL_NUM(c) 		((c > 0L ? (c) / sizeof(zval) : c) - ZEND_CALL_FRAME_SLOT)
#define UOPZ_CONST_NUM(c) 		((c > 0L ? (c) / sizeof(zval) : c))
#define UOPZ_CV_NUM(c) 			((c - sizeof(zend_execute_data)) / sizeof(zval))
#define UOPZ_VAR_NUM(c) 		(c > 0L ? c / sizeof(zend_string) : c)
these yield the correct results ... are they wrong, or just awkward-ish ?
I need to be able to reverse it, so I need to understand it without relying on black box macros, or trying to remember fourty of them ...
 
3:55 PM
19 more followers is all I need!
@NikiC Ahhhhh
 
another question @NikiC ... why do we need to skip slots at all ??
sorry if stupid questions ...
 
ouuuuu
 
@JoeWatkins because otherwise we'd have to add the slots on every runtime access of a tmp
@JoeWatkins ZEND_CALL_FRAME_SLOT also applies to CV_NUM
but really, better use tho zend macros...
 
yeah, think I will
thanks for help
still, need to know how to reverse it ...there's no EX_NUM_TO_VAR ...
is there (by another name) ?
 
@JoeWatkins ZEND_CALL_VAR_NUM with NULL as first arg
it's all kinda messy ^^
 
4:05 PM
existing is good though ... ta
at least you don't have to copy all this crap into your code anymore ... I'm grateful for that ...
okay good ... that's enough for today ... later all
 
 
1 hour later…
5:07 PM
holy crap I'm tired
today is not Friday
today is Thursday
crap that means the week isn't over yet
crap that means I have to be productive today, doesn't it
 
$double = { $x => $x * 2 }
$mul = {$x => {$y|$x => {$z|$x,$y => $x * $y * $z} } }
hmmmmmmmmm
hmmm
/ flees
 
what is that thing?
it looks horrible
 
no thanks
 
What about required parentheses and braces? Would that be ambiguous?
$f = ($x) { $x + 1 };
 
@iroegbu you should see the other one news.php.net/php.internals/88613
// proposed
fn($a, $b @ $c) => $a + $b + $c;
// vs.
function ($a, $b) use ($c) { return $a + $b + $c; }
this is gross.
 
5:18 PM
please, god, no... That thing is the S.I. unit of filth
 
$f = lambda($x; ; $x + 1);
^^ I'm okay with that.
 
I don't believe you.
 
$x = 1;
$f = lambda($y; $x; $x + $y);
Yea, that's okay. Though, I think moving toward auto-import would be spectacular.
 
WE’RE MORE OF AN MPE SHOP THAN AN MVP SHOP MINIMUM PASSABLE EFFORT WHATEVER’S THE LEAST AMOUNT WE CAN DO WITHOUT BEING OUTRIGHT SUED
 
Anonymous
PHP7 is getting uglier and uglier.
 
5:32 PM
$a = 2;
$f = fn ($x) => $x * $a; // This is awesome. Let's just stop the debate here. :-D
@samayo ?
 
Anonymous
@Trowski The syntax for all those closure/lambada/anon function fest is just dull.
 
Anonymous
Syntactic sugar is supposed to make it easier to write, but this is the opposite.
 
You do know that none of that has been added to PHP 7, right?
 
Anonymous
Yeah. But it still will be part of 7 anyway.
 
@Trowski no no, we just need enough monkeys and keyboards to produce every possible syntax.
 
5:37 PM
@marcio or just larry wall
 
@samayo Most of the syntaxes suggested in the arrow function thread are horrible. I think the original syntax is just fine and very readable. Finally gives => another purpose too.
 
@PaulCrovella he has a unique taste wall.org/~larry
 
Preliminary version of the arrow function RFC.
3
Still deciding exactly what will make it in and what won't.
 
I am working for @InstanaHQ now. Check out our early demo at http://instana.com - Thanks to my new colleagues for the warm welcome!
FYI
 
@Gordon Neat. Congrats, man.
 
5:51 PM
@LeviMorrison I think it's worth noting that keeping function helps discoverability
It's still obviously an anonymous function, even if you've never seen the new syntax
And function is googleable, unlike ~>
 
Yeah.
 
This, to me, is more convincing than the parser thing
 
That's shocking given you've probably worked with our parser.
 
No no
Don't get me wrong, I understand getting stuff to work would be difficult, and that Bob's thing was probably a hack
 
@PaulCrovella thanks
 
5:53 PM
How to get the id of inserted row (in mysql) ?
 
> Use your LinkedIn or Xing account to try our demo.
shame about that though
 
I still think using lambda for the auto-import short closure syntax keyword is worthwhile....
 
@LeviMorrison Also, will you include the possibility of => {} with its own vote?
@Charles it could work (wasn't it me who suggested that?)
 
@Charles You mean that silly lambda(;;) stuff?
 
but I mean, function is basically a lambda too
it's weird
 
5:55 PM
@LeviMorrison Only without the silly: $foo = lambda($x, $y) => $x + $y;
@Andrea I don't know if you did, but I saw it pretty early on in internals.
 
What was proposed on Internals wasn't so simple :D
 
I think using lambda there instead of function helps reinforce the import thing and also retains googleability.
I mean, this syntax has different functionality than a normal anonymous function so using a different way to reference it isn't absurd.
I don't think fn has the same impact on this one, fwiw.
 
@Charles huh
my other idea would be to just make function implicitly import
making use($foo) mostly redundant except for variable variables and references
 
@Andrea I dunno, given that an anonymous function can be passed around to places where the variable scope has changed, I don't think that automatic import is a good idea for the existing anonymous function creation bits. I think explicit was the right choice there.
 
Okay, I'm done with Internals for a bit.
I'm getting a bit too enthusiastic.
Okay, someone please call out Rowan on list.
He's being retarded.
Well, nobody has to call him out. Perhaps ignoring him would work just as well.
I just prefer addressing things over ignoring them, though realize that's not always favorable.
 
6:25 PM
@LeviMorrison I would avoid using that word
 
@Andrea You are probably right.
Sorry.
 
You don't need to apologise to me! Just general advice
Also, hiya @Sara
 
He is rapidly responding with low effort posts that are turning signal into more noise.
 
Ah
What, like me in 2012? :p
 
6:52 PM
mwah hah hah hah ha
<?php
	function add($a, $b) {
		return $a + $b;
	}

	$d = uopz_disassemble("add");
	$c = uopz_assemble($d);
	$e = uopz_disassemble($c);

	if ($e == $d) {
		echo "evil\n";
	}
?>
/cc @ircmaxell ... not done yet ... nearly though ... crashes if you try to execute assembled function (as closure), dunno why yet ... probably just missing something ...
==21227== Jump to the invalid address stated on the next line
==21227==    at 0x0: ???
==21227==    by 0xDEEC841: uopz_execute_ex (uopz.c:565)
==21227==    by 0x94B7D1: ZEND_DO_FCALL_SPEC_HANDLER (zend_vm_execute.h:800)
not super helpful trace ...
ah, no handler set on oplines ...
doh
well now it doesn't crash but nothing comes out ...
my head is spinning ...
 
@JoeWatkins You've gazed into the abyss too long.
 
if ((op = zend_hash_str_find(Z_ARRVAL_P(disassembly), ZEND_STRL("cv")))) {
		*type = IS_CV;
		operand->num = (Z_LVAL_P(op) * sizeof(zval)) + sizeof(zend_execute_data);
	} else if ((op = zend_hash_str_find(Z_ARRVAL_P(disassembly), ZEND_STRL("tmp")))) {
		*type = IS_TMP_VAR;
		operand->num = ((Z_LVAL_P(op) + ZEND_CALL_FRAME_SLOT) * sizeof(zval));
	} else if ((op = zend_hash_str_find(Z_ARRVAL_P(disassembly), ZEND_STRL("var")))) {
		*type = IS_VAR;
		operand->num = Z_LVAL_P(op) * sizeof(zend_string);
see how long you can look at that ...
:)
 
hacktoberfest.digitalocean.com >> I want a tshirt =] The gist is, sign up, do 4 public pull requests... So if anybody got or knows project which I could throw together a couple hours of work (docs, code, tests or ?).. let me know please..
And happy almost frydaaai!
 
7:11 PM
@Gordon That looks really interesting. Some feedback i) there ought to be a signup button separate from the demo button - I didn't realise that the demos was the way to get to the signup. ii) Linked in? .....why not github?
 
Ideally you should be able to view the demo without signing up with anything.
 
Perhaps they meant 'trial' rather than 'demo'. Wasn't able to tell.
Actually - a copywriter could do more polishing:
> Browse our live demo and register to keep in touch
'browse' ?
 
Check out our live demo
 
"peruse" perhaps
and if they really meant trial instead of demo (I've no idea, I don't have a linkedin account to sign in with), then they should put together a proper demo
 
@JoeWatkins :-)
 
7:21 PM
I think this should ensure uopz place as the scariest extension for php7 :D
and people thought threads were scary ...
 
@JoeWatkins awesome
JS has this built-in, kinda :D
one of its more interesting features
Try this: foo = function (a, b) { return a + b; }; console.log(foo.toString());
Then do bar = eval('(' + foo.toString() + ')'); console.log(bar(1, 2));
;)
also, by the way, I have a public Twitter again
the timing of its creation is no coincidence
...I ignore PHP internals for a few days, and then this happens
D:
@LeviMorrison I might mention this in the talk (though it's not on the slides)
@salathe because \u{...} is the syntax, and I'd prefer to spot mistakes at compile-time, rather than just silently bork the string (people failing to notice broken escape sequences is not that unlikely)
@Charles but it's automatic import of the variables used from the call site... it's not dynamic scoping
 
7:37 PM
@Andrea "mark all as read" is your friend.
 
@Danack oh, I know :)
that's how I handle threads I don't care about
 
does anyone know if PHP 7 fixed the hashDoS problems?
i.e. by upgrading to siphash
 
@ScottArciszewski no....something else was done I think. And I think it's in current versions....
@ScottArciszewski nikic.github.io/2011/12/28/Supercolliding-a-PHP-array.html - unless you're talking about something else?
 
7:53 PM
<?php
	function add($a, $b) {
		return $a + $b;
	}

	$d = uopz_disassemble("add");
	$c = uopz_assemble($d);
	$e = uopz_disassemble($c);

	if ($e == $d) {
		echo "evil\n";
		var_dump($c(1, 2));
	} else die("nope");
?>
evil
int(3)
some of it still doesn't look right ... but going well ...
 
@Gordon very impressive
 
@Danack those evil elements took me 28 seconds on 5.6 and 4 seconds on 7 - still pathological, but improved
 
> Whenever I ask my other half why Lord Voldemort has no nose, she replies "he done something really bad" ... prepare to loose your nose ...
fair warning, I think ...
 
@ScottArciszewski never gonna happen
 
8:16 PM
@JoeWatkins Because Lord Voldemort is very careful about public relations, of course
 
hehe
 
need to slim down my talk a bit, still
handily, I seem to take one minute per slide, on average
problem: 67 slides, 50 minute time slot
 
$slides = array_intersect_key($slides, array_flip(array_rand($slides, 50)));
 
/me sleeps, nn
 
@JoeWatkins night!
@PaulCrovella D:
also, whoa!
I had no idea array_rand had a second parameter. That's super handy
> "array_rand()" produces weird and very uneven random distribution
you had ONE JOB
 
8:35 PM
if you're calling it multiple times just make sure to reseed it via srand each time - particularly on windows
 
oh yeah, it uses srand. that sucks as well
I want to rewrite array_rand at some point to make it not awful
it shouldn't be predictable, at least not by default
 
@Andrea I read it as "pin temals"
 
@tereško heh
 
well .. at least my brain made something vaguely polite
 
ughhhhhh
why does news.php.net keep timing out
ffs
 

« first day (1811 days earlier)      last day (3143 days later) »