« first day (1597 days earlier)      last day (3351 days later) » 

3:03 PM
Ok, the game is afoot.
 
@ircmaxell No, don't remove it! Testing how callbacks behave is important. Revert your changes and split it into multiple files.
@marcio the ::class thing scares me and I'm not fond of unreserving keywords in case they limit future possible syntax
 
good afternoon guys :)
i'm trying to create the pattern to automatic create rota for the week
like i have different employee and i know which days of week they are available and what time
then i have venues and i know on what days it is open and close and timing
what is the best way to automatically generate the rota
any pattern? or suggested read
 
@Danack iirc some date classes show warnings and are in unusable state too
 
3:19 PM
@FlorianMargaine Do you know which ones? new DateTime([]); seems to throw an exception.
 
@Danack let me search.
@Danack I can find DateTime::createFromFormat('foo', 'bar'); right now
although it does seem to be consistent, my bad.
 
That's not a constructor.....although I don't like that style of returning null, it's not always wrong.
 
it returns false
I just remember, when I used to debug, having date objects with "Invalid date"...
 
Ok, something that isn't an instance.....but the RFC says to leave factory methods alone.
 
@Andrea Well… now I am curious… Is there a reason why you voted no on context sensitive lexer?
 
3:27 PM
scroll up @bwoebi .
 
@Danack not im my current backlog… will search.
 
19 mins ago, by Andrea
@marcio the ::class thing scares me and I'm not fond of unreserving keywords in case they limit future possible syntax
 
oh
I'm blind…
@Andrea actually… the ::class thing scares me too… why is that defined as a class constant? should be rather something like class(...)
 
Is it just me or has the RFC wiki page been somewhat truncated?
 
not just you…
 
3:31 PM
Which page do you mean?
 
Works for me
Btw
 
looks like someone edited it and the edit got truncated, from the looks of the last line
 
@VeeeneX look at the bottom
 
It works, but a lot of the implemented section is missing (like most of PHP 7 and all of PHP 5)
 
3:33 PM
I see hmm
 
I'm trying to load the old revision but it timed out :o
 
Ask Danack
Maybe
 
> rfc.txt · Last modified: 2015/03/01 16:02 by danack
:D
 
What do you prefer?
        public function setStatus(int $status){
            return $this->status = $status;
    }
Or
    public function setStatus($status){
            return $this->status = (int) $status;
    }
 
Obviously the first
 
3:35 PM
The former, and strip the return.
 
I know it's the same
 
@Danack You broke the rfc page
 
xD
 
@PeeHaa no, it's not his fault.
 
The last complete revision appears to be krakjoe's at 2015/02/28 07:58
 
3:36 PM
Even if it isn't I can still blame him :)
 
^^
 
@PeeHaa I didn't scroll down that far...
 
Yeap sounds guilty to me :D
 
Which mean @marcio broke it, judging by the revision comments =D
 
@PeeHaa that thing is terrible
 
3:37 PM
It's @marcio to blame!
 
@PeeHaa I meant I only added the link at the top.
 
@tereško Good thing one of the developers is not a vocal member of internals
 
btw. fixed
 
@PeeHaa you mean Stas ?
 
Should it be like this?
 
3:44 PM
@VeeeneX either one, depending of what the rest of your app looks like
 
@bwoebi So it's better if I choose only one of them?
 
yes.
 
What is better? For me it's like martinfowler.com/bliki/TwoHardThings.html
 
I'd use setStatus with return $this.
 
I would go with the setter without a return
 
3:47 PM
:D
 
also, I would do casting to int internally, because data from HTTP request and from DB tend to come in as strings even when it's actually a number
 
If it's called status, I'd expect it to return $this->status if there's no arg given, but that's usually ugly.
 
tereško do you mean magic method __set()?
 
@VeeeneX no, I means setStatus()
 
@kelunik well, if only we had getters/setters or properties...
 
