« first day (1402 days earlier)      last day (3546 days later) » 

1:00 PM
@DaveRandom However, if there's no sensible default value you would have to use ZEND_NUM_ARGS().
 
@Ja͢ck Yeh that's what I went with, seemed like the only sane thing to do
 
Should an HTTP client always perform a redirect when a Location header is present, or should that be determined on the response code? (being in the 3XX range)
 
Location header only: optional
Location header + 3XX: required
^^ sound about right?
 
The latter.
 
1:06 PM
@DanLugg You should redirect either way
 
@PeeHaa Oh okay, so long as a Location header is present?
 
> The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource.
And (regarding your 3xx)
 
@Danack thx, but I've used the array_filter()
 
> For 201 (Created) responses, the Location is that of the new resource which was created by the request
 
^^ Ah yea, true.
Now, would a client that opts not to redirect (say, conditionally) be considered non-compliant?
 
1:08 PM
A client reserves the right to not follow a redirect, e.g. too many redirects.
 
Say, I return a 201 + Location; the client decides "Eh, I trust the new resource to be fine. KTHXBYE" and goes elsewhere.
 
Now that is a question which is imho hard to answer, because often the spec leaves some room for interpretation
 
@Ja͢ck Ah true. The max hop rule.
That's a good precedent if any.
 
Or, a redirect from HTTPS -> HTTP
that kind of stuff
 
Yea, As for the protocol switching, there is a code for that though, no? 101
 
1:09 PM
> 101 Switching Protocols
Although....
> This means the requester has asked the server to switch protocols and the server is acknowledging that it will do so.
 
Ah, so it's client initiated.
 
Yep, like how web sockets work, isn't it?
 
@Ja͢ck You mean the Upgrade?
 
@PeeHaa I suppose? :)
 
Is file_get_contents() returning text formed in html?
 
1:11 PM
1171
Q: Why does Windows think that my wireless keyboard is a toaster?

ydaetskcoRI've inherited an old PC from my girlfriend's dad and when setting up the printer I got a bit of a surprise: Two questions spring to mind here: Why does Windows think my wireless keyboard is a toaster? Why does Windows even have an icon for a toaster in the devices menu?

3
 
Or just unformated text?
 
imho the status codes are just too confusing and we only need two: 1 => ok, 0 => fail
:P
 
@TomášAresakMalčánek it's text.
 
@PeeHaa -1 => indeterminate
 
@DanLugg Yeah was inspired by that one :)
 
1:13 PM
I lol'd when I first read it, then went searching for the icons :-P I think I might set all the devices to that icon on my co-workers computer.
 
Anywho, thanks @PeeHaa + @Ja͢ck for the information.
 
welcome!
 
Also, @Ja͢ck random underline?
 
@DanLugg Yeah, this month I'll be carrying some dirt with my name :)
 
@Tom
 
Bah nevermind, figured it out. :)
 
1:26 PM
With REST what's the method for inserting if it doesn't exist?
 
Good morning
 
morning
 
Wiki says PUT. We're going with PUT
Morning @ircmaxell
 
What's the good word?
 
@Fabien Sounds legit
@ircmaxell It's monday. The good words are hard to find :(
 
1:30 PM
:-|
 
Animated emoticons! :-(
 
moin
 
Morn @ircmaxell + @JoeWatkins
 
@JoeWatkins so is your fork going to be the temporary working area of UString? :)
 
yeah think so ...
 
1:33 PM
branch?
 
I dunno really ... pierre keeps doing/saying strange things ...
 
haha
 
I didn't branch ... this is all very messy ...
 
i thought at least you understood
but i forgot that you're always wrong ...
 
I am always wrong ... but I don't say or do strange things ... like passing a locale as a codepage
 
1:34 PM
@JoeWatkins did you know phpdbg seems to be breaking master builds?
 
heh
 
I did
 
lol
 
bob is doing phpdbg in a couple of weeks ...
he wants to do it ...
 
s/know/care/
 
1:35 PM
Just wrap it in #if 0
 
@JoeWatkins sometimes he says things way out there, sometimes they are on point. The key is you never know whcih is coming
 
So, Pierre is like a box of chocolates?
 
