« first day (2015 days earlier)      last day (2951 days later) » 

11:00 AM
@bwoebi did you read that latest branch ?
 
@JoeWatkins what branch?
 
why or/and?
 
because conflicts with &
 
but & excpects a var or ellipsis, not a namespaced identifier?
 
11:03 AM
it conflicts
 
but that'ssomething fixable
 
tried that first ...
yeah sure ...
changing expect or ?
I think we're trying to avoid changing that ...
 
@JoeWatkins hmm?
 
how do you avoid the conflict without changing %expect ?
(or introducing, not changing)
 
@JoeWatkins Are you sure thi shouldn't be actually a zce** instead of void*** github.com/php/php-src/compare/… ?
 
11:07 AM
yes
 
@JoeWatkins Haven't looked at parser yet
 
11:22 AM
any thoughts ?
 
experimenting…
 
cool
 
ooooh php 7 comes as standard with ubuntu 16.04
 
yip
 
11:28 AM
yup
 
yep
 
@PeeHaa, I find it great that you placed a bounty on the canonical I started. When I wrote it, I did it because I had spent one full day trying to figure out the problem on my end, and I found there was a gap in the resources to help people solve it. I didn't think it would be welcome so much. So I wanted to ask you, whether the bounty you placed is really purely because you think what I did deserves it, or whether you expect something more from me.
 
@Epodax Yeah, about time! :D
 
Gonna be exciting to see what new cool things php7 offers, yes I know I'm way behind.
 
@Epodax The performance boost alone is reason enough to be using it.
 
11:47 AM
Does the blogging tool that must not be named support PHP 7?
 
@JoeWatkins found a way to solve the problem … will push shortly I guess
 
thanks :)
 
@Oldskool hope so :)
 
@littlepootis It should, but then again it's "the tool that must not be named" for a reason ;-) So maybe not entirely.
 
@littlepootis did they decide to stick with php?
 
11:59 AM
Maybe it's because I never actually asked a real question, but is my above question* blatantly off-topic/wrong/crap?
 
@HamZa its a shopping question with no definite answer. how would you select the accepted answer?
 
I see
 
@HamZa Wiki-like questions like that are not too popular these days. Like Gordon says, they tend to be open-ended.
 
hehe cool
 
Personally I don't mind these kind of questions too much as they can give cool insights, but they're not really a good fit for the Q&A format either.
 
12:03 PM
@JoeWatkins can you please give me write access to your fork?
 
@VicSeedoubleyew Neh you have done your job. You are free to do / not do whatever you want ;)
 
done @bwoebi
 
@JoeWatkins and pushed, thanks :-)
@JoeWatkins github.com/php/php-src/commit/… the trick is to remove the mid-rule expressions…
/* empty */ { $$ = NULL; } is forcing the parser to shift or reduce
and then you get these infamous shift/reduce conflicts…
 
ah
now I know, thank you :)
I doubt I'll be able to do it next time ... my head hurts when I have to look at the parser for too long ...
so you think this approach viable ?
 
12:12 PM
@JoeWatkins I like fiddling in the parser … it's always a nice challenge :-)
So, just ask me :-D
 
I was already planning on asking you :)
 
hehe
 
nobody has ever explain why those errors appear actually ...
seems obvious now you told me ...
 
@JoeWatkins To me neither really… had to figure it myself too
@JoeWatkins Initially we wanted to allow syntax like A & (B | C) … if you have an easy way to add them, feel free, but it's not absolutely necessary.
 
I've thought about it ... I got nothin to be honest ..
this solves so many of the use cases ... I would love proper expressions, and named expressions ... but I don't want to spend a week on something that's going to get shot down ...
 
12:18 PM
@JoeWatkins I just strongly want to add scalar types too, but first we have to define its exact semantics in weak types
 
I had them in unions, not hard to add, it's the rules ...
 
I'll try to push a branch in the next two days with how I'd implement them.
 
we might be arguing about that for the next few years ...
 