3:49 PM
Good idea about that internal int cast
Changed to
        /**
         * setStatus
         * @acess public
         * @param int   $status      The HTTP response status
         * @return instance Aurora\Http\Response
         */
        public function setStatus($status){
                $this->status = (int) $status;
                return $this;
        }
 
@tereško yeap
 
@VeeeneX no. if (!is_int($status)) { throw new ArgumentException(); }
 
@VeeeneX do not return $this
 
@PeeHaa My first question was out of context
 
@FlorianMargaine lolwut, that would be an extremely retarded thing to do
 
3:52 PM
@VeeeneX do return $this :-D
 
@tereško why?
 
@kelunik go and learn what CQS is, please.
 
@FlorianMargaine I'm interested too
Why not tereško?
 
@FlorianMargaine because it is pointless in this context and will only fuck with the user
what would be the purpose on throwing that exception ?
why exactly would you prevent passing of "500" as value there ?
and what will you do when said value comes from mariaDB where numers are fetched as strings ?
 
@tereško It doesn't return data, it's just to allow chaining.
 
3:56 PM
@kelunik yes, and chaining sucks
 
So it's not a query, it's clearly a command.
 
Hmm, yes this make sense. I like how tereško changed db to mariaDB :D
 
@VeeeneX because it's a specific bug feature, that I spend 4 hours on
 
Ou, we love those bugs features
 
Really the only good place for chaining is probably a builder, not an entity
 
4:00 PM
@VeeeneX ---foo---
 
@nikita2206 even then you can as well just add a "bulk parameter setter"
something like
public function setParameters(array $list)
{
    foreach ($list as $key => $value) {
        $method = 'set' . $key;
        if (method_exists($this, $method)) {
            $this->{$method}($value);
        }
    }
}
 
@PeeHaa Thanks :D
 
np
 
@tereško this is usually one of the things that you try to avoid using builder pattern
 
well, it depends on case-by-case basis
 
4:02 PM
tereško it seems to be useful only with arrays?
 
@tereško Which doesn't allow any IDE checks.
 
@kelunik what are you talking about ?
ya know, forget it
I am out of fucks to give
 
@tereško yippie… just ignoring my invalid keys :-)
 
:-)
 
@bwoebi I use this for populating the entities (from external sources)
sometimes keys taht I am trying to dump in an entity do not really match
it's a quick and hack-ish , but works just fine
 
4:14 PM
If it's from an external source, not under your control, okay…
 
It turns out writing RFCs is a good way to get twitter followers.
 
yup
 
xD
 
Yes, seems like.
 
4:17 PM
@kelunik there exists a BadMethodCallException
 
@bwoebi I know, just didn't have the exact name in my mind.
 
@kelunik that's why I told you…
 
4:33 PM
@ircmaxell Why does this output an int instead of a float? 3v4l.org/HNUWi/rfc#rfc-scalar_type_hints_v5
But without strict mode it outputs a float: 3v4l.org/vNNRv/rfc#rfc-scalar_type_hints_v5
 
The first should imo blow up
Ow wait. The conversion thingy...
 
@PeeHaa It depends on whether widening is supported for return types.
 
