« first day (1501 days earlier)      last day (3447 days later) » 

11:01 AM
@JoeWatkins Yeah, works pretty alright.
Kinda slow the last time I worked on it though, I hope they've optimised it with v2
Ugh, why is that guy adding "thank you" comments to all PR's that were merged ...
 
@JoeWatkins I... uh... what does your company do again? :-P
 
hehe
 
@JoeWatkins Back then I first resized the image and then grayscaled it.
Before face detection.
 
Fuck me, Derick's appeared...
 
11:07 AM
He'd disappeared?
 
No, it's just he's popped up in the Unicode Escape discussion :p
 
Probably because of the occurrence of "php6" in one of the emails.
 
11:19 AM
@Levi I'm back...
 
@bwoebi ^^ jolly good
I'm currently building php-src since I'm on a different machine.
Should be done shortly, I hope.
Done.
Note there is one error I wasn't aware of on my Mac: I used false instead of 0.
Apparently clang just deals with it.
@bwoebi What branch do you want to work off of?
 
master I think
 
I'm glad I am working off a ramdisk; builds and tests go so much faster ^^
 
@AndreaFaulds :/
 
11:32 AM
@LeviMorrison :\
 
@JoeWatkins Does cascade work well with moving objects? Or should background subtraction be used?
morning room.
 
@Leri I don't think so, there might be something in opencv that does it ... I dunno much about it ...
 
@bwoebi So... I'm not really sure where to start. Any ideas?
 
@LeviMorrison not yet
 
user986408
when versioning apis do you only version controllers or models too?
 
11:37 AM
@JoeWatkins I think I stay with bg subtraction.
 
@LeviMorrison actually I'd rather do another class-specific pass after file compilation instead of changing pass-two which is only there for cleaning up opcodes...
 
@bwoebi Generators do stuff too in there.
And I add to it for return types.
But
We can start there.
 
@LeviMorrison Generators do stuff based on opcodes (checking for ZEND_RETURN(_BY_REF)), you don't.
so I think it's the wrong place to work on.
 
I have to check for valid return types (Generator, Iterator, Traversable) from generators. It can't be done earlier. I also no-op the return type checks within generators.
 
@skripted can you elaborate on that a bit? not entirely sure what you're asking
 
11:42 AM
@LeviMorrison You anyway don't need return type checks there as it's all ZEND_YIELD... so nothing to no-op there.
 
@bwoebi You can use return in generators, mate.
 
@LeviMorrison just return without arg.
 
and, you can't know ahead of time that is a generator, necessarily.
This isn't the issue; I've gone over this with NikiC already. Just focus on the task at hand ^^
 
@JoeWatkins Give me a song library and I'll sing write a PHP extension around it like I mean it know how it works
 
user986408
@DaveRandom well, i want to version my api and i'm not perfectly sure how to start, there are people suggesting to put the version into the URL, others say to put it into the accept header, some say you start a new instance for each api, some say you implement it code-wise
 
11:44 AM
quick question: is typechecking actually a separate op or part of ZEND_RETURN?
 
The return type check is a separate op.
Again, please stay on task ^^
 
ah okay
well, just wanted to understand… Going back to task now^^
 
^^ thanks
 
And btw. I'd do the removal of the type check ops in pass_two, but still do the class resolution in another step.
it's about doing things at the right place, not about centralizing all the code in some same place.
 
Well, right now we cram so much into pass one. It's ridiculous.
I honestly think we should have a few more passes for doing things a bit more cleanly.
But... not sure how others feel.
 
11:48 AM
@skripted I personally would say that the version number belongs in the URL and that it makes your life a lot easier if you do it as a sub-domain. That said, if you don't need to refer to other parts of your API in responses (i.e. issue redirects or provide links) then putting it in the path would be almost the same. But one thing I am sure of is that the two live versions should be handled (at the web server level at least) as two separate applications
The principle reason for handling them as separate applications is that it would allow you to e.g. patch-deploy or turn one of them off without affecting the other
 
user986408
@DaveRandom thanks for the input :), so basically you suggest to not extend the main application with new controllers of the same type (UserController_v1.php, UserController_v2.php) but rather start a new project
 
user986408
yeah, turning off or deprecating sound reasonable
 
@skripted do you use git?
 
user986408
yes
 
@skripted (from master) git checkout -b v1; git checkout -b v2. Work in the v1 branch for version 1, and the v2 branch for... you get the idea. It's probably not a whole new project, but more a new version of the same project.
Unless it's a total ground-up rewrite, in which case a whole new repo would make more sense
 