Right, hence I'll just go ahead and push a separate branch with what I think is sensible, so that we can tweak THAT.
With status quo we have nothing other than a few loose ideas… not a good basis to debate about
 
If you freak out, you have OCD ;-)
 
12:21 PM
I can't figure out what is always correct for in/float, without doing stuff like checking overflow, which I don't think we do anywhere else (right?) .. or without it being wrong in some case ...
 
@PeeHaa ok thanks. Glad to know that this post is considered helpful :)
 
what you want when you hint for in|float, is not any casting at all, you want to know you are getting a number
I may favour just adding numeric as a builtin pseudo type like callable ...
 
@VicSeedoubleyew Yeah totally. And thank you for the effort :) Enjoy the rep inflation of the coming 4 days :D
 
@JoeWatkins right… Well, that's why I'm going to do just that … make int|float be actually identical to a pseudo-type numeric
 
what you want when you hint for int & float is some kind of exact number, which may be useful in some edge cases, but in the general case I think numeric is applicable ...
 
12:24 PM
The only thing I'm going to disallow is intersection types on scalars
int & float makes no sense
 
yeah that makes no sense ...
 
....trackingid%3D000146132647632302db63d958690001
I want to extract everything after trackingid%. What's wrong with my regex?
'preg_match("/([^\?]*)\?trackingid%=(\d*)/",$url,$matches)'
 
@TechTreeDev why do you a regex for that?!
 
I just hope adding scalars doesn't hurt the chance of it getting through internals ...
 
@Gordon because I need exercise in that
 
12:26 PM
@TechTreeDev but there is better tools for that scenario
 
@TechTreeDev Well, this is not a good use case, str_split is way better here.
 
there's not really any reasonable disagreement to the way it works right now ...
 
Don't use regex just because you can.
 
@TechTreeDev regex101.com Check that site out. Will help you learn regex then
 
I use regex because I cant :D
3
 
12:26 PM
@TechTreeDev what's that = sign in the regex?
 
@Oldskool I'd use strstr
 
@Machavity Thax
@bwoebi Ups. Shouldnt be there
 
@Gordon Eh, yeah. Must be Rebeccaday ;-)
Not too sharp anymore.
 
@JoeWatkins I fear the inverse … that lacking scalars will make it harder...
 
@Oldskool or parse_url with parse_str /cc @TechTreeDev
 
12:28 PM
it may be worth testing our assumptions ?
 
@JoeWatkins E_PROFESSIONALISM
 
@JoeWatkins you eventually might want to set type_hint to something like 0xff to have the type hint existence checks a little bit cheaper github.com/php/php-src/compare/…
 
Guys, i installed muPDF on my server, now i want apache to be able to run it, can i give apache just the permissions to run only this and nothing else ?
 
@Gordon parse_str() is basically useless because it screws with keys
It would be really nice if someone fixed that, pecl/http has http_parse_query(), that really needs to be in the std lib next to http_build_query()
 
ah yes, I shall try that ...
the vm checks type_hint
 
12:34 PM
i have a php file that has this $output = exec("/usr/local/bin/mutool show /data/example_006_1_.pdf  outline");
echo "<pre>$output</pre>";
 
wanted to avoid changes there, but I'll check anyways ...
 
i want for apache to execute only this exec command nothing more
 
(there is already one)
 
@DaveRandom this
 
@Joseph Not really, but why would you want to? What exactly are you worried about?
 
12:37 PM
@DaveRandom i dont want to give apache root permissions :s , but i need to run it to extract the bookmarks of a selected pdf
 
@JoeWatkins ugh… Foo | void … is like, really, really weird … Can you please force null for unions?
 
void is already a thing
 
I said, for unions
 
@Joseph What do you mean by root permissions? You don't want to be running apache as root anyway...
 
@JoeWatkins for standalone, you can leave void as is.
 
12:38 PM
void is only allowed in return types, and there is no null return type
 
