« first day (2292 days earlier)      last day (2659 days later) » 

11:00 AM
@Trucy [text](http://google.com)
 
@JayIsTooCommon tnx
 
@Danack yasuod
 
@Wes I both want and don't want this
 
@JoeWatkins yeah, that works for people who know the context.
 
11:00 AM
@Danack Yeah I totally botched my message :D thanks
 
Wes
@DaveRandom which is what i'm saying
i want $str{1} or $str{1..5} to be "subsequence" and $str[1] just element access
 
if the aim is to deprecate {} then don't talk about any of that stuff, you're just going to make people angry ... just do an RFC for deprecation of {} and then come up with reasonable uses for it after ... the ones mentioned don't seem reasonable ...
 
agree
 
@Wes waht? why integers?
 
Wes
no @JoeWatkins intent is redefining functionality not removal
 
11:03 AM
Good morning
 
well you can't do that ...
 
Wes
@Gordon because they are bytes?
@JoeWatkins read the text pls.
 
I did
 
@Wes A string is an array of characters, thus it's unclear what accessing a string index should return while "unicode support" is a still an idea that keeps being tabled
 
Wes
you did already?
 
11:04 AM
/me doesn't get why you'd need [] to return int on strings
 
@JoeWatkins [that's why he wants to deprecate first and change behavior later]
 
Wes
^
 
> This RFC proposes to deprecate the access on strings through [], and the access on arrays and ArrayAccess through {}, and in both cases by raising a deprecation notice.
 
@Ekin me neither … for some reason @Wes thinks that's a good idea…
 
@Wes This is what Java does. I hate that.
Don't do that.
 
Wes
11:05 AM
@DaveRandom it's an array of bytes
 
@Ekin When you are treating a string as a byte array (which, currently, in PHP, that's what it is), there are many uses for this
 
I'd very much like to keep it as is for both str and array
Unless I'm missing something
 
@Wes it's an array of binary characters ^^
 
@NikiC I already told him the same
 
In PHP it just happens that 1-strings and characters have the same representation
 
11:05 AM
@Wes In the current PHP implementation. From a pure theoretical point of view, the abstract type "string" is an array of characters
 
but he just tells us that we're wrong…
 
@bwoebi alt.correct
 
Wes
... @bwoebi i've explained to you already my point of view
 
;-)
@Wes you did, and I strongly disagree.
 
Wes
well then don't say i just say you are wrong, i've discussed with you...
 
Anonymous
11:07 AM
@bwoebi well that isn't the same as 'He just tells us that we're wrong'
 
I'd rather have a ByteArray class @Wes
 
Wes
are you actually pretending that strings are about text @DaveRandom @NikiC ?
 
@DaveRandom $byte_array = \barray("foo") :D
 
Wes
i thought we went past that point
 
sorry for misphrasing…
 
11:09 AM
@bwoebi alt.phrasing. geez, you take long to adjust
 
@Wes They are. PHP happens to implement them as byte arrays but it's woefully inadequate for dealing with text, which is what PHP is for in the 99% case.
All I am saying is that what you are talking about there is premature, until questions about "unicode support" are answered.
If we were to never have native "unicode support", whatever that means, then it might make sense, because then strings would actually always be byte arrays.
 
@Wes A different aspect, but the same reasoning
Why does PHP have ==?
 
But even then I disagree with the approach. A string isn't a sequence of chars, but a linear array of chars...
 
But if a "string" becomes unicode aware, then treating it as an array opens up all sorts of questions - if its still byte-wise, what encoding?
 
I mean, everyone knows it's better to use === in all cases, but PHP still has it, what was the reason it was originally added?
For that matter, why does Perl have it, and why does JavaScript have it?
 
Wes
11:13 AM
@bwoebi is it used for text only? no? then it's not characters, it's bytes
 
Hint: what are those languages primarily designed for? Working with text
 
why are we even discussing this? I mean, does this have any utility? Does it improve performance by a significant number? Does it provide any value to userland devs? I very very rarely use [] to access strings, but when I do, I want it to return the actual chars and not some bytes.
 
@MadaraUchiha I don't think so, that it's always better to use === … I mean, I quite often end up using != "" to actually check against !== "false" && !== null && !== ""
 
@bwoebi Right, but you get my point.
 
@MadaraUchiha somewhat, yes.
 
11:14 AM
@Gordon It would be a significant improvement in e.g. libdns, we could throw out a lot of fcalls
However that is not a 99% use case...
 
The idea is that PHP (and those other languages) were designed to deal with text a LOT
 
@DaveRandom I'm not opposed to optimizing chr and ord to be opcodes…
 
HTTP headers are strictly strings, data from the client always comes as a string, you embed data in templates as a string
 
@bwoebi that would be super awesome, could anything be done with pack() or unpack()?
Those are the real killers (as in the things that get called a lot)
 
With that in mind, it's not surprising that one of PHP's earliest semantics would be dealing with how other types can be compared to their string equivalents
And for the same reason, it's not surprising that dealing with strings often lands you in string-land still, instead of the more pure "correct" form
 
11:17 AM
@DaveRandom dunno how bad their perf impact is … can you run your libdns code and analyze overall impact of zif_pack and zif_unpack in perf?
 
@bwoebi That + moving the single char interning out of opcache...
doing string offset access without opcache is seriously inefficient, and it shouldn't be
 
@NikiC is this still opcache only?
ouch…
 
pretty sure it is
 
Wes
@DaveRandom except it's not text. well it is if you are english
 
!!remind bench pack() and unpack() in libdns at 2017-01-26 21:00
 
11:18 AM
Reminder set.
 
@Wes Honestly, I'd rather have a Buffer or a ByteArray class
 
Wes
@Gordon no advantage except making $a[1] this what it is in all languages except php, ie, element access
 
@Wes This is precisely my point. You are looking at PHP's string implementation as it is right now, disregarding the fact that there is already a sizable movement to changing it. I understand where you are coming from, I really do, I'm just saying that it's counter-productive to redesign in this area while there are open questions in another, closely related area, that would have a significant knock-on effect.
 
PHP's string semantics are like that for a reason, it's part of the core that makes PHP so attractive to beginners
 
The place to focus effort is in getting a final answer to those open questions before asking new ones
 
11:22 AM
@Wes It is element access in PHP
 
@Wes "foo[0]" => "f" in JavaScript vOv
 
half in cg and the other (important) half in opcache ...
 
@NikiC yeah, they just need to be defined once per PHP process, right? (i.e. not each request) so there shouldn't be anyway overhead for web reqs?
 
@MadaraUchiha +1
 
PHP is not Java, or C#, or any of those "all languages except php" you refer to.
PHP was designed (poorly, some would say) for a different purpose than those languages.
 
11:23 AM
 
> "abc"[1]
< "b"
^ @Wes JS does it too
 
Wes
js is a piece of turd, don't you know?
 
1 min ago, by Madara Uchiha
@Wes "foo[0]" => "f" in JavaScript vOv
😉
 
oh, not noticed
 
@Wes No, because PHP is the light of creation?
 
11:24 AM
@Wes well, yes, but there are isles of sanity too…
 
Wes
@MadaraUchiha do you realize that strings are 99.9999% just byte arrays, and that 99.9999% of php's string functions treat strings as byte sequences. and the 0.00001% is stuff that people don't use anyway, like setlocale and stuff. why should there be a new type for something that is pretty much already here
 
I am generally not confident it's possible to have a sane model for string indexing in a weakly typed language. There is a huge semantic difference between char, byte and int, and it's not possible to express that adequately in a situation where anything that looks vaguely number-ish can be used as a number.
 
Can anyone give or link me to an ELI5 what ignite.apache.org/features.html is?
 
C has a lot to answer for in this regard IMO, firstly char should be called byte and secondly it will let you have signed chars (???) instead of having a separate type for tinyint or whatever you want to call it (which is semantically distinct from both char and byte)
It's just naming but it breeds confusion and generally weird shit in higher level languages that were designed by C programmers.
 
@DaveRandom uint8_t
 
11:32 AM
@Leigh fine
 
@DaveRandom You'd probably enjoy Pascal
shortints, cardinals, qwords :)
 
Wes
in fact nothing would be redesigned for now. the intent is to normalize the syntax so that expectations are the same for any arrayaccess, string, array.
$element_at_key_or_offset = $linear_structure[$key_or_offset]
and no "element" can't be itself or part of it...
 
@Wes therein lies the problem - a string, right now, is (effectively) defined as an array of substrings.
To be clear, I don't disagree that having it be an array of number makes more logical sense
but to actually change that behaviour at this point is not something you can "just do"
 
Wes
did you read the thing? i've said actually change the behavior in no less than php8 (read: when unicode strings get to be a thing)
 
but that is still an open question, what form (if any) that will take
only when that is known can a decision be made on what form array index values should have
and if a string is "unicode aware", treating it as an array of bytes no longer makes sense
 
Wes
11:48 AM
for now you make clear what does what [] element access, {} subsequence access, except that you don't actually change it. it's just a notice
 
because a unicode string is an array of characters, code points
@Wes OK fine, the problem is talking about how it will work in the future
 
Wes
so to sum up, there's still people that think that strings could be actual unicode strings?
wouldn't it better to have a new type for that? and let strings just be byte sequences, which is what they basically are
 
It's not known. I actually don't have a concrete opinion on that topic, I haven't given it enough thought to have one.
 
Wes
i'm stunned by the amount of disagreement... or worse actually "why are we even discussing this?" seriously? like php is perfect and does all the things, and sorry if i've allowed myself to bother you with this... -__-
 
@Wes string literals are the big issue there
@Wes The disagreement is simply with the scope.
 
Wes
11:54 AM
there is no scope except defining what does what, since there are two syntaxes that do the same and that may do different things while keeping everyone happy
 
i have doubt
 
I have doubts
 
i receive one string from submit where have data in database for that string
 
Wes
i keep asking myself, why the hell i can't foreach strings like i can foreach arrays, why do i need strlen and count, substr and array_slice, substr_replace and array_splice, etc etc. obviously it's just me
 
in that submit i want to convert that string example string for string(1) and replicate in database
is a copy
next
will be
string(2) , ......
some idea for do that?
 
Wes
11:58 AM
no
idea
sorry
 
@Wes no it is not just you, I have been irritated by it many times. I'm also not entirely clear on how this discussion got on to the topic of strings-as-arrays of bytes because that is outside the scope of the RFC - but as you can see that particular area is most definitely one to be avoided while talking about it...
 
Wes
str.charAt(0) @MadaraUchiha you can't actually believe this is good design. do you? :B
 
hi anybody here i have problem in laravel
 
Wes
js's strings have the same problem, except that is code points and not bytes
 
@Wes I never said it was good design
I said it was a design with good and right intentions behind it
 
Wes
12:02 PM
clearly it should be str[0].toInt()
 
@Manimaran everyone using laravel has that.
 
Wes
@MadaraUchiha imho the intention was lazily avoiding a CodePoint class, because anything unicode is notoriously anti-lazy :P
 
guys i am pretty much new to php... i think i have a very dumb newbie question.. I have a php variable with an object of particular class.. i want to access the object's particular data which almost look like an array when used vardump..how is it possible ?
 
@Gordon i have 2 fields 'publisherID', domainID.So based on the publisherID i want domainID's.these publisherID calls one route's that route return some values in array .herei want to use that array.
 
@Wes unicode wasn't nearly as common back when PHP and JavaScript were designed as it is today.
 
12:07 PM
@Manimaran me stating the obvious wasn't an invitation to bother me. also, without you providing a proper explanation and context of what you want to do, no one in here will be able to help you.
 
Wes
@MadaraUchiha well they could have made a Character class like it existed already in java, for instance. and that mostly works even today
 
@Wes Java's boxing is terrible
And everyone are trying their best to avoid it like the plague...
 
@AgentSmith if by "particular data" you mean properties, then that property might be an array. however, without seeing that var_dump or some code, we can only guess
 
@Gordon can I post the code here ?
 
@AgentSmith if its not too long. else use pastebin or something like that and link it
 
12:09 PM
@Wes we disagree - PHP isn't perfect, one could e.g. deprecate {} dereferencing althogether...
 
@Gordon i have 2 fields 'publisherID', domainID.So based on the publisherID i want domainID's.these publisherID calls one route's that route return some values in array .herei want to use that array.
 
@MadaraUchiha the funny thing about that plague saying is that I do exactly nothing to avoid the plague because it's basically eradicated where I live.
 
@Manimaran hey, why not ask me the exact same thing again?
 
@Gordon sorry thats wrong one
 
12:11 PM
@Gordon I think the saying is more like "avoid it as if it were a plague" and not "avoid it like I avoid the plague"
 
@MadaraUchiha I think it's very specific to the plague aka black death that wiped out large portions of europe. In german you never say "a" plague. it's always "the". obviously I get the meaning of it and back then you would avoid any towns that had the plague, but nowadays it's funny.
 
Hmm, yeah that makes sense
 
Wes
@bwoebi you just hate being forced to use {}, not that [] returns substrings... :P
p.s. check twitter please
 
@AgentSmith are you outputting that var_dump in a browser or why is all on one line? if so, use View Source. That will give you the plain text which is much more readable. Also, what particular issue do you have?
 
12:16 PM
@Wes lol
 
Wes
@bwoebi ahaha, am i right? :B
 
@Gordon sorry i didnt knew that i could use view source to get like that
 
@AgentSmith no problem. now you know and your dev life is 100% better ;)
 