user986408
11:53 AM
i get the idea :)
 
But in my experience "v2" tends to be based on v1, in which case it could be useful to retain the v1 history into v2
 
user986408
yeah
 
user986408
@DaveRandom hm what if i had a node or go application, i would then need to run both instances (to be backwarts compatible), but would need to run them on separate ports. how would you handle this?
 
user986408
would you configure a vhost to point subdomains on the ports?
 
nginx as a reverse proxy
 
user986408
11:56 AM
aah
 
(or haproxy, or something)
I personally would go with nginx, but there are other good solutions available
 
user986408
i see, that's all so far, thanks mate :)
 
no worries :-)
 
@Levi agree, there's a lot in pass one, but also it's not necessarily a "pass". It's more pass one does it all and pass_two does cleanup (e.g. which can't be done in pass one).
 
Yeah. I know NikiC has some ideas of what things he'd like to do if we had another pass.
@bwoebi I've been looking up references to when do_bind_inherited_classand zend_do_inheritance are called, but haven't found anything enlightening yet. You?
 
12:09 PM
@LeviMorrison you mean here in delayed binding: lxr.php.net/xref/PHP_TRUNK/Zend/zend_vm_def.h#5306 ?
 
It's called from zend_compile.c too.
 
in early binding, yes
we have early binding, delayed early binding (at end of file) and delayed binding op
 
Delayed early binding is only used in opcache, yes?
 
yes
To do what you like to, you probably need to collect classes and add an extra step at the end of file.
current passes actually are on an op-array basis, so yours doesn't really well integrate with that.
 
Don't we already do that?
Maybe opcache just does things differently.
 
12:14 PM
opcache, yes. I don't know exactly what goes on there either.
 
They should be registered in the class entry table after pass one, right?
 
in class entry table, yes. But you only want not-yet-resolved classes?
 
Ah, but I'd need to know which ones to iterate over...
 
that's it.
 
This is why I was thinking a separate full pass would be nice ^^
 
12:17 PM
You theoretically could do that. You just have then to maintain references to the op_arrays in that file...
IMO, it's cleaner the way it's done now.
 
Do the things in place when you can. Don't store them to do it later.
That's messy too.
 
Doing a per-file class table has advantages and disadvantages.
 
well, it mainly introduces class<->file bindings which aren't really necessary
I'd just do the same like with autoloading here.
 
I don't understand what that means.
 
12:21 PM
@LeviMorrison Well, delayed binding.
 
What happens is that both classes get declared at runtime and the first needs the second and the second one isn't there.
Triggers autoload... which fails since it's in the same file.
This is why I don't mind autoloading if they are already in separate files; but Rasmus and others think same-file stuff should be supported.
 
@m6w6 not sure if this is helpful or not, but the prepareAsync()-related segfault does seem to be related to the order of object dtors, if I gc_collect_cycles() in the appropriate place in my code then it doesn't happen (here, although I don't expect you to pick through that code and work out what that really is)
 
@DaveRandom I'll take a look, your feedback is greatly appreciated
 
Sigh ... and again I end up answering my own question; oh well, I hope it's useful to the next poor lad.
 
@LeviMorrison eih, you don't need a bound class to do the delayed binding? The ce is already there, just not verified if everything is correct, traits etc.
 
12:25 PM
@m6w6 I have one more issue as well, Statement::descAsync() is generally borked but I haven't got a coherent bug report yet. I notice you pushed a couple of nice looking commits this morning :-)
I haven't started implementing cursors or transactions yet, but the plan is that I will touch every part of the async support
 
@bwoebi Maybe I'm doing something wrong currently, but as far as I can tell I'm already using delayed binding and it doesn't work.
 
@LeviMorrison can't tell… would have to look at your code…
 
Here's the comparison; starting here may be helpful.
 
@m6w6 I'll start opening bugs on bugs.php.net and stop bothering you directly as-and-when I find stuff as well :-P
 
@DaveRandom I'm afraid pq is missing from bugs.php.net, no idea why...
@DaveRandom async007.phpt covers descAsync()
 
12:28 PM
@m6w6 will check it out, ty
 
@DaveRandom do you use persistent connections?
 
I haven't yet, I've added "support" but I haven't actually tried executing that code path yet
@m6w6 @salathe do you have access to fix the issue this message is replying to or should I go bother bjori?
 