@DaveRandom how do you let it take port 80 then?
 
@DaveRandom yea but if i don't run it as root , it won't be able to execute the command
 
pretty strange to only allow null in unions isn't it ?
 
Void means that no information is returned … If you return Foo|void, you return information about whether it's Foo or not Foo. And thus it's not void.
 
@Joseph So adjust the permissions on the mupdf binary...
@FlorianMargaine I don't know about this problem
 
12:39 PM
@DaveRandom You cannot take port < 1000 without root iirc
 
no it can be void, I'm thinking in the case of exceptions
functions that throw can't be hinted right now ...
they are void, there is no return
 
@JoeWatkins functions that throw don't return void though … they… just throw.
the return value is meaningless.
 
yes but it's still checked
 
It's just as much void as anything else
semantically it's irrelevant
But Foo|void is just … weird
and I think even the pro-void voters will agree there
 
introducing null as a type is weirder ..
 
12:41 PM
@littlepootis then how does my nginx run on port 80 without being root?
 
@DaveRandom i did ...
@DaveRandom -rwxr-xr-x. 1 root apache 1247815 Apr 21 11:34 mubusy
-rwxr-xr-x. 1 root apache 13884100 Apr 21 12:37 mudraw
-rwxr-xr-x. 1 root apache 14319643 Apr 21 12:37 mujstest
-rwxr-xr-x. 1 root apache 7251848 Apr 21 11:34 mupdf
-rwxr-xr-x. 1 root apache 14438829 Apr 21 12:37 mupdf-x11
-rwxr-xr-x. 1 root apache 15404971 Apr 21 12:37 mupdf-x11-curl
-rwxr-xr-x. 1 root apache 13183456 Apr 21 12:37 mutool
 
@JoeWatkins as pure return type maybe … in union types not so much
 
it means the same thing whatever, but null isn't a thing we treat as a type, and I don't want to argue about whether null is a type or a value for the next year ... we already have void ...
 
i am still having a permission denied @DaveRandom
the php file also have the good permissions
 
@JoeWatkins I think you should just ask other members of this room about that.
If they disagree with me, I'm fine too.
 
12:43 PM
@Joseph What's httpd running as? Are you sure the user it's running as is in the apache group?
 
people, input ?
we are discussing whether that should say Foo | null or Foo | void
 
Wes
Foo|null
 
at no point is null returned, so I think void is a better description ... bob thinks is null ... do opinion ...
 
Ping @NikiC @LeviMorrison @Ocramius @DaveRandom @Wes see Joes question
 
@JoeWatkins null is more intuitive, but what's teh status of nullable types?
 
12:45 PM
@DaveRandom what do you mean by that ? i assume it is because i am able to access my webpages normally
@DaveRandom how can i verify ?
 
there is no status, I don't think ... there is no agreement on what should be allowed to be nulable typed
 