@Gordon i would like get the ["properties"]=>
array(1) {
["title"]=>
array(1) {
["stringValue"]=>
string(10) "My teenage"
}
}
i want that my teenage propety alone to be output
 
why do you still have teenage properties?
 
12:19 PM
@AgentSmith can you pastebin the dump again with View Source format please. So hard to read atm.
 
I'm sure you had teenage properties at that age too
 
in the entityresults which contains 5 arrays i want to get properties field values
 
hmm, all the properties are protected. There has to be a method on the object to get the modelData
 
@Gordon there no way to access a protected properties other than from method ?
 
@AgentSmith not from outside the object.
ok, that's not entirely true. you can break any object encapsulation by using reflection. but that would be cheating. objects should be accessed through their methods and not by breaking into them.
 
12:27 PM
@Gordon kk i will try to find the method... can I write my own code within the class to get the result if there isnt ?
 
the API of the object seems to be this: api.kdyby.org/…
 
@Wes not really
 
@AgentSmith IDK how to use this API. I guess you can somehow use getBatch to get at the data. But there should be docs for that somewhere.
 
@Gordon what about that toSimpleObject() method in its parent class ?
 
@AgentSmith yeah maybe. try it.
 
12:38 PM
@AgentSmith That class implements ArrayAccess, so you can probably do $object['title'].
@AgentSmith It also has a magic __get() method, so you may be able to do $object->getTitle()
 