@DaveRandom I don't know if bjori does, @Tyrael can add new packages to the list.
 
Awesomesauce tnx, I'm sure he'll get that ping at some point :-)
 
he's chatting in #php.pecl at the mo if you want to poke him
 
12:37 PM
Will shortly, the vpn I currently have connected inexplicably breaks specifically irccloud and nothing else, which is weird since it's just a web page :-S
Must be some stupid routing somewhere I guess, never bothered to debug it because it doesn't annoy me enough
 
OT: Awesome Hiromi "Jazz in Marciac 2010"
 
@Levi I see nothing why it really should fail. I'd need to compile and debug that myself...
 
is there any way to get the number of object references (as in get the return value of zend_objects_store_get_refcount() for a given object) in userland?
 
12:53 PM
@DaveRandom afaik there's only debug_zval_dump().
 
@DaveRandom if it's about pq, try master
 
@Ja͢ck Which a) is completely useless since 5.4 anyway and b) even if it did still work/work the sane way (signature by-ref instead of by-val) it would give me the zval refcount and not the object refcount :-(
 
@Levi is the delayed binding opcode ever emitted? Doesn't seem so to me... … wait.
 
@m6w6 It is, but it's about debugging my own code really. The gc_collect_cycles() call is constantly one step behind (frees the last executed op rather than the one that just finished), and I'm intrigued as to where the extra ref is coming from. I will try master at lunch though and report back :-)
 
@DaveRandom Exactly.
 
12:57 PM
It's probably that a closure has it bound as its $this or something
But I can't see where
async programming can be a bit of a headfuck :-S
Oh wait, duh, obviously it still exists, it's the caller
 
@DaveRandom You are fired yet?
 
And if you are, may I recommend shitexpress.com?
 
@PeeHaa No. In a way that would actually make my life easier right now... I could start my new job tomorrow if I wanted to
> You may NOT use our service to threaten, constitute harassment, violate a legal restraint, or any other unlawful purpose
Not sure what else sending turd in a box could be for
 
Does anyone know where in the documentation it's stated that (object) cast on an array with numeric indices leads to inaccessible properties?
I could only find this reference.
 
I think that's it
It's pretty clear though, what else do you want?
 
1:12 PM
Yeah, that's what I mentioned in my answer ...
 
@Levi I think the answer lies in why it fails to find C in your current example, but if you move the declaration of class C extends B {} to the top of the file, it fails in B...
 
I would have expected it here as well @DaveRandom
 
user986408
@DaveRandom i now got 2 different api versions, but now they are separated, is it true that i would need to manually update all old api versions and set a deprecated flag every time i create a new major version?
 
@Ja͢ck Yeh probably. If you write a patch I'll commit it, I don't have time atm
Or you probably have karma actually
@skripted Well, you certainly don't need to, I imagine you could. But what do you mean by "deprecated flag"? Where will it produce an error message to/who will see it?
 
@DaveRandom I can update the docs too ;-)
 
1:16 PM
@salathe unfortunately I don't have an account on bugsweb atm, and last time I checked we can only create new packages via manually inserting them to the db
 
@Ja͢ck fixitfixitfixit
 
so I can't help with that right now
 
@DaveRandom I failry certain I could arrange something ;)
 
@Tyrael Any idea who could?
 
@DaveRandom I'll dribble some copy and have it peer reviewed ... and by peer reviewed I mean you ;-)
 
1:17 PM
/me washes hands of this affair
:-P
 
user986408
@DaveRandom i thought of returning a redirect+location on old api versions, so that clients know the api changed and that the user should update the ios app
 
@Ja͢ck I think it just needs an extra sentence in the description, but a code example would be good as well probably
 
user986408
this would have been easier to determine if it would be one single api i thought
 
@skripted Well redirecting from old -> new would be kind of redundant wouldn't it? There would be no point in keeping both running if you are going to do that. If you have a specific app that is calling your API, a) is anything else calling it? b) does it have any kind of handling in it for this situation yet?
 
@DaveRandom Rasmus has, no idea who else (albeit I did ask them to fill out wiki.php.net/systems/sgvr20 with the info but it seems that nobody did it yet)
 
user986408
1:24 PM
@DaveRandom you are totally right lol.. i wouldn't need to run separate instances if i'm going to force clients to update from the beginning
 