(I have not been paying enough attention to recent developments, is ClassName? or ?ClassName valid anywhere?
 
Wes
@bwoebi i think we all agree that void should've been just null, so i'd go with null
 
@DaveRandom that's weird.. does php -S locahost:XX where XX < 1024 also work?
 
we can't agree if it shuold apply to return or param, or just return or what ...
@Wes well we can't change the decision ...
 
12:46 PM
@Wes It even potentially makes sense to allow both null and void…
 
Wes
indeed @bwoebi
 
I don't think either option makes sense. What you are describing is a nullable type, until it's supported everywhere it shouldn't be supported anywhere @JoeWatkins
 
@JoeWatkins We could easily hold a RFC to revert another RFC^^
 
void is a valid return type ...
@bwoebi what a waste of time that would be ... that will never happen ..
 
@JoeWatkins but void in an union is nonsensical
 
Wes
12:48 PM
void is 7.1 so could be reverted, right?
 
: void on a function that always returns a value is nonsensical too ... we have to deal with it ...
I don't think the right way to deal with it is try to introduce a new kind of type on the back of some feature ...
 
@JoeWatkins is that even possible?!
 
@JoeWatkins Yes, but Foo|null (or Foo|void) is identical to a nullable type. If we adopt that syntax for nullable types everywhere at the same time, then fine. But not one place and not others. (for the record, my vote in that case would be |null because, as previously stated, you are describing a nullable type)
 
^ this.
 
12:51 PM
@DaveRandom # ps aux | egrep '(apache|httpd)'
root      5211  0.0  0.0 100944   652 pts/0    T    02:30   0:00 tail -f /var/log/httpd/error_log
root      6312  0.0  0.7 323288 11292 ?        Ss   03:02   0:00 /usr/sbin/httpd
apache    6314  0.0  0.4 323200  6336 ?        S    03:02   0:00 /usr/sbin/httpd
apache    6315  0.0  1.4 335788 21464 ?        S    03:02   0:00 /usr/sbin/httpd
apache    6316  0.0  0.7 324780 10764 ?        S    03:02   0:00 /usr/sbin/httpd
apache    6317  0.0  1.8 340548 26888 ?        S    03:02   0:05 /usr/sbin/httpd
 
I don't disagree, I had it that way in unions, but I don't want to have wasted my time ... trying to get internals to accept null and void existing as a return type is too hard ... we already voted in void ...
 
@DaveRandom And this # groups apache
apache : apache
 
@littlepootis It must work by spawning child processes as above ^^
@Joseph How are you running PHP? mod_php or fpm or CGI or what?
 
Wes
@JoeWatkins it's an error i think, we need some effort from @Danack @LeviMorrison to explain why void was a bad idea and ask to revert it
 
if you don't think it will hurt it, I'll disallow void in unions and allow null instead ... but I really think it will hurt it ...
 
12:52 PM
@DaveRandom mod_php
 
void seems to be going with the flow ... even if it's a stupid flow ...
 
@JoeWatkins Put it as a voting question then
 
@JoeWatkins please. And allow null in parameter types too
@DaveRandom no.
 
@DaveRandom yep. But the master process should be run as root.
 
@JoeWatkins My personal pref would be to do neither and wait for a separate, coherent nullable types RFC
 
Wes
12:53 PM
earlier we examined these use cases for both void and null:
class A{ function bar():void{} }
class B extends A{ function bar():int{} } // valid, no lsp violation as when type-checking for A, you are not supposed to use the return of bar()

class A{ function bar():null{} }
class B extends A{ function bar():int|null{} } // lsp violation here
 
@littlepootis I confess I usually just yum install (etc) so I don't tend to look at the init
 
@DaveRandom no wait , this =>>> Server API Apache 2.0 Handler
 
@Joseph yeh that's mod_php
weird
 
@Wes we definitely can't introduce it for non complex types ...
 
I actually have no idea why that's not working
I guess mupdf is trying to load something external dep that apache does not have permissions for @Joseph
 
Wes
12:56 PM
@JoeWatkins you mean null alone?
 
@Wes yeah
 
Anyone here ever worked with Google Charts? I'm trying to have it not zoom in when there's limited data. I have it set to show the last 30 days, but when there's 1 or 2 days worth of data, the bar for that day takes like 30% of the graph. Like this: i.imgur.com/RXilusG.png (the bar you see is only the data for today, the 22nd, but it looks like the data for Apr 12-22).
 
Wes
... why? it's different from void. i can return null on purpose as valid value
 
@DaveRandom That's IMHO, okay too. … But @JoeWatkins definitely not void…
 
@DaveRandom weird ... works fine when i execute it directly
 
12:57 PM
@bwoebi I was just thinking that's probably the best suggestion ...
just remove void/null completely and leave that down to nullable types ... it's easy addition whatever ...
 
@JoeWatkins right … we can just do a simple separate RFC to that alongside with the union types RFC
 
I'll disallow them both in this for now then ...
 
@JoeWatkins But Baz|Foo $bar = null is still allowed, right?
 
yeah, different check ... which isn't ideal ...
but tried to leave normal stuff intact ...
 
Wes
@bwoebi why would that be allowed
 
12:59 PM
allow_null still works is what I'm saying ...
 
true … I'm just saying we shouldn't alter what's currently allowed
 
yeah
still works
@Wes see the next thing he said
 
@Wes It'd be weird if Foo $foo = null works but Baz|Foo $bar = null doesn't.
 
agree
 
Wes
why the former works?
 
1:00 PM
because php
 
@Wes because PHP, nothing else…
 
Wes
php makes me depressed
are we talking of class properties or any variable
 
@Wes of function params/return types
class properties are a separate RFC
 
Wes
aaaaaaaaaah well in that case it's not too bad
 
@Joseph as what user, though?
If you are executing it as root then obviously it will work...
 
Wes
1:05 PM
it's needed a collaborative effort from no-void people in here to get rid of it before it lays eggs with 7.1
 
@JoeWatkins @LeviMorrison So, I suggest we launch this union types RFC without nullables, and with intersection and scalar types. Then we will have a separate RFC about allowing null in unions. Is that fine?
 
@DaveRandom is adding apache to root group a bad idea ?
 
@bwoebi +1
 
Wes
i wasn't unsure about it, and honestly i didn't even care - as many things in php i'd probably avoided using it
 
@Joseph yes
 
Wes
1:07 PM
but it's an actual piece of turd that is going to make a mess of what comes next
 
@bwoebi so long as scalars are making sense ...
 
@JoeWatkins sure
 
@Joseph Make sure the apache user can execute the things listed under dependencies here: linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
 
@DaveRandom where am i to find those ?? :o if they were dependencies , shouldn't they be in the same folder ?? yet find nothing
@DaveRandom same story . error: cannot open /data/example_006_1_.pdf
error: cannot load document '/data/example_006_1_.pdf'
 
removed void @bwoebi
 
1:17 PM
@JoeWatkins thanks :-)
 