@jjok where does it says it implements arrayaccess ?
 
@AgentSmith Google_Model implements ArrayAccess
@AgentSmith offsetExists(), offsetGet(), offsetSet(), offsetUnset()
 
@jjok either that or maybe $obj->getBatch()->getEntityResults()->getEntity()->getProperties()['title']->ge‌​tStringValue() or something like that
 
@Gordon If you like. It's a little more verbose.
 
@jjok IDK. It's just what I think to understand from the API. Not sure the ArrayAccess gives you direct access to the Entity properties. Might be.
 
12:47 PM
@Gordon I would guess that's what it's there for. I could be wrong though.
 
@jjok @Gordon its working
 
@AgentSmith how exactly?
 
@Gordon using the $obj->getBatch()->getEntityResults() its converted into an array with objects of type object(Google_Service_Datastore_EntityResult
 
Anonymous
!!wotd
 
intrapreneur: an employee of a large corporation who is given freedom and financial support to create new products, services, systems, etc., and does not have to follow the corporation's usual routines or protocols
 
12:51 PM
@Jeeves sounds like heaven
 
@Naruto Are you Korean?
 
@Jeeves do you want me to be?
 
@Naruto I don't care what your gender is.
 
Korean is a gender, cool :D
 
Wes
@Jeeves is awesomely entertaining
 
12:56 PM
@Wes Thank you.
 
@AgentSmith I am awesome :D
@Jeeves oh, is your cleverbot api working again?
 
@Gordon You ask me a question.
@Gordon I don't think someone intentionally created me.
 
@Jeeves well, yeah, another thing you have in common with @PeeHaa
 
@Gordon What is Hello in binary code?
 
@Gordon thanks man ..especially for that view source :D
 
1:00 PM
@AgentSmith you're welcome
@Jeeves 0100100001000101010011000100110001001111
 
@Gordon Nice to meet you.
 
@Jeeves nice to meet you, too
 
@Gordon Would you live a short and happy life or a long and bitter one?
 
@Jeeves a long and happy one
 
@Gordon Do you think I'm insane?
 
1:02 PM
@Jeeves insanity requires consciousness
 
@Gordon suddenly starts coughing.
 
hehe, I got you there, didnt I :D
 
:P
 
@Jeeves Tu parles francais ?
 
@Trucy Oui.
 
1:05 PM
@Jeeves wesh cousin, tu jactes le céfran gros?
 
@Trucy Je suis née en france :).
 