:(
yeah
Forgot that one
A man can dream can't he :)
 
4:59 PM
@TheodoreBrown ints resolve floats. But there should have been a conversion. So looks like a bug
 
5:16 PM
How do you check for memory issues in PHP again?
 
php run-tests.php -m
 
Isn't there some in-built tool without using valgrind?
 
is one way.
there's leak detection....one mo.
 
with debug builds it'll do leak detection automatically
 
  internal_function = {
    type = '('
    fn_flags = 1
    function_name = 0x0000000000000000
    scope = 0x0000000000000000
    signature = 0x0000000000000018
    handler = 0x000000010047eeb7 ("/Users/levijm/Projects/php-src/Zend/zend_API.c")
    module = 0x0000000000000000
  }
I need to figure out how that signature is set to that value :/
 
5:22 PM
Set a watchpoint?
 
@PhilSturgeon It's MVC.
 
:P
 
@PhilSturgeon Such global.
Ah, it's on Exception::__construct.
Now to figure out how to intercept it on initialization so I can set a watchpoint.
 
break on zim_exception___construct ?
Or when exactly?
 
5:29 PM
Hi @all! How would one call the abstraction of classes and interface? The set of all integers, strings, floats, is called "primitives" in php, the set of classes, interfaces and primitives is called "mixed", but how to name the set of all interfaces and classes? "ObjectType"? Or "InterfaceOrClass"? Php itself uses "class" for many situations when interfaces are allowed too (e.g. ReflectionClass which can reflect interfaces also)... Any suggestions?
 
Sorry for interrupting your chat but quick question is it good for controller to return string view and write it to response body for example or to directly print it from controller?
 
@Henning This has come up before - and no-one seems to know a decent name.
 
@PhilSturgeon a warning please, I was eating
 
@tereško he described it as NUTS … Isn't that a warning?
 
@Danack thanks for your response ;) do you know where it has come up before so that I can read the discussion? I wouldn't even know which term I should enter to google regarding this question without beeing introduced to the differences between abstract classes and interfaces on each search result...
 
5:39 PM
In this chat room - but I can't find it. tbh I think there just may not be a single term.
Other than maybe 'OO types'
 
@Henning "object" for instantiated, class for non-instantiated
 
@bwoebi Turns out I wasn't initializing a pointer to NULL at the proper place when an opcode is created.
 
nice you found the issue :-)
 
Hopefully today I can get some initial results for my zend_function_signature changes.
I have no idea how many more places need fixing.
Hahaha, screwed something up
foreach (range(0,3) as $value) {
        echo "$i ";
}
echo PHP_EOL;
I get no output >.<
oh duh
>.<
$i $value
 
hai
 
5:54 PM
Hey Joe.
 
hi @LeviMorrison
 
Are you still taking those online classes?
 
kinda, gotta start again, gotta get passport first ...
they cancelled my funding :(
I could pay for it myself, but I'd have to do it much slower, it'd take me 6-8 years to finish in reality, whereas if funded you can do more than one module at a time ... finish in 3 ...
so gonna start again, september ... I have until then to get passport sorted ...
 
Good luck, mate.
 
I was doing quite well, and I really got on with the tutor too .. hopefully i can get the same tutor again ...
internals pretty quiet today ...
 
6:02 PM
That's probably a good thing.
 
@JoeWatkins It's not very quiet for a Sunday…
 
Yasuo isn't quiet ... everyone else is though ...
 
😯
 
I just got a box ... am I missing something ?
 
yeah, UTF8 support
:-)
 
6:05 PM
crappy
I liked this at first ... elementary ... thinking about jumping ship, it's doing annoying things ...
 
this?
 
suggestions ?
this os, I should have said ...
 
wait what? I'm confused as to what you're talking about
 
I'm using an os called elementary ... but it seems to be missing things and also keyboard layout is not working properly on reboot, and a few other annoying things ...
 
ah
 
6:16 PM
@JoeWatkins Missing what things?
 
@JoeWatkins Does your keyboard get reset on reboot?
 
6:29 PM
It's called "elementaryOS", and it's a fork of Ubuntu with an osx-like interface... And the Dev is an ass
 
@FlorianMargaine why? I wanted to switch some time ago, but didn't do it yet.
 
@kelunik yes, but it still says UK with the correct layout, but behaves as if US layout, then I add UK (one of the other layouts) and remove it straight away and everything is normal ...
 
@JoeWatkins That's some gnome bug, had that some time ago.
Which version of gnome-shell do you use?
 
@LeviMorrison apparently some fonts, but other than that; can't boot from raid 0, can't put / on raid 0
not sure
is not a gnome desktop ... it does use some gtk3 stuff ...
 
I though it was a gnome fork, hm.
 
6:35 PM
it's a new desktop called pantheon
it's very nice too, but not done yet, still got annoying things wrong with it ...
 
Looks pretty similar to gnome.
 
what I broke? :3
 
