« first day (2018 days earlier)      last day (2937 days later) » 

8:14 PM
@bwoebi Just to clarify the true and false stuff is in Future Scope.
 
@LeviMorrison ... oh
 
I haven't had a chance to review how your patch handles weak type conversions.
Can you walk me through that?
 
@LeviMorrison I have detailed it out in a comment
@LeviMorrison github.com/php/php-src/compare/… and the comment few lines below
 
@MadaraUchiha How he is able to write comment with 1 rep?
 
@LeviMorrison It's nothing harder than actually arbitrarily disallowing it in compiler though
 
8:17 PM
> If long passed and double allowed, cast to double.
Is that consistent with strict types without unions?
function f(float $f) {}
f(10);
?
 
@LeviMorrison As noted Weak rule table for unions (must be superset of strict); if strict rules fail... :
so, the strict types are evaluated first
 
I wasn't aware we permitted that in strict mode.
Hopefully only if it fits into a float without precision loss.
 
nah, always
at least that's current strict semantics
makes some sort of sense though, to not have the validity depend on the actual value, but on the type only.
 
Well... depends how you look at the meaning of "type"
^_^
 
It's all semantics and definitions :-D
 
8:23 PM
evening Levi
 
So basically I need to update the RFC with this patch.
Spam the list to tell people to try it out.
 
yes
 
yes, that ...
 
Anything else?
 
I wouldn't mind some cake ... have you got cake ?
 
8:24 PM
I don't, sorry.
 
just a question … will you actually include true/false in the RFC (move from future scope into main body) or shall I disable it for now?
 
I could maybe have some deliverd?
 
hehe :)
 
I like the true/false though…
 
I think the manual is a good reason for those
if nothing else
 
8:24 PM
@bwoebi You can leave it - I'll mention that it's included in the patch and people should also try that out to see what they think about it.
 
yeah
@LeviMorrison okay great :-)
 
when the rfc is updated, want me to get hold of sjon, or you gonna do it ?
linking to examples helps people ...
even people who can understand the patch ...
 
Sorry, sjon?
 
@JoeWatkins You can do that right now
 
oh 3v4l
 
8:25 PM
@LeviMorrison maintainer of 3v4l
 
super cool helpful guy, but probably a bit sick of me ...
 
@JoeWatkins Okay, I'm going to do that
 
Do you want me to link to https://github.com/php/php-src/compare/master...krakjoe:multi-type-scalars or will you open a PR?
 
@LeviMorrison let's open a PR
 
you can do PR'ing and the rest of it ... I had my fun, over to you guys :)
if I'm needed ...
but I very much doubt I am now :)
 
8:27 PM
Wait...
I am allowed to do a PR on that/
Am I a collaborator or something?
 
I'll make you one anyway
 
@JoeWatkins you wanted to fix the or/or/or thing
 
Can you add in Null?
I know we want to delegate to nullable types RFC.
 
@LeviMorrison not yet
 
But I want people to be able to play with it now if it's not too much work.
 
8:28 PM
We can add it trivially though
 
added collab
 
Hey guys!
Need an advice.