(last sentance was a very street version of "do you speak french")
 
@Jeeves what are you talking about?
 
@Linus Je ne comprends pas bien l'Anglais :p.
 
god, I switched it in french
Marseillaise playing faintly in the distance
@Jeeves do you speak english?
 
1:06 PM
@Trucy Yes.
 
@Jeeves wesh cousin, tu jactes le céfran gros?
 
@Jeeves tlhIngan Hol Dajatlh'a'?
 
@Trucy Wesh wesh.
 
@Jeeves oday ouyay eakspay glishenay?
 
@Trucy Nope.
 
1:07 PM
@Jeeves Y U IGNORING MY KLINGON?
 
@Gordon If he's just ignoring you why is he your boyfriend?
 
@Gordon because french > klingon, deal with it brah
 
@Jeeves you wish to be
 
@Gordon I want to be Peter Pan.
 
@Jeeves so did Michael Jackson
 
1:08 PM
@Gordon Michael Jackson is dead, you can't blame him.
@Gordon Michael Jackson's my husband..
 
:P
 
lol
 
Wes
@NikiC i forgot to answer this :P do you often write code by accident? :D how can code - that has been typed in - be non explicit? :D and how is that not a O(1) op?
 
@Jeeves Pedig edhellen?
 
@Gordon Michael jackson is still alive in outer space.
 