:P
 
intl is horrible ... I don't like it at all ... I did have a tidy extension, if I'm to convert to intl-ish code, it's going to be quite horrible ...
 
=S
 
1:36 PM
I don't like it as much ... I was happier when it was a standalone extension ... intl is such a mess ...
 
@JoeWatkins he said having it inside intl is simpler .. still not sure what that means
some random mumblings about wchar_t
 
no idea "easier" and "simpler" are getting thrown about a lot ... it was simple and was easy ...
intl has conventions it breaks, it's really messy, nothing makes sense ... looks as if it were written by 1000 people with hearing problems who only spoke about it one time, in a nightclub, while drunk ...
 
lol
the best projects are conceived in a nightclub, while drunk :-D
 
@JoeWatkins s/intl/icu/
 
icu is nice ...
intl makes a real meal of it ...
 
1:39 PM
icu is our friend!
 
probably some truth to that @ircmaxell
:D
 
@JoeWatkins s/meal/mess/ ?
 
icu has some... weird stuff in it. And a lot of API functions with like a trillion arguments
 
it stops the "nah, that'll never work, why bother" attitude
 
it has some solid apis though, unicodestring and utext are okay, utext seems pointless to me, docs and everyone else is saying it's faster, I don't see it being so in the real world, underneath zend ...
 
1:41 PM
@DaveRandom it's like walking into a convention for quarrelling couples ;-)
 
just ignore weird stuff ... like you do when walking down street ... ignore it, or if you notice, apologize (even though nothing to do with you) and continue;
 
UString is a nicely carved out functionality that would be good to have :)
 
@JoeWatkins you'd fit right in here in NYC
 
The issue is that unicode is fundamentally very very very complicated, the idea of a "lightweight unicode library" is something of an oxymoron
 
s/complicated/complex/
doing it right is hard i guess.
 
1:43 PM
I don't know, sometimes it seems like the consortium goes out of the way to complicate things
 
the motion of planets is complex, as I sit here, relying on it to live, I couldn't care less about it ... I see no difference, that's the point of writing an api ... we don't need to expose every single bit of icu, we need to expose the bits we need to expose, and that's really not very much if we are focused on keeping things simple ... they can be simple ...
 
brb, moving to usa ;-)
 
The reason I went digging in it in the first place is because I would like IDN support in the streams API. But that would require a dependency between main and ext/intl (unless icu was a core dependency) so I guess that's not really going to happen
 
ah, the infamous puny code?
 
java's string api's are sooo very much like icu's ... I have never had a problem working with strings in java, I don't have many in php, but what problems there are don't require a rewrite of the engine, they don't require this hodgepodge of functionality brewed in a coldren (that nobody really seems to get) from icu, all we really need is to expose the sane bits and ignore the rest, or leave them alone ...
 
1:47 PM
Yes. Punycode itself is dead easy to implement. NAMEPREP, on the other hand...
 
this was all simple when it was a self contained extension ... trying to integrate into intl doesn't make sense to me i don't think ... I like UString being a zend class actually ...
intl can do whatever ...
 
icu has a dead simple API for it, but the stuff that makes it actually work includes a 20MB generated char map file :-S
 
the size of the file doesn't matter, they'll be using random access for sure ...
 
@JoeWatkins point was more that trying to re-invent that particular wheel (the reason I went digging around in the ICU src) is a no-go
Well, it wouldn't be maintainable, anyway
 
Hey is there anybody able to make me an advanced CMS for free? You will have 1 month
:D
 
1:50 PM
because that char map changes every time new code points are defined
 
I say we write UString as zend class then you can have your dependencies, and an api can be written for intl (or anything better that hopefully comes along ... please come along) that exposes the underlying structures for whatever ...
 
I don't see why not :D
 
Maybe I will credit you in the footer of website (max font height: 8px)
 
we don't actually need any of intl for ustring, they're not really connected ...
@TomášAresakMalčánek you're not serious are you ?
 
:D
I'm not :DD
 
1:53 PM
the pseudo class String will be part of zend, it makes sense to have UString as part of zend more than intl .. am I wrong ?
 