@DaveRandom what's even weirder is that i am being able to execute it with a user that have the minimal permissions , not just root user
 
@Joseph No, they will be share libs probably (in /usr/lib or /usr/lib64 or somewhere like that)
 
@DaveRandom yea found them all and given apache the needed permissions but to the same end
 
@Joseph is it a production server?
 
I smell selinux poking its stupid nose in where it doesn't belong (i.e. anywhere)
 
1:23 PM
^
 
@DaveRandom later yes, now i am on my own machine, i can do whatever
 
Which distro?
 
@JoeWatkins the function always returns there. There is neither void nor null returned
 
@Ocramius no it doesn't :s
 
Centos 6 5
 
1:26 PM
@JoeWatkins yes it does. It either returns or throws (which means function never completes execution)
so you just document that it returns Foo
 
yes, and so doesn't return ...
 
no, it always returns Foo
or else it crashes
 
no it doesn't, it doesn't always get to return ...
 
it's very different from null or void
a void function is basically a "black hole". Throw stuff in, never get to see it again
null is when you actually want to store the result of a function somewhere (semantically different from void)
and in this case, its neither a black hole nor returns anything besides Foo
so you'd just annotate it as returning Foo
 
it doesn't always return ... and you can't annotate it as returning Foo without raising stupid exceptions because the return value is checked anyway, even when an exception is thrown ...
 
1:28 PM
unless you make the failure a null return (instead of throwing an exception), then the return type is Foo
> the return value is checked anyway, even when an exception is thrown ...
wat?
 
oh wait, no it isn't ... my mistake ...
I wrote a test earlier and didn't read output properly ...
 
@bwoebi |null. Also I don't understand why that code sample needs |null at all.
 
@NikiC it doesn't actually, I fucked up there ...
 