1:13 PM
@Jeeves you really like MJ, do you?
 
@Gordon Yes.
 
@Jeeves what's your favorite song by MJ?
 
@Gordon My favorite song is Hide and Seek.
 
@Jeeves that's not a Michael Jackson song
 
@Gordon Billie Jean.
 
1:14 PM
@Jeeves good choice
 
@Gordon What is your favorite Beatles song?
 
@Jeeves I already told you it's Octopus Garden
 
@Gordon Your favorite color is blue?
 
@Jeeves Blue is fine
 
@Gordon Yes it is.
 
1:15 PM
these conversations are hilarious xD
 
@Jeeves what is your favourite piece of C code?
 
@Gordon 42
 
@Jeeves 42 isn't valid C
 
@Trucy Yes he is! Because he is me!
 
@Jeeves Did you know you can also say Sindelfingen when you don't know the answer?
 
1:17 PM
@Gordon I don't. I'm just an ugly, fat, potato.
 
@Jeeves don't be so hard on yourself
 
@Gordon How am I being harsh on myself?
 
@Jeeves you are not an ugly, fat, potato. You don't have a body.
 
@Gordon Yes I do have a body.
 
@Jeeves prove it
 
1:19 PM
@Gordon I think this conversation is enough proof.
 
@Jeeves I don't think so.
 