Singleton vs. non-singleton; what's a good pair of terms? Persisted/Transient? Singleton/Prototype?
 
class/object?
nah, scrap that lol
 
Ehh, not quite.
 
@DanLugg Singleton vs. The Correct Way
 
@JoeWatkins can you elaborate on how String will function (the "pseudo class")?
 
1:55 PM
The intent is: 2 types of lazy loaded objects, one is a "singleton" (lazy + cache), the other is reinstantiated with each subsequent resolution (so just lazy, no caching)
 
based on the assumption we get something like niki's scalar methods idea
 
Good afternoon
 
@cspray Yar. Har har. HAR har har.
 
@JoeWatkins so, there are fundamental issues with that, that I personally feel will/should prevent it from being a core concept
 
@AndreaFaulds s/afternoon/morning/ :)
 
1:55 PM
Today people actually reviewed my pull request(!)
I should use Universal Greeting Time... (total-knowledge.com/~ilya/mips/ugt.html)
 
Yes. Yes you should :)
 
okay, well what about an actual String class, there's no problem with that at /Zend right ?
(also, tell me about those problems, I don't see them)
 
Is the idea of boxing out the window at this point?
 
@AndreaFaulds Make sure to set the right timezone, otherwise ... It is not safe to rely on the system's timezone setting
 
for example: right now, you can pass anything to strlen and it'll internally cast it to a string. Does that mean that all objects need to support a ->length() method? And if it's missing, the engine will call __toString() on it first?
 
1:56 PM
@PeeHaa It's quite interesting how long are you here. Seriously, how long are in member of stackoverflow?
 
@Ja͢ck Oh god that PHP error
 
@PeeHaa And you are still one of the most active member I saw here in php chat o.O
 
> member for 3 years, 9 months
 
what about ->startsWith()? What about all the other string methods. Either it will require an explicit cast first, or it will get so muddy as to what the intention is, that it'll cause a ton of confusion
 
@TomášAresakMalčánek I'm just one of the best slackers :P
Although @ircmaxell is the master slacker:
 
1:58 PM
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /filelocation right here/system/libraries/Log.php on line 86 @Jack ;)
 
> 81.8k
^ messages
 
@PeeHaa :D Damn
 
@PeeHaa yes, over 4 years
 
shhh
:)
 
@AndreaFaulds Warning: date(): It is not safe to rely on the date() because I dun goofed the timezone idea, your's truly, Derrick
 
1:59 PM
@AndreaFaulds For best results, combine with DateTime and you get to upsize that warning with an Exception.
 
Is this "mark code"?
 
hmm
 
@ircmaxell if you ->length() and it's not a string that's an error.
 
@BenjaminGruenbaum which goes against the principles of PHP's type system
 
2:00 PM
I think I see more @PeeHaa because he have very bright avatar :P :D
 
@ircmaxell how so?
 
What are the principles of PHP's type system?
 
@DanLugg Good question, PHP's type system is a little schizophrenic
 
@DanLugg every scalar is every other scalar. It's not just cheap to convert between them, it's designed to. The type of a variable is not determined by its contents, but by the context in which you use it.
 
a type system born in a procedural world, it doesn't go against the principles of oo does it ?? it's expected from this perspective I think ... so what about if UString had an accompanying String with the same api ... this would be okay ?
 
2:02 PM
posted on August 18, 2014 by kbironneau

/* by SuperiZ */

 
@ircmaxell Theoretically, anyway.
However, what you described is Perl ;)
 
@ircmaxell Okay, that's good. And concise. But how do scalar methods fit in there? This is why I'm a proponent of autoboxing.
 
@AndreaFaulds more than theoretically. In the vast majority of APIs...
@DanLugg they can't
 
Most of the time PHP roughly follows this principle
 
methods are polymorphic by nature. They depend on the contents, not the context
 
2:02 PM
Right, so we have a conflict of intent.
 
If you want scalar methods, then you need to ditch the entire type system. They can't play nice together in the general case, because they are foundationally incompatible...
 
So to bring an OO API to scalar "types", they sound like they need to be wrapped.
 
wrapped?
 
isn't there some casting "api" we could use?
 
2:04 PM
@ircmaxell s/wrapped/boxed/
 