@JoeWatkins Scalars (by which I'm assuming you mean "anything that is not a user-defined type") in intersections definitely makes no sense under any circumstances. If anyone starts to argue that int&bool should require an int that is either 1 or 0 or some crap like that, tell them to fuck off inform them that this make no sense.
 
(it's also gone)
 
1:32 PM
25 mins ago, by bwoebi
@JoeWatkins @LeviMorrison So, I suggest we launch this union types RFC without nullables, and with intersection and scalar types. Then we will have a separate RFC about allowing null in unions. Is that fine?
Or do you think union types should immediately include null?
 
afk, school run ...
 
Software Engineer, Tools and Infrastructure at Google (@lifeatgoogle) [Seattle, WA] http://stackoverflow.com/jobs/114393/software-engineer-tools-and-infrastructure-google #automatedtests
umm, since when does google use job portals? I thought they dont have to because everyone applies there anyways
 
@Gordon because, why not? AFAIK careers is costing them nothing…
 
@bwoebi You think it's free? :)
 
@PeeHaa I thought so at least
 
1:45 PM
@Gordon I would not post my CV to them if I would not see an appropriate position
 
@bwoebi I highly doubt SO is paid by fairy dust and unicorn farts :P
 
@SergeyTelshevsky yeah, but they have google.com/about/careers for that
I might be confusing using job adverts with working with recruiters though
 
@PeeHaa uhm, fine
that's barely anything though
 
Not sure about possible limitations
 
Someone an idea what could cause this issue? pastery.net/mqhcnr I only get the latests part of my array in my Excel stylehseeet
so: ["prods"] ( I try to generate an Excel form it )
 
2:00 PM
TIL: when you put a new document into elastic search, it requires some time before you can query for it.
 
Really? Always been pretty fast for me.
Though maybe I directly go to it rather than query for it. What sort of times are you seeing?
 
@Gordon It's a job for promoting (unit?) tests withing Google's coders. Meaning they're advertising the programming equivalent of a septic tank repair man
 
@Fabor I have a test that does an index operation and then immediately does a search query and I had to put it to sleep for a 1s after the index
 
Ah okay, I never needed anything that immediately.
 
@Fabor might be because I am running ES in a docker container on my dev machine though
 
2:11 PM
Maybe. If we did need something as inserted we'd probably just fanout from rabbit
 
@JoeWatkins Foo | null
@DaveRandom Sometimes we call Null a scalar; I assume you wouldn't want to exclude Null? It's one of the bigger motivations.
 
2 hours ago, by DaveRandom
@JoeWatkins Yes, but Foo|null (or Foo|void) is identical to a nullable type. If we adopt that syntax for nullable types everywhere at the same time, then fine. But not one place and not others. (for the record, my vote in that case would be |null because, as previously stated, you are describing a nullable type)
1 hour ago, by DaveRandom
@JoeWatkins My personal pref would be to do neither and wait for a separate, coherent nullable types RFC
 
Just to clarify: my Nullable Types RFC is not coherent?
 
If the nullable types RFC in question proposes that we use intersections as a mechanism to implement nullable types then I'm fine with that, but it's a separate issue
@LeviMorrison No, I was not meaning that any existing proposals are coherent or otherwise, merely saying that they are separate issues.
tbh I cannot actually remember what your existing RFC does or does not do, and I therefore have no valid opinions on it either way.
Basically I think that if Foo? (or any syntax other than unions) is used anywhere, then allowing |null or |void or whatever in unions makes no sense
Otherwise you leave it open to Foo?|null, which is clearly nonsensical
(IMHO)
 
is Foo|null|null allowed?
or Foo|Foo?
(cc @JoeWatkins ^)
 
Wes
2:27 PM
 
@FlorianMargaine no, it isn't (look at the tests)
 
@AnmolRaghuvanshiVersion2.0 o/
 
@DaveRandom I think you flipped it; allowing ? in unions makes no sense.
 
2:35 PM
@LeviMorrison OK, but if you have ? then Foo? and Foo|null are the same thing. Which is fine if that's the way we want to do it, but introducing unions with |null will effectively torpedo ? (I suspect) so my view is that right here and now, to get something in, it should be done without support for either and the null/void/? argument is "future scope"
To be clear, I'm not actually arguing for/against any particular position in terms of |null, |void and ?, I just think the pragmatic approach to keeping things consistent and getting them through a vote is to not try to do too much
I have preferences on the matter, but it's a separate discussion
again, IMHO, YMMV, objects in the mirror are closer than they appear, hot surfaces may not look hot, <other disclaimers here>
 
morning levi
 
there are two nullable types rfc's
 
Well there is a general nullable types rfc and one just for return types.
Right?
 
right, but there are two effecting what we are doing here
they need to resolve these questions I think ...
 
2:42 PM
I like the ?Foo syntax. I find it short and concise.
but I haven't checked any of the details, so this just my initial impression
 
if one of them goes ahead before we take this to internals, then we can include that solution, but we can't choose what to do before that has happened ?
also, where are you on scalars ?
 
What issues specifically are you talking about, @JoeWatkins?
 
nullable
 
To be fair I did introduce fairly coherent nullable types + union types ^_^
It's not my fault others came along and wrote competing RFCs.
 
nobody is assigning blame, we are just figuring our way forward
 
2:45 PM
I think we need to have a discussion on ML specifically about the interaction of scalar types with union types.
I'm not terribly excited about that.
 
@LeviMorrison well, it's mostly about syntax...
 
I don't see how the interaction of scalar types with union types is mostly about syntax.
Care to explain?
 
I kinda like it without scalars, but bob wants them, and there is undeniably some use cases for unions and scalars ... string|null or string|int is such a common thing ...
 
Depends what we mean by "scalar"
By mathematical definition null wouldn't be a scalar because it is a single value; it doesn't have direction or magnitude.
 
I wonder if we should RFC array instanceof Traversable
(Independently of whether union types passes)
 
2:48 PM
And array instanceof ArrayAccess? And Countable? and..?
 
@LeviMorrison Those are not possible, as array does not implement the methods.
 
Traversables are not completely compatible with arrays.
if you delegate to a sub-function the traversable will use object semantics and the array won't.
 
In what way?
 
even if we don't delegate
$obj->letmeaddthispropthatdidnotexist = 1;
Not doable with arrays.
 
I really need to get this client to upgrade to PHP 7... 3v4l.org/pvK1W
yet, IBMi :-(
 
2:50 PM
But legal with objects.
(Though yuck, I really hate it when people do garbage like that)
 
@LeviMorrison In that case you are requiring more than Traversable anyway
You can't do that with just any object
 
Theoretically, yes, you can. Just some objects disallow it.
Traversable does imply object...
 
@LeviMorrison it was a joke
 
@FlorianMargaine I see.
 
@LeviMorrison Thus, you can't ^^
Just setting a property on an object makes more assumptions about the object than "it can be traversed"
 
2:52 PM
There is no code you can do to check if an object supports that behavior.
It's just try it and see.
 
Indeed.
I don't care anyway.
I'm not particularly interested in supporting stupidity ;)
2
 
More than array instanceof Traversable I'd rather have is that works with any type.
$var is array, $var is int, etc.
And honestly if array is Traversable is true that's fine. But instanceof specifically implies object semantics, which means it's not truly compatible.
I know this particular argument is more pedantic than practical, though ^_^
 
Wes
is/isa is also way shorter
 
@Wes It's also a new two character reserved keyword...
 
Yeah, that's the bummer part.
 
2:57 PM
Which is better than a new one character reserved keyword, but that's the only good thing you can say about it ^^
 
Wes
:P
 
I prefer is_indubitably_an
 
foo quite_naturally_is Traversable
 
@JoeWatkins Which always returns false, at least in PHP
You just can't be certain about such things
 
Wes
lol
 
2:58 PM
lol, yeah it would ...
 

« first day (2015 days earlier)      last day (2951 days later) »