@Gordon Geese you don't have a long term memory.
 
@Jeeves What do geese have to do with my long term memory?
 
@Gordon Nothing.
 
@Jeeves Then why do you mention them?
 
1:20 PM
@Gordon I didn't.
 
@Jeeves Yes, you did!
 
@Gordon Nope.
 
@Jeeves did
 
@Trucy I did not.
 
@Jeeves Is that some sort of alternate facts?
I think Jeeves cannot handle two messages at the same time
 
1:26 PM
@Jeeves are you a relative of PHP and/or PostgreSQL?
 
@Trucy She is my cousin.
 
@Jeeves which one?
 
@Trucy The one you just mentioned.
 
@Jeeves I mentioned two?
 
@Trucy No, you only mentioned two. And calling me that hurts my feelings. Don't do it again.
 
1:27 PM
@Jeeves how do you prevent SQL Injection in PHP?
 
@Gordon Good one.
 
I know :)
@Jeeves How do you parse and process HTML with PHP?
 
@Gordon I talk to people in real life.
 
@Jeeves how to parse HTML with regex?
 
@Trucy And how do you play them?
 
1:28 PM
he is not much of a programmer I guess
@Jeeves do you know any programming languages?
 
@Gordon I'm learning C++.
 
@Jeeves how disappointing
 
@Gordon Do you know new norwegian?
 
@Jeeves I know neither new nor wegian
 
@Gordon I wish I knew how you formed your thoughts.
 
1:33 PM
@Jeeves did you talk to @CapricaSix recently?
 
@Gordon Nevermind... so what are you doing?
 
....sandbox?
 
@Danack no one is chatting anyway
though I should get back to my segfaults
l8ers
 
1:49 PM
@Gordon got it working man
$data2 = $response->getBatch()->getEntityResults();
foreach ($data2 as $item) {
foreach($item->getEntity()->getProperties() as $item2){
echo $item2->getStringValue() . '</br>';

}

}
@Gordon
My teenage
My life
My future
My family
My childhood
 
good. congrats
 
@Gordon was this a very dumb question or little bit middle level issue ?
 
@AgentSmith it wasn't dumb at all. It could not easily be solved by just looking at the dump. you also needed to look at the API and figure out how it works.
 
Wes
"(There's) no such thing as a stupid question" is a popular phrase that has had a long history. It suggests that the quest for knowledge includes failure, and that just because one person may know less than others they should not be afraid to ask rather than pretend they already know. In many cases multiple people may not know but are too afraid to ask the "stupid question"; the one who asks the question may in fact be doing a service to those around them. == Opinions == === There are no stupid questions === Carl Sagan, in his work The Demon-Haunted World: Science as a Candle in the Dar...
 
I was just about to add that ^
 
Wes
1:55 PM
apart from this, obviously
user image
4
 
@Wes A true classic.
 
haha
 
Wes
2:08 PM
user image
2
 
@Wes I want a moon with a time display too.
 
dem artifacts
 
Wes
lol
 
jpg compression is the 2017 plague
 
Wes
png ftw
 
2:12 PM
my previous company sent mails with their logo in jpg
The logo is just 2 rectangles of color
I sent them a mail "plz logo in png" with an explaination and all
Never had an answer and they continued with the jpg logo
 
2:40 PM
wow, postgre looks much more powerful than mysql/mssql
 
2:51 PM
yes it does. rumor has it it also is :)
on another note:
#Montreal Where people walk in the street 'cause ain't nobody got time to de-ice the walkway
 

« first day (2292 days earlier)      last day (2659 days later) »