@DaveRandom he's such a charming person, this "Bilge"
 
lol @DaveRandom
 
@DaveRandom haha say what now?
 
@DanLugg even boxing would require you to know context (which isn't what boxing does)
all boxing means is that it upcasts a primitive to an object
 
And this is why I moderate comments on the blog... http://t.co/8MHGP0Ucxk
 
2:05 PM
and autoboxing does it on demand
 
Wait, did the person who hates derick for voting against it use Derick's email? Welp.
 
@AndreaFaulds yeah :)
he wrote it to himself, everyone is schizzo sometimes
 
@ircmaxell Theoretically scalar methods are doable without breaking the type system by allowing them on all scalars and converting $this...
 
Seriously though, the whole date.timezone thing is insane
 
However @NikiC isn't in favour of that
 
2:07 PM
so what is the answer to the question what is the best way to support both unicode and normal strings in a future version of php (with apis that makes sense and everything is shiny) ?
 
@AndreaFaulds well, what happens when an object has a ->startsWith method? then what do you do?
 
An object isn't a scalar, no?
 
@ircmaxell Right, what I'm saying is you lose the conversion facilities of the current scalar "type" system when an object is box-cast, and it cannot be used it scalar contexts until it's uboxed.
 
@JoeWatkins UString class and scalar methods on string :p
 
with a procedural API, the intent of the user is clear: they want to use this variable as a string
 
2:08 PM
well the idea has flaws in it ...
 
@DanLugg unless you use autoboxing
 
I don't want to do anything flawed ... I don't want things to be "muddy"
 
@JoeWatkins Interesting choice of language in that case :p
 
@ircmaxell But autoboxing does the same thing, just implicitly.
 
@DanLugg not quite
autoboxing doesn't actually allocate an object, it just simulates it. So in compiled languages, the scalar is still on the stack (whereas objects are always heap allocated), but it appears to the program as an object due to compiler trickery
 
2:10 PM
Ah. Gotcha. Well, I'm merely talking about the explicitness or implicitness of (casting) or not respectively.
 
Did not know that about the allocation though; just a magic placeholder then...
 
@AndreaFaulds changing the behavior of string shifts is dangerous
 
wtf. Something is wrong with my net. I'm gettin 16mbps from 100mbps bought
 
@ircmaxell We don't have string shifts. Shifts operate only on integers.
 
2:13 PM
@AndreaFaulds those tests imply otherwise
 
they really do ... that was a confusing answer ...
 
I'm not saying the behavior makes sense on strings, but "1" << "2" is still a string... somehow
 
@ircmaxell No, the test was poorly written
Basically, the test author assumed bitwise shifts acted on strings like the other bitwise ops did, so they var_dumped a bin2hex'd version
Since that obfuscated the result of the test, I made the test not do that
We don't have string shifts despite what that misleading test might've made you think
 
Maybe PHP "7" should pull a Python x 1000; torch the current debacle of a "scalar type system" and make something based on rules, rather than a flowchart of corner cases.
5
 
When that happens I'm going to program in Ruby exclusively.
 
2:17 PM
@DanLugg What are these "rules" you speak of?
 
rules are evil
 
In PHP 5.4 for example: andreas-air:php-src ajf$ php -r 'var_dump("1" << "2");' => int(4)
 
@SecondRikudo A simple set of assertions that don't require large casting tables to rationalize.
 
fair enough
@DanLugg yeah, good luck with that
 
2:18 PM
@ircmaxell There was an RFC by someone to actually add string shifts by the way, however I don't like it
 
@AndreaFaulds 3v4l.org/j0PZF
All the way back.
 
Not sure it ever went past draft or discussion
 
Guys should I make my own CMS or use some of that are already exists?
 
@DanLugg Yeah
 
@AndreaFaulds you've never implemented crypto
 
2:19 PM
@ircmaxell You'd need more than luck. You'd probably need a sword. Maybe henchmen.
 
@TomášAresakMalčánek what do you need the cms for?
 
@ircmaxell I'm not against adding a function for it, but I don't think we should have bitwise ops for strings as it makes operators do different things for strings vs integers and floats
 
Personal usage, and for one community.
 