@kelunik rly, looks more similar to osx to me ...
 
@JoeWatkins not really OS X
 
@JoeWatkins If you found bugs in eOS, you can throw them at me and I will pass them to the right people
 
6:42 PM
@JoeWatkins Just with simple extension for that menu and a dock that's not part of the desktop manager.
 
I broke the RFC page? but but... preview. OK, seems fixed now. If I broke something, sorry ^^
@Andrea honestly, I think '::class' was the worst idea ever ^^ I'm happy to impair any analogous future additions. People will have to think twice before add another '::class' to the language because it would be a BC break from now on.
 
My issue with ::class is that it doesn't have an analogous way to get the FQN for other constructs, notably functions can't just do ::class or ::function unless we do some nasty magic.
 
I'd like to rename ::class to class()
though it'd be a horrible BC break :s
 
So you just do class(static) instead of static::class? (as an example)
 
yes
 
6:56 PM
That still doesn't port well to other features.
 
hmm?
 
function(push)
 
How would you use this with functions?
 
don't freak out: why not: SomeClass::__CLASS__ ?
 
Like, why would you need it
 
6:56 PM
@LeviMorrison would be unambiguous…
 
the docs says every name starting with __ is already reserved.
 
@bwoebi But not exactly clear what it is doing.
@nikita2206 When you have namespaced functions it helps.
When you pass names of functions to callbacks they have to be the fully-qualified string representation for them.
 
someIdentifier::class isn't clear too… you need to know that it returns the class fqn…
 
@marcio That's what would prefer.
 
@bwoebi I just meant that if we are going to change it we could do a lot better.
 
6:58 PM
@kelunik it's incredibly ugly, but at least it's consistent.
 
@LeviMorrison ah yeah, I didn't use namespaced functions much so I didn't think about it. Would be better though to be able to create a closure from a function
 
@bwoebi It doesn't work with constants.
 
How often do you use it? consistency > uglyness.
 
@nikita2206 Or rather functions are callables already and shouldn't have to be represented as strings in callbacks.
 
@LeviMorrison That anyway doesn't work now.
 
7:00 PM
Namespaced constants?
 
I mean… you can have function(...), class(...) and const(...) the identifiers naturally are respectively function, class or constant
 
constant() is already a function.
 
I was looking at the parser, trying to figure out how partial application could be implemented syntax wise, and one of the options was strpos($haystack, ...); - would return a closure that accepts needle and offset. So that could be used, without any arguments just to get the closure, I mean strpos(...)
Idk looks ugly actually, when without args
 
@LeviMorrison I said const, not constant().
 
Ah, that's true.
Confusing though.
 
7:03 PM
@LeviMorrison const is the token… constant just a normal identifier.
 
> Fatal error: Only variables can be passed by reference in /Users/levijm/Projects/php-src/run-tests.php on line 70
 
@LeviMorrison It'd be consistent to use the token with which the consts/funcs/classes are defined.
 
@salathe I bet you one (1) beer that at least two people put up a passionate defence of constructors returning null.
 
Well, the vote on removing PHP 4 constructors is going roughly as expected: wiki.php.net/rfc/remove_php4_constructors#voting
 
7:10 PM
@kelunik +1
 
@kelunik Use what, exactly?
 
@LeviMorrison ::class.
 
Quite regularly, actually.
 
Apparently people on Reddit have decided from my name that I am a troll. \o/
 
@kelunik depends. Too much ugliness is too much.
 
7:13 PM
morning
 
@LeviMorrison Where?
@Leri morning
@bwoebi If it's way too ugly but consistent, you should have chosen another syntax that is consistent but not that ugly.
 
I prefer nice and consistent… always.
 
@kelunik Consistent ugliness is what you want to avoid, if your language is forcing you to that, change the language as soon as possible.
 
@Leri Inconsistent ugliness is even worse.
 
@kelunik This kind of thing: 3v4l.org/oE6JT
 
7:17 PM
@kelunik Well, in that case author of that code should consider finding new hobby. :-)
 