I need to update php version on my Ubuntu 14.04 server to 7.0.6 or 7.0.4 (7.0.5 doesn't work with zend-code dep.).

I only found a way to use ppa:ondrej/php repo, but it installs 7.0.5

Any ideas?
 
yeah it was actually disabled, when we couldn't decide what to do ...
 
@Levi so… shall I add it now? It's just removing one single line from source
 
I would branch for playing with null
it's avoiding a point of contention, it's not really about LoC ...
 
8:31 PM
@bwoebi Trivial to add and revert?
 
yes
 
Then we can have another branch that maintains a small diff that adds it.
 
With CQRS you send a command and get back nothing. With a REST API say you create a new resource by executing a command, do I have to query the read model to get this newly created resource back? Seems a bit crazy so maybe I'm missing something
 
@JoeWatkins actually, adding/removing IS_NULL is just the tiny case in compiler and adding it to valid scalar names
 
MD5("how many characters can be in here?"); ?
 
8:35 PM
@tibanez I'm not well-practiced with it, but I would say that you do not have to re-query.
If you just created a resource don't you have everything for it?
 
I know that, but by adding it, you are forcing the conversation about nullables to come first ...
 
I don't think it forces the conversation.
It's just allowing people to go try out the features.
 
yeah
 
well the solution is needed if it's going to be included in this patch, isn't it ?
 
This patch adds false and true which won't necessarily make it in anyway.
 
8:38 PM
yeah that's true actually ... maybe go all out I guess ...
 
@JoeWatkins well, we can actually add them in patch (it's just about a few cases in compiler), which can be trivially removed at any later time?
 
yeah sure, might as well do it I guess ...
 
I don't see an issue for NOW… When we go to vote, it should be clear
 
should go into detail about why it's bad ...
the patch is trivial, nobody should ask for one, one of us will do it if they do, or if it passes ...
 
8:49 PM
yeah, it's gonna take a shitload of justification... that part is painful to write :/
 
@PaulCrovella You're more than three weeks late by this point
 
dmitry is still proposing stuff for 7.1 ?
 
@JoeWatkins I was saying that this is clearly an April 1st RFC
 
oh oh
I'm so dumb ..
I think actually there are arguments in favour of removing it, and in favour of having both null and void .. at the very least, we should consider it again, no ?
/s/null/nullable-in-some-way, possibly null, possibly ?/
I dunno, it's not clear .. bob made some good points about having both the other night ...
 
@LeviMorrison I would have everything mostly everything for it but what if the resource has a createdAt field which obviously holds when it was created
When I send back this newly created resource I want this createdAt property to exist
 
8:59 PM
> php-src/Zend/zend_variables.c:43: _zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed.
What does that mean? I'm getting that error and cli-server is crashing.
 
@NikiC I'm sorry, but it probably wasn't…
 
version ?
 
PHP 7.0.5 (cli) (built: Apr 11 2016 07:36:20) ( NTS DEBUG )
 
@NikiC I think you know what that is ?
I can't find the commit, you linked me to it the other day, looks connected to that ...
 
@Levi @JoeWatkins btw. for reference the PR: github.com/php/php-src/pull/1887
@JoeWatkins nah, he disabled it in master only.
git.php.net/… @JoeWatkins ?
 
9:06 PM
yes, that, I didn't know where it was committed
 
@JoeWatkins I'd be glad if you could quickly fix the repeated or/and issue…
Then I'll poke Sjon
@LeviMorrison You do not need to be collaborator to open PRs … only to change contents of a repo. [which opening a PR isn't.]
 
where's the branch gone ?
oooh
 
@JoeWatkins Oh, I've removed that branch and merged into the old branch
 
I see
 
multi-types
 
9:14 PM
I thought I deleted it :D
 
no worries
 
Scalar type conversion: int|float|bool [Zend/tests/multi/scalar_004.phpt]
Scalar type conversion: int|bool [Zend/tests/multi/scalar_005.phpt]
Scalar type conversion: float|bool [Zend/tests/multi/scalar_006.phpt]
fails
(leaks)
 
9:31 PM
@crypticツ depends on what it says further down in the backtrace
 
9:46 PM
 true, integer or float
or
 true, integer, or float
pushed the former @bwoebi, and off to bed ... nn all ...
(still some leaks in scalar tests, look at those before pinging sjon, probably ...)
 
@tibanez Why does the database need to make this timestamp? Why can't the thing that creates the resource to it?
 
@JoeWatkins I've added a bit to it. If you (or anyone) feels like writing some I'd very much welcome any changes or additions.
@LeviMorrison, @bwoebi any opinions or suggestions if you get a chance gist.github.com/pcrov/3be13cb5937b096580d92293500c3319
 
10:09 PM
The void RFC was premature and I'm still sad Andrea didn't wait.
That's my opinion.
 
Wes
not only yours. but seriously, 7.1 is not here yet, why can't we try to block it?
 
s/block/fix
 
We should only move to adjust it when an RFC that adds null passes or sometime after.
 
Wes
but before 7.1 lays eggs, otherwise it's going to be hard, right?
 
Correct.
 
10:15 PM
if 7.1 makes it out with void, don't expect to ever change it
 
Bringing it up before one of the the union or nullable types RFCs gets serious is also premature.
It would just be noise.
 
Wes
eta of 7.1?
 
I'm not taking it to the list any time soon. The subject came up so I thought I'd draft something. I'd much rather see the other relevant RFCs resolve first.
 
@bwoebi Double-checking: I should link this PR?
 
Wes
if you need help/someone to review what you write, i'm here :B
what you guys decided to do? union first then nullable? or unions and intersections both together?
 
10:19 PM
please, go right ahead
just don't make me change the intro, that'll break my heart a little
 
Wes
@LeviMorrison i could feel your rage :B i mean when @Andrea put that to vote. i think she agreed that there was more to be considered though so i don't think she would oppose to fixing void, right?
 
10:41 PM
Any last feedback on this before I hit submit? /cc @bwoebi @JoeWatkins
Actually, I can't get it to compile.
> ext/reflection/php_reflection.c:3051:14: error: too few arguments to function 'zend_get_multi_type_declaration'
 
aside from the whole not-compiling thing it looks good to me
 
It looks like it needs a second parameter bool humans?
After looking at it a bit it seems it's for human readable text or not or something?
Not exactly sure what the not-for-humans option would look like...
ah, it's A | B vs A or B
 
11:05 PM
>.< Had some github UI problems for a bit there but fixed.
<?php

final class Some {
    private $value;

    public function __construct($value) {
        $this->value = $value;
    }

    public function map(callable $f): Some {
        return new Some($f($this->value));
    }
}

final class None {
    public function map(callable $f): None {
        return $this;
    }
}

function Option_map(callable $f, Some | None $o): Some | None {
    return $o->map($f);
}


$x = Option_map(function (int $x) { return $x * 2; }, new Some(1));

var_dump($x);
Polymorphic, not-inheritance based, type-safe code.
 
Wes
nice
 
I'm getting issues when mixing unions and intersections types:
function to_html(Array | (Countable & Traversable) $input)
Doesn't like the parens.
If I remove the parens it doesn't work either.
I think I can fix this though.
 
11:28 PM
@LeviMorrison Yeah, not allowed in the patch
currently it's either union or intersection but not both
Makes the handling significantly more complicated actually
@LeviMorrison correct
@LeviMorrison these things happen with incremental builds
 
Alright, updated the draft.
 
@JoeWatkins can't repro your leaks
 
@bwoebi I committed the fix.
 
yeah, seen :-)
@LeviMorrison LGTM :-)
 
Alright, sending.
 
11:36 PM
@PaulCrovella in general it's fine, (the text), but it will anyway need updates once it's clear how nullables are concretely handled
 
@bwoebi I can fix the grammar but not sure about the compiling stuff just yet.
 
@LeviMorrison the problem is the datastructure
@Levi while we're at the nullables… I think there's a point in favor of immediately including null in the RFC; we can currently foo(Foo|Bar $foo = null, $bar) [compatible with old semantics]; at that point we can just properly create the "new" syntax in form of null|Foo|Bar
because the type exists, implicitly, with different grammar for the parameters already
The advantage it has, is also making a parameter required if it's the last one
And, very obviously, return types.
I think the null may actually be a very strong case why vote yes at the whole package
just my opinion, obviously. Other people may have differing advice.
@LeviMorrison also checking mixed unions/intersections is much more difficult. Currently you can simply loop through in one pass … with A | (B & (C | D)) you basically have to recurse through the tree.
nothing impossible, just adding more complexity
 

« first day (2018 days earlier)      last day (2937 days later) »