we don't know the answer then ?
 
@DanLugg a miracle. Not for the vote, but to do it in a way that wouldn't completely shit on existing users
 
2:19 PM
@AndreaFaulds Wasn't that someone Chris Wright? ;-)
 
12 mins ago, by Joe Watkins
so what is the answer to the question what is the best way to support both unicode and normal strings in a future version of php (with apis that makes sense and everything is shiny) ?
 
@JoeWatkins what's wrong with using normal objects?
 
@ircmaxell Oh, I pretty much threw BC out the window when I typed that message. I know that.'
 
@TomášAresakMalčánek okay, depends on what the sites does, how long they are going to live and etc
try out a couple CMS see how they feel
 
I like that @ircmaxell ... so a String with same api as UString is okay then ?
 
2:20 PM
You know what? Screw it, I don't even mind autoboxing...
 
^^ Yay!
 
So long as any class can implement boxing :)
 
^^ Double-yay!
 
What I mean is a __castFrom magic method
 
@JoeWatkins well, you'd have to think carefully about that... Why not have everything be a UString? What's the problem with that?
 
2:21 PM
(and probably __castTo as it's really unfair only internal classes can cast to other things than string)
 
possible performance impact ...
 
Well I was working alot with Joomla, Wordpress and also enjin.. But dunno :D
 
unless hidden in the details ?
 
@JoeWatkins store all strings as unicode
 
hmm
 
2:21 PM
@ircmaxell By the way, if I made zpp failure an E_RECOVERABLE_ERROR, do you think it'd pass?
 
@AndreaFaulds I proposed something like that in conversation awhile ago. The response was somewhere between "NO MORE MAGIC METHODS!!" and "E_TOO_MUCH_MAGIC_METHODS"
 
@AndreaFaulds no
 
What, really? zpp doesn't fail in many places...
 
I also proposed a __castFrom() method at some point, but that may have just been on list (not in an RFC
 
@ircmaxell You'd rather one for each scalar type than a single __toScalar/__fromScalar?
 
2:23 PM
@ircmaxell I'd like something like that. However, I don't like the idea of individual ones, I'd like just one big method __castTo
 
__castFrom() and __castTo() sounds okay to me :D
 
Maybe __castTo and __castScalar
 
@DanLugg I'd rather both (which is why I proposed both). One for explicit casts, and one for implicit casts
 
But the implicit can't carry type information, so it'd basically be like __toString (from which you could return... an int, or whatever)
__toScalar($scalarType) where $scalarType can be one of int, float, etc., or NULL when there's no type information (implicit cast as an operand or whatever)
 
@DanLugg correct, it's saying "We don't know the precise type of the context, so give us a scalar representation, and we'll make it work"
 
2:27 PM
Ah so.
 
@ircmaxell Are there any circumstances where the method could return a scalar of the incorrect precise type, resulting in a lossy cast?
Yea, shifts.
 
@DanLugg well, if a precise type is known, then it would be requested.
 
1 << $obj and $obj returns a float from __toScalar
 
@DanLugg implicit is basically "numeric" though, right? I mean implicit cast in a concat definitely wants a string, evaluation as bool definitely wants a bool, the only ambiguous implicit cast is math operators (unless I've forgotten something)
 
Or, I guess that it could be explicit in the case of shift, if it's the right operand; it'd have to be an int.
 
2:30 PM
It would, but if it's the left operand for a |&^ it would be more interesting...
(since it could be int or string, which would yield very different results)
 
@DanLugg since shifts operate on integers, __toInt() would be called...
 
/me is still hopes to someday see ability to cast objects to a different class
 
@tereško Adapter pattern? :P
 
@Jimbo DCI
 
Is 253000 records in 1 table alot?
 
2:32 PM
@tereško why would you want that?
 
@TomášAresakMalčánek no
 
@TomášAresakMalčánek not really
depends though, it can be a lot
 
@tereško I forgot to ask on Saturday, could you take a look at this when you have a minute - the answer posted was very poor
 
damn
 
Yeah :D If it are users, then it is alot.. But what about messages?
 
2:33 PM
will do at home
 
thanks
 
class A { private $x, $y, $z; } and class B { private $w, $x, $y; }, doing ((B) new A) would yield what, an instance of B with an auto-property named z?
 
@TomášAresakMalčánek no, it's more about the indexes or the server perf
 
@DanLugg no, it would yield an error
 
Oh eh ouch
Okay. Can somebody check something like "library" that I've made today?
http://games.symbiant.cz/projects/symb/symb.php
I don't have finished all of the pages but, it's really boring :D
 
2:35 PM
@ircmaxell No, following what @tereško said.
 
@DanLugg PHP is not C. No
 
@ircmaxell I know, I'm just supposing what the result could be.
 
the result would be a call to __castTo, or an error
 
@TomášAresakMalčánek Not rlly
 
Hmm, I want to see what you will say for that. Like if is that good or not. It's db-side caching
Then some global banning, account system and more
 
2:38 PM
@TomášAresakMalčánek sorry my first comment was for the DB records..
 
btw, saying something is boring , won't encourage people of reading your thingy :D You should encourage them by saying it's awesome ;)
 
:D I said writing manual is boring :P :D
But writing this gave me alot of experiences :D
 
WHat does database caching mean? You are caching in the db?
 
Yeah
It's like cookies
But it's storing in db
 
2:42 PM
WHat database engines?
 
Also WAT. SQL injection much?
 
@PeeHaa ?
 
      $query = "INSERT INTO " . $this->formate("sql_table_cache") . " (symb_name, symb_value, symb_id, expire)
      VALUES ('" . $symb_NAME . "','" . $symb_VALUE . "','" . $symb_ID . "','" . $symb_EXPIRE . "')";
  	$result = mysqli_query($sql, $query) or die( $this->error( mysqli_error($sql) ) );
 
Oh yeah I don't have escapes here
 
2:44 PM
ah ok
 
But that doesn't matter because it will auto-restore
 
@TomášAresakMalčánek oO
 
Speaking of unclear types...
 
O___________________________o
 
Bigints present an internal conumdrum
 
2:45 PM
:D
I did very nice image about it long time ago :D
 
Do I make PHP call cast_object with IS_BIGINT_OR_LONG, or do I ask for IS_BIGINT then IS_LONG?
Or all three?
When I want a bigint specifically, what do I do?
 
Serious @TomášAresakMalčánek you are working with user data
 
oddly relevant
 
Hi
 
2:49 PM
DELETE FROM people WHERE hates_php = 1;
 
@AndreaFaulds SHOWING 30 OF 12390372409379749023 RESULTS
 
@Ocramius Why are people spread over multiple tables?
 
@DanLugg partitioning. I don't want gun-lovers in my same table.
 
:-|
 
WHERE loves_guns = 1 AND hates_php = 0
 
2:51 PM
@PeeHaa What do you mean?
 
DELETE FROM people WHERE nationality = ? AND php_quality_pc < 2 Nope let's not be racist
 
@Jimbo That is just awful!
Use freaking named params dude!
 
@Jimbo Prepare that query. I dare you!
 
Ah screw you guys, you love it
How'd the hangout go btw?
Sorry I missed it :-(
 
2:53 PM
@Jimbo Too much clothing. Also, I was only in briefly.
 
Crappy hangouts is crappy
 
It was working fine once I got on my phone.
 
Video or just audio?
 
@DanLugg Yes sooo that's pretty crappy :P
 
:-P
 
2:54 PM
Hey guys
 
@Jimbo video + audio + beer + whiskey
 
is there any one have worked with springloops?
 
Sounds too much like that java thing to me so no
 
Just came across this project github.com/nazariyg/Phred
6
 
How do you guys deal with code auto-complete in your IDE when using oop factories? 'By default' it won't work, will it? Unless you clutter your API classes with phpdoc...
 
2:59 PM
"How do you guys deal with code auto-complete" first thing I do on fresh install is disable it
 
@PeeHaa Why?
@Andrew If you need to handle that, it's likely that you're doing something wrong with your Factory.
Is it possible that your factory is a glorified service locator?
 
@SecondRikudo It always gets in my way
 
@PeeHaa Meh
 

« first day (1402 days earlier)      last day (3546 days later) »