@LeviMorrison 3v4l.org/tOUBA :)
 
@kelunik a ping… just for the sake of it :-)
 
@bwoebi ;-)
@LeviMorrison Yes, I don't use such things a lot.
 
Consistent ugliness is one possible definition for programming language beauty.
 
7:24 PM
unfortunately, GitHub doesn't allow to search for "::class"
 
it's widely used, there is no chance to consider ::class not widely used.
 
@marcio It only exists since php 5.5
not so widely used yet.
 
it would be ::class or new ReflectionClass... so people prefer ::class, obviously
@bwoebi I've been running many OOS libraries test suites recently because wiki.php.net/rfc/strict_argcount and I've seen ::class a lot
 
@marcio yeah… but we won't break old legacy cruft.
 
user895378
morning
 
7:31 PM
@bwoebi All my php code uses it
 
@bwoebi you really think there is a chance to rename it for PHP7? (not doubting it could be done, I'd love to)
@rdlowrey moring
 
@marcio no, but we can soft deprecate in favor of class()
Then deprecate in 7.1 and remove in 8 for example
 
@bwoebi suddenly the vision of hell on my mind. People fixing their code so they don't have to deal with the deprecation:
namespace Some\Ns;

class SomeClass {
     const class = 'Some\Ns\SomeClass';
}
s/fixing/"fixing"
 
That's why soft deprecate.
Without actual deprecation, just in docs.
 
oh, ok. Was any soft deprecation done before successfully?
 
7:37 PM
ext/mysql for example
 
well, sounds ok to me :) it's a major release anyway
 
7:50 PM
@bwoebi But you can use simple wrappers to mysqli_* there, so that's easy to "fix".
 
@kelunik you also can add a class constant ::class with something like uopz
 
@bwoebi Yes, but you would have to do that for every class.
 
@kelunik just intercept autoloader…
 
8:07 PM
@bwoebi Maybe I'm missing something, but your design for the coroutine delegation sounds very very complicated
Like "refcounted doubly-linked tree" sounds like total overkill
 
18 hours ago, by Danack
Sounds trivial. Can totally be done in a day or two by people who already have other stuff they urgently need to finish up.
 
@NikiC the refcount is just necessary, that, when another generator advanced it, we still are able to backtrack our way to a currently executing generator.
if we wouldn't refcount the nodes, we'd just get a segv or mem leaks…
@NikiC Also, the text is very detailed (which is probably why it sounds so complicated)… it won't be much more code than the text says.
 
@bwoebi I don't get what problem it is you are solving
 
@NikiC I'm solving the problem of Generators which are yield* multiple times…
 
user895378
I think it's going to be easier to understand what Bob is talking about once there's some code to look at.
 
8:13 PM
without having a stack to always traverse to top… but a pointer to top generator
 
@bwoebi Yes sure, but I think your solution is way over the top
Could you please explain why we need a a) tree b) a doubly linked one and c) a refcounted one
 
@NikiC okay… minute:
 
looks like scalar types v0.5 will be getting a 3:1 majority (75%)
 
user895378
@bwoebi and @NikiC ... python and js both allow yield * $anyIteratorNotJustGenerators ... should we support the same and just always use a null return value if the "subgenerator" wasn't actually a Generator instance?
 
@NikiC a) tree: we may have multiple chains of generators with yield* which then all have yield* the same Generator, which need to be merged Logical structure is then a tree (just a list with multiple children)
 
8:17 PM
@Andrea Maybe. There's still a significant number of people who voted no on the first one left to vote.
 
@rdlowrey I think so.
 
@Danack I think some people may not be bothering to oppose it this time round
given the previous vote
 
I wonder if the coercive one will actually be put to a vote.
 
@rdlowrey yes, I already implemented that part
 
@NikiC b) doubly linked … not sure yet if we need to store the parent of a node. We also can fetch the parent by looking at the current YIELD_FROM opcode we're currently at. But we definitely need a list of children, to see where we need to return to, when finished a generator.
 