@skripted I suggest you have a reasonable cycle where you keep both running (say, picking a number out of the air, 6 months from release of new version of app that uses new API) and then just turn the old API off. Anyone affected by this will then do one of 3 things: see there is an update available and update, Google the problem with the app and find they need to update, not notice (in which case they don't use it anyway)
You could release a small update now, while developing v2, that would gracefully handle the API being off and give the user a friendly message, but if people aren't going to update in the 6 months after v2 is released they probably won't install that either, so it would likely be a pointless exercise
@skripted does your app have any mechanism in it at the moment where it can display an error message from the API directly to the user?
As in, the version of the app that already exists that people already have installed
brb lunch
 
user986408
@DaveRandom this sounds very reasonable. well, my app isn't released yet, i'm working on both simultaneously right now and trying to think of api/app versioning before the launch and prevent complications in future. i think i'll go with running multiple instances like you said and deprecate the whole api after some time.
i will just need to implement a check for the client to understand if his api version got turned off
 
1:41 PM
@PeeHaa internet makes me sad
 
@skripted Ahh right OK. I suggest you implement it using a HTTP response code of 410 then
 
user986408
@DaveRandom oh, you didn't mean turning it really off, just always returning 410 on each route?
 
user986408
good point, how would the client know otherwise
 
user986408
unless i treat "server not responding" as a deprecation :D
 
@skripted Well that would be effectively "turning it off" from the user's PoV, you could do that at the web server level, there'd be no need to have a whole PHP application with routes to handle it. You could then just adopt a policy of "when there have been no 410 response for 6 months, remove it entirely" or something (but I imagine it would be harmless to leave it there forever, since you should do it in such a way that you'd never need to re-use that container
@skripted probably not a good idea, unless you found a host that guarantees 100% uptime :-P
 
user986408
1:45 PM
@DaveRandom haha true :D
 
@LeviMorrison Other thing for you to think about:
 
@skripted btw you should take a look at how does apigility.org everything. I couldn't actually get it to work (and can't be arsed to try again) but it appears to have very well thought out behaviour for how an API endpoint is meant to behave. So it's worth looking at and copying it's behaviour, even if you don't need to use something like that as an 'API framework'.
 
class A {
    function foo(): B {}
}
if (time() % 2 /* something random */) {
    class B extends A {
        function foo(): C {}
    }
} else {
    class B extends A {
        function foo(): D {}
    }
}

class C extends B {}
class D extends B {}
So, you need to first resolve what B is before you can bind anything to B. So, you really cannot do compile-time/class-binding-time resolution.
 
@bwoebi Is that valid code?
 
user986408
@Danack i'll check that out, thanks :)
 
1:48 PM
@SecondRikudo the code should be valid with return type hints
 
@bwoebi I referred more to the conditional definition of a class
 
@SecondRikudo that already works, yes
 
@bwoebi The fact that it exists, doesn't mean it 'works' :P
 
@bwoebi yes you can. At the end of compilation of the file, after all delayed early binding happens
 
> late early binding
gotta love PHP
 
1:50 PM
@ircmaxell which is an issue if you try to instantiate a class in that same file.
 
actualy, no
 
@ircmaxell try to instantiate A right after it's declaration in my example...
 
which is why I want compile time errors
 
@bwoebi I vote that a policy of "people who do silly things get silly results" be adopted there
 
?
 
1:52 PM
but why shouldn't you be able to instantiate A at that point?
there's no inheritance, so there's no variance to check
so even though B is undefined at that point, there's nothing stopping you from using A
 
@ircmaxell Before the if, B doesn't exist, it's needed as it's a return type for one of A's methods
 
well, A is a bad example. Try to instantiate B after the if.
 
no it's not
@bwoebi better example
 
you cannot do the variance check of B after it's declaration…
 
@bwoebi In some cases, sure.
 
1:54 PM
and I think that's fine to say "won't work". All classes need to be defined, or autoloadable if you use variance
 
@ircmaxell So this shouldn't work:
4 hours ago, by Levi Morrison
class A {
    function foo(): B {}
}

class B extends A {
    function foo(): C {}
}

class C extends B {}
or what?
 
why shouldn't that work?
you can delay binding of the variance until the end of compilation, so there shouldn't be anything wrong there
 
If you instantiate B before decl of C… variance check.
@ircmaxell but that's delayed early binding here.
because inheritance
 
@bwoebi 3v4l.org/vhTu0 as long as it's not a conditional declaration you're fine
 
@ircmaxell that's just because class A doesn't inherit from anything.
 
1:57 PM
@bwoebi class mysql doesn't exist. what would you expect that to do?
 
fail, I missed an i.
 
although if you mis-order things: 3v4l.org/HU1MO
 
@ircmaxell and we have exactly the same issue with return types. "they're misordered"
(because circular reference anyway)
 
no, because you can delay even the lookup until after compilation
which is something that PHP doesn't do today for inheritance unless you have opcache installed
 
as long as you don't do conditional declarations…
 
2:01 PM
8 mins ago, by DaveRandom
@bwoebi I vote that a policy of "people who do silly things get silly results" be adopted there
 
if (class_exists("foo")) { class foo { ... } }
^ which is IMO not a silly thing.
 
no
only conditional declaration where you use the class in the same file before the declaration
 
gerd mehrnerng
 
hey guys
 
okay, okay, I see.
Isn't it just possible to postpone binding until all the dependencies are resolved?
 
2:09 PM
as long as that's within the compile of the file, I am fine with that
 
eih, run-time. And when not yet resolved upon first instantiation, fail?
 
let me say this again: declaration errors must be raised at compile time
 
why?
 
in short, programmer sanity
 
PHP would almost benefit from a pre-runtime "linking" phase, where an autoloader could run. No it wouldn't. I need coffee.
 
2:12 PM
I mean, you anyway instantiate classes just after they were loaded because autoloading. @ircmaxell
so, it's practically the same for most cases.
 
don't we just need to test any how ?
 
seems restrictive ...
 
@DanLugg mehrnerng
 
@ircmaxell think I want the long answer ...
 
@PeeHaa myonyang pyah-hyah
 
2:16 PM
if we're going to have any kind of variance that makes sense, and not place arbitrary restrictions on code that is not autoloaded, then we're going to need some checks at run-time ... aren't we ?
 
@JoeWatkins yes. either at instantiation time or return-time
 
on the other hand we do already have restrictions on stuff that isn't autoloaded ...
return-time is too late imo
allowing the function to execute all the way to return seems wrong ...
 
you can do at call-time too...
 
as early as possible, is a good aim of course, but I think we're restricting what is possible to say that they must happen at compile time ...
 
@JoeWatkins fully agree.
 
2:23 PM
when we first discussed this idea, @ircmaxell had the idea of omitting an opcode to check variance, I wasn't clear on the details of how that would work at the time, I don't think we do anything similar right now, but we should probably revisit that if we want to hold onto covariance ... and I think we do want to hold onto that ...
we added an opcode to check the return value, but none for the inheritance checks, I think that's the only reasonable course of action now ...
maybe you can remember that train of thought Anthony ? I maybe dismissed it a bit quickly at the time so we didn't really explore it ...
I think ZEND_FETCH_CLASS will be the earliest place we can make these checks ... I haven't thought about it for ages and am probably wrong, but maybe some ACC_NEEDS_VARIANCE_CHECK could be set on classes who cannot have checks done earlier than that ...
I actually favour moving all the checks to one place, there is not much to gain from allowing a codepath to be partly traveled at compile time only to start again from the beginning at runtime because some information is missing earlier ... so it's either omit a new opcode somehow, I defer to Anthony's earlier idea, or making checks in an existing opcode like FETCH_CLASS ...
 
heading into the office
will reply when I get there
 
cool, got school run soonish, but will catch up with the conversation later ... I didn't know we were still struggling with this ...
 
Adz
hey guys, anyone use twig here?
 
Jul 27 at 21:28, by Danack
Hello, I have a problem, but I am too lazy to write the question out until some says that they will help me. http://sol.gfxile.net/dontask.html
 
Adz
I'm confused, is that aimed at me?
 
2:35 PM
@Adz yes
 
it means "ask your question"
 
Adz
Ok, I keep getting a Array to string conversion error in Twig when I try to access an index in an array using this array[j]
Notice: Array to string conversion in /var/www/html/Twig/Environment.php(331) : eval()'d code on line 61
Array
I've just started php so sorry if it's a simple problem
 
array[j] must be itself an array
 
Adz
something like <td>{{array[j]}}</td>
 
@m6w6 I can confirm that master fixes everything I've reported :-)
And the Statement::descAsync() was pebkac
Docs need updating a bit but it works as expected (will PR docs later)
 
Adz
2:40 PM
omggggg
that makes sense
i had a two dimensional array
it works now thanks
 

« first day (1501 days earlier)      last day (3447 days later) »