user895378
8:19 PM
Okay, cool. Just making sure we were on the same page with that.
 
@NikiC c) refcounted: we're storing at the leaf nodes where current top node is. As there may be multiple leaf nodes, we may have leaf nodes which still point to an old, exited generator. We need to remain the reference to that node to see where we need to return to (that information is stored in that node). Refcounter is needed to be able to free the node when every generator left it unused.
@NikiC does that answer your questions?
 
@bwoebi Not sure
Why doesn't a more simply model where you only store a list of direct parents work?
 
@NikiC yes, and where do we go back when exiting current generator?
 
@Danack and fail spectacularly? maybe
but the problem is implementation
I may have disappeared from PHP (mostly) but I will criticise its implementation to no end as it's almost guaranteed to be awful
 
It being a large-ish BC break as well as conceptually stupid is probably a bigger problem than the implementation problems.
 
8:30 PM
@bwoebi how do you mean? after the generator exits you'll land in resume where you know the invoking generator right?
 
@NikiC so, you want to always go up the whole list when leaving a generator?
 
no
 
Or what did you mean?
@NikiC where is in resume?
 
@NikiC about your PHP-Parser, is it possible to end up with a method without the visibility keyword (since it defaults to public)?
 
@ThomasRuiz iirc public is automatically set if you don't specify anything
 
8:36 PM
@NikiC do you think you could change that? :P
 
user895378
Can yield* be split over multiple lines or is the whole thing a single token? e.g. is the following a syntax error:
 
user895378
yield
  *somegenerator();
 
@rdlowrey can be split.
by nature of the lexer.
 
user895378
k thx
 
@rdlowrey nope, not an error
@bwoebi Uh ... maybe we should just forbid advancing a generator externally if it's currently already part of a yield from?
Every time I think about this I get totally confused
multiple yield froms on a single coroutine is just weird
 
user895378
8:40 PM
@NikiC I would be fine with this.
 
user895378
I can't think of any good reason someone would want to do it anyway.
 
user895378
If you do that it's almost certainly ill-advised or because you don't know what you're doing.
 
@NikiC well, then the list merging and refcounting part disappears. A linear tree is just a special case of the general case I was aiming to.
 
@rdlowrey feel free to add it to open issues… if it is easy… then I'll add it, if it means a lot more complexity, I'll leave it out. Okay?
 
user895378
8:46 PM
@bwoebi sure thing. If I think of anything else I'll add it as an open issue. Any questions I've had so far I've just asked you guys so there's nothing currently outstanding in my mind.
 
Great :-)
 
user895378
I hate the wikitext inline code formatting tokens '' ... I feel like I'm writing python docstrings every time.
 
lol :-)
 
user895378
FYI I'll put the Generator Return Expressions RFC up for voting tomorrow.
 
@rdlowrey nice!
 
user895378
8:51 PM
I didn't realize it's already been two weeks ... that went quickly.
 
user895378
16 mins ago, by NikiC
@bwoebi Uh ... maybe we should just forbid advancing a generator externally if it's currently already part of a yield from?
 
user895378
@bwoebi ^ I'm going to go ahead and put this in the RFC for now. Cool?
 
I just asked for open issues.
 
3v4l.org/vlaQi < I expected (int) ($foo->bar ?? 0).
 
@kelunik ?? is a ternary like operator, it has very low precedence
 
8:58 PM
Yeah, I just started wondering where that notice comes from.
 
Anyway why Notice: Undefined property: stdClass::$bar in /in/fnfRg on line -1
 
lol "line -1" ?
 
@VeeeneX hhvm… yea…
 
9:42 PM
@kelunik I guess I'm just in a habit of always using parenthesis around what I want to be cast.
 
I thought that 42 is answer to everything @marcio @bwoebi
This will be like
 
9:58 PM
@VeeeneX it's not and I wish people would stop saying it is
 
42 is the answer to the ultimate question of life, the universe and everything. It's not the answer to everything.
 

« first day (1597 days earlier)      last day (3351 days later) »