« first day (1430 days earlier)      last day (3515 days later) » 

Hi @ircmaxell quick random question, do you know of articles that describe migrating away from Symfony1 sfGuard login module to something not as crap?
 
nope
 
k.
 
how hard would it be to have integer(INF) ?
 
@CSᵠ Completely impractical. Does not exist in C.
 
6:11 PM
and, does it make sense to have it?
in php there are 3 real types: (real) (float) (double) and they all act the same, aliases of one of them...
 
@DanLugg interface "Dynamic" ? Well.. very non-informative naming. Magic method as a contract? Why do that? What's the goal of the class, implementing that contract? What behavior should describe that interface? So, verdict: unclear at best.
 
@CSᵠ aliases? no. An alias has an unique origin. They're all three synonyms.
 
@AlmaDo Naming aside; the intent is to create agent types that can pass through typechecks; simplifying decoration and diagnostics, even facilitating AOP to some degree.
The reason for Dynamic::__call being declared, is it ensures that calls go somewhere, even if it acts as a sink.
 
@DanLugg no. I got that. And have strong dislike about it (: Why create a restriction and overcome it later? It's totally unreadable in the call line
 
As with __call you're implicitly implementing the contract defined by the interface.
@AlmaDo I'm not following how it's unreadable.
 
6:16 PM
@DanLugg so.. it's not about naming and not about readability. Then which feedback is needed? Semantics? Yep, it's possible. But no - I doubt if it's a good idea. Right tool for right purposes. This is not so here.
 
@DanLugg that's just going to be a hell of bugs
 
Hmm. I disagree with both of you, but I see where you're coming from. I think facilitating agent types for AOP or dynamic decoration (through implicit interface implementation) is fairly clean; especially by comparison to the alternatives.
 
it's like.. hm. you can shot in your leg if you wish. But I don't see any sane reason to do it (:
 
The idea that everything sinks through __call makes the surface area fairly small.
 
@DanLugg then context must be.. more specific. In common case this is a smell
 
6:19 PM
@bwoebi ok, so there's absolutely no difference between float and double even if it could/should? be
 
Disagree, but I'm seeing this wouldn't be a welcome feature.
 
@PeeHaa example to make it clear
// before

$values = array(...);
$query = somefunction(
	"INSERT INTO tablename (val1, val2, val3, val4)
	VALUES (:val1, :val2, :val3, :val4)",
	array(
		'val1' => !empty($values['one']) ? $values['one'] : '',
		'val2' => !empty($values['two']) ? $values['two'] : '',
		'val2' => !empty($values3['2']) ? $values3['2'] : '',
		'val4' => !empty($values2['one']) ? $values2['one'] : ''
	)
);

// after

$values = array(...);
$query = somefunction(
	"INSERT INTO tablename (val1, val2, val3, val4)
	VALUES (:val1, :val2, :val3, :val4)",
 
Yikes!
 
Well, because it's not good. What good may come from "cheating" over the contract, which you've defined by yourself? Why do that? Senseless (for me). IF the intention is to make obligation behavior - then it's fine, that's one of intentions for interface definition. But then I can't get why to cheat over this structure. Your prototype should be clear. And contract as well too.
 
@an1zhegorodov first sounds like a primitive collection filter, whereby a collection would be filtered to the first value that satisfies a predicate.
@AlmaDo You're not cheating the contract. The contract is satisfied via __call
 
6:22 PM
@CSᵠ yeah
 
interface I { function a(); function b(); function c(); }
class C implements I { function a(){} function b(){} function c(){} }
class D implements I { function __call(){} }
@AlmaDo ^^ I'd argue D satisfies I just as much as C.
I'm proposing an explicit indication of that (rather than changing the effect of implementing __call, which would cause confusion en' masse)
 
@DanLugg you're cheating over typehint. Which is cheating over contract from "client" side. Worse, you may use that later as a part of some other contract (typehint definition in some other interface), and ..
Yes, PHP allows that
 
PHP allows what?
 
But - no, I say - try to keep away from such things as far as you can (:
 
PHP doesn't allow the implicit satisfaction of a contract via __call, if that's what you're getting at.
Though, I'd be in favor of that being the case.
 
6:26 PM
@DanLugg I'd rather re-implement the heck out of my code generator instead
really, I wouldn't go with a magic-method-that-decides-everything
 
Hmm, I guess I'm just not understanding; when I look at __call, I can't help but see it satisfy an interface.
The missing mechanics are a disconnect to me.
 
Yes, that may be true, but what I see is the megamoth
the use-cases for magic wrappers are fairly rare
 
Yes, but that's probably in part because trying to implement them currently yields great walls of pain and suffering.
 
so I'd rather use a more complex solution that allows this kind of magic without making __call a super-interface-implementor
 
Weaving with the current state of PHP? lollerskates.
 
6:28 PM
@DanLugg did you look at my BS library?
note: BS != Brandon
 
I believe I have; checking.
 
the ProxyManager, I mean
why can't you implement it with that is my question
 
You can (I assume, I haven't used it) but despite your best efforts, I'm sure, it's extremely complicated.
 
@DanLugg no, it's about - make a substitution of such thing in call moment (like you've did for your "function")
so you'll have a "contract", implemented with some random thing
 
It's not some random thing. It's a "missing method" catch-all.
Which satisfies the interface.
 
6:33 PM
But with that you'll break the contract in natural sense
 
Give type T and method M, can you dereference M from T by invocation with arguments X through Z? Yes. The contract is satisfied.
 
Well, I admit, it's a double-edged sword. It's like some "flexibility". May be. In some very specific circumstances. But the price is uncacceptable for me
@DanLugg it's very implicit
In formal sense, formal prototype doesn't fit the contract
 
Of course it's implicit; but that doesn't detract from the satisfaction of the contract.
 
and that produces that readability loss as I've already stated. More, I don't see how can you track anything happening in such case
Well, you can, with some ugly hacks, I think. If-else (or case?) is awaiting
Consequence -> from proper polymorphic code to unclear if-else branches. Hm. But may be that can be avoided. Somehow.
 
@DanLugg that's why I abstracted it, heh
 
6:38 PM
@Ocramius I think this feature (as described) could survive an elevator pitch, whereas trying to explain the "conventional" (read: currently possible) implementation would take an afternoon.
@Ocramius :-P
 
FWIW I agree with you and wish that __call did implicitly satisfy typehints
My use cases have revolved around decorators of some kind
 
@DanLugg what is complicated in this example? Ignore the factory name, pls
 
datfactoryname.jpg
 
I TOLD YOU TO IGNORE THAT NAME!!!EINS1
 
wtf is that name? Oo
 
6:40 PM
AccessInterceptorScopeHTML5LocalizerDelocalizerInternationalizationFactoryFactor‌​yFactory
 
@AlmaDo something that I need to simplify by inventing a new word :D
the fact is that I don't know a word that means that thing, so, as good Austrian guy, I use composite words
in da face, stinkin' english speakers!!!
 
@Ocramius Intervenor?
 
@DanLugg interesting name, but I'm not sure it's that
it's a dangerous approximation
 
> Intervenors are professionals who provide Intervention to an individual who is deafblind. The Intervenor mediates between the person who is deafblind and his or her environment to enable him or her to communicate effectively with and receive non-distorted information from the world around them.
;-)
 
Yeah, so that's a Proxy :)
now add the other flavors to it
 
6:42 PM
YER OBJECTS ARE DEAFBLIND! (unless you use ProxyManager)
 
@Ocramius what's the purpose of it?
 
@an1zhegorodov One of the accepted techniques to prevent that is initializing your variables
 
@Ocramius Relocaller
 
@AlmaDo creates a "friend object" and runs things before/after real method calls
brb, food
 
Just say AOP. A. O. P.
 
6:44 PM
hm
 
@DanLugg which kind of AOP? :D
btw, I could hire Lisachenko to rename my classes XD
 
@Ocramius no, I mean that particular sample
 
Anal Oral Pornography? I dunno the different varieties.
 
@AlmaDo runs those closures before and after the fluentMethod call
yet retaining type safety
and not breaking the fluent interface shit :)
 
You can't do final classes though?
 
6:45 PM
nope
but I'm not supposed to do either :)
 
Yea, phooey.
 
final means GTFO, for good reasons :P
 
Well, that's debatable. You're not extending them with classical inheritance on purpose, it's just a side-effect of the implementation you're forced to use.
 
I can build a proxy around an interface, and wrap it around a final class, tho
class Foo implements iBar {} - then $factory->createProxy(new Foo(), 'iBar', ...);
kinda
really now, food.
 
Yea, likewise.
 
7:05 PM
soooo what's up
?
 
magic
 
Specifically::__magic
 
Code quality is measured in quantity of magic? right.
 
Indeed, everyone loves magic, no?
 
7:07 PM
Certain kinds of "magic" are okay; predictable, rational magic.
"magic" (to me) is a measure of separation from expectation.
 
yeaaah :-D We really need to reintroduce register_globals with its glorious session referencing variables :-D
 
@bwoebi RUNKIT IN CORE! RUNKIT IN CORE! RUNKIT IN CORE! RUNKIT IN CORE!
4
 
+1
 
@Ocramius runkit? register_globals is worse^^
 
MONKEY PATCH ALL THE THINGS! PHP IS TEH NEW RUBEE!
 
7:10 PM
@bwoebi you can do all sorts of evil, you can't even imagine. MWAHAHAHHAHAHAHAAHHAHAHAHAAHHAHAHAHAAHHAHAHAHAAHHAHAHAHAAHHAHAHAHAAHHAHAHAHA
 
I wouldn't mind open-classes in PHP.
class Foo { function bar() { return $this; } }
class Foo { function qux() { return $this; } }
(new Foo())->bar()->qux();
Though, I can't see how that'd play with autoloading.
 
it would probably crap itself at first attempt
 
Eih, what about introducing a function which mprotect()s a location filled with userdata with PROT_EXEC?
 
and second attempt, and third attempt...
 
I was toying with Phar-based package/module management. Modules have bootstrappers, etc., the main application loader loads all the phars in /bin. Negates autoloading (but performance too)
 
7:14 PM
unrelated:
 
It's neat though, *.phar is analogous to *.dll/*.so
 
@Ocramius I feel overly manly while invoicing.
 
@Ocramius eih, I didn't say that that memory region then is called too… ;-P
 
7:31 PM
@AndreaFaulds standards.iso.org/ittf/PubliclyAvailableStandards/index.html download 1st part of ISO/IEC 10967-1:2012, need to know data, more so if you're planning implementing BigInt
 
@DanLugg You'll hate this, it's quick and very dirty 3v4l.org/uMXpl
 
C.5.1 states:

> Infinitary values are required for unbounded integer types, and are allowed for bounded integer types.
 
@derp That's pretty much what every user-land AOP library does behind the scenes.
 
@derp that's basically what I wrote ^_^''
 
sick bastards
 
7:34 PM
except that I have a few hundred tests backing that stuff :P
 
@CSᵠ I'm not implementing the underlying arithmetic, I'm using GMP for that.
 
http://stackoverflow.com/questions/25855624/module-php-blenc-was-exp‌​ired
 
@Machavity Oh my god that's hilarious
 
I know. It almost needs a category of its own in it's stupidity
 
Wait, no.
blenc isn't a proprietary module
They've misconfigured it
 
8:00 PM
the comments on that question could go on for a looong time
 
8:34 PM
$string->pregsplode('(\R+)')              implode(PHP_EOL, array_map(function ($line) {
       ->map($line => trim($line)) /*vs*/       return trim($line);
       ->implode(PHP_EOL);                }, preg_split('(\R+)', $string)));
PHP Y U NO LET US HAVE NICE THANGS?
 
because PHP
3
 
Oh, right.
Also, re-reading that; "pregsplode" does not sound like something I'd want to witness.
 
not at all
 
@DanLugg array_map('trim', $str) ... ... ...
 
Yea, I know. I... don't like string/func references.
I use them, but I don't like them.
 
8:39 PM
then make a constant:
or not
 
I want to add function references
I just need to update the patch to PHP 7
 
@DanLugg Screw both of those. Go look up perl's Schwartzian Transform.
I really miss perl sometimes.
 
Hi guys sorry I have a question does someone know the name of this type of encoding this is called? \x20 = space
 
9
Q: Which encoding uses the \x (backslash x) prefix?

Alex AngasI'm attempting to decode text which is prefixing certain 'special characters' with \x. I've worked out the following mappings by hand: \x28 ( \x29 ) \x3a : e.g. 12\x3a39\x3a03 AM Does anyone recognise what this encoding is?

 
foreach (get_defined_functions()['internal'] as $name) {
    define($name, $name);
}
var_dump(array_map(strlen, ['foo', 'noodles', 'soup']));
@ircmaxell ^^
 
8:43 PM
@Gordon did that IIRC
and no
don't do that
 
@Charles thanks!
 
@AndreaFaulds &strlen?
 
lol, you think I would? :-P
 
@ircmaxell Yes, that RFC.
 
@AndreaFaulds You should change the sigil to @ because then it's already mostly valid: array_map(@strlen, ['x', 'yy', 'zzz']); ;-)
Misping.
 
8:47 PM
@DanLugg Oh god.
 
lol
 
Eh, it'd be a fine time to bork repurpose the @-operator.
 
breaks BC
 
I'd love to see function and class (and constant) symbol tables merged, but it won't happen (nor would I vote for it), because BC
 
8:48 PM
Derick would vote against :p
@ircmaxell Ditto, hence compromises like &
 
@ircmaxell Yea ... same. Also, props/methods.
 
He will probably vote against anything because BC, whether BC breaks exist or not.
 
lol
 
@DanLugg to be fair, I'm fine with that one being separate. Just like variables have their own symbol table... Makes lots of things easier
 
@ircmaxell Really? I find it troublesome segregating members into buckets like that. $o->f = function() {}; $o->f();. I know @NikiC fixes that, but you still need to (delimit) it
Or, for that matter, simply cufa($o->anActualMethod)
 
8:51 PM
I know...
 
Oh, what could have been ♪
 
could have, but should have?
if you did that, the entire class structure would be mutable on every instance
which would lose you the benefits of the class's type system imediately
 
2 hours ago, by Dan Lugg
I wouldn't mind open-classes in PHP.
 
open classes, not open objects
 
True. Meh.
I'd love a paradigm of generic, open, multi-inheritable, cross-cuttable types... that you don't have to use.
 
9:01 PM
why do you want multi-inheritance?
 
He's been infected by C++.
 
Static reusability, to be honest, but with typing. I'd like to see it done as "traiterfaces"
 
it's so horrible, that nobody really uses it. Hell, many coding standards explicitly forbid it
> Multiple inheritance is allowed only when all superclasses, with the possible exception of the first one, are pure interfaces. In order to ensure that they remain pure interfaces, they must end with the Interface suffix.
which is exactly what PHP supports with extends and implements
 
trait T implements I { ... }
trait U implements J { ... }
class C uses T, U { }
(new C) instanceof I; // true
(new C) instanceof J; // true
 
yes, because if look into interfaces as on behaviors - then multiple "inheritance" has great sense. But with classes? (so, entities)? It's really bad
that's because unclear what it should mean at least
 
9:08 PM
@DanLugg Er, if you use the right syntax, that works? 3v4l.org/1hS1N
 
@DanLugg at which point, just delete trait and allow multiple extends
 
@ircmaxell Okay, but only if you forbid inheriting from more than 1 concrete class.
 
huh? what's the difference there?
@Danack holy crap, that's horrible
 
\o/
 
@ircmaxell I hope it was intentional (regarding HHVM)
 
9:10 PM
I didn't say it was nice...I was just saying that PHP already does danlugg's example....er, and by php I mean hhvm.
 
Then it'd be more similar to traiterfaces; the concretions can only span one path of the inheritance hierarchy; helps lower the mental overhead.
 
trait .. implements ... woops
 
@Danack Whoah.
 
@LeviMorrison I hope it was intentional, because if it was accidental that's weird. But if it was intentional, it just proves that they have no bloody clue what a trait is, nor why the structure exists or was chosen...
 
9:11 PM
today is strange constructions day (:
hi, @Jimbo
 
@DanLugg traits are a concretion by definition
 
Ahoy @Jimbo.
 
they carry implementation. Therefore they are concrete
 
@ircmaxell Okay, I meant in the context of instantiability.
 
Abstracts carry implementation, are they therefore concrete ;-)
 
9:12 PM
@Jimbo yes
 
@Jimbo abstract doesn't mean that some concrete parts aren't allowed
 
So, abstract class, a few concrete methods, then?
 
@ircmaxell Was that book you mentioned about getting (compiler construction) something you've perused through before? Or was it gonna be new reading?
 
HHVM suffers from the same problems that C++ pre 11 did. It's a whole bunch of half thought out things bolted together because why not?
@DanLugg new reading
 
@Jimbo hm. Abstracts are concrets. Since they are entities
 
9:14 PM
Name escapes me, link?
 
Is there a way to check if the user accessed the website with www. or without? Getting Access-Control-Allow-Origin in AJAX because I am accessing an url without www. when the page was accessed through http:// www.
 
they may not contain even one non-abstract method, but still will be concrete (:
that's mystery :p
 
@BenBeri $_SERVER['HTTP_HOST'] should contain the domain name the browser requested in the Host header.
 
@BenBeri, just redirect from one form of the domain to the other in all cases - and then you don't have the problem any more
 
@Charles Thanks
 
Awesome, thanks :-)
Check y'all later folks; underwear and beer time.
 
I screwed something up; you guys might appreciate this:
<?php
interface foo {
    public function bar() : foo;
}


class qux implements foo {
    public function bar() : qux {
        return $this;
    }
}

$qux = new qux();
var_dump($qux->bar());
> Fatal error: Class 'bar' not found in php-src/Zend/tests/return_types/008.php on line 7
 
which would give you?
hehehe :-)
 
Everything seemed to be working just fine... and then I did make distclean and recompiled.
 
that means it's in a header file usually (or in the executor)
 
9:25 PM
That also means our makefile is shoddy :(
 
@LeviMorrison lol
 
Teehee.
 
@LeviMorrison wait, didn't we take care of that error?
 
There is no class bar
lmao
I think the issue is in this if block, maybe: github.com/morrisonlevi/php-src/blob/…
 
what's return_type->name set to?
 
9:39 PM
"qux"
 
weird
that's right
 
Time to install valgrind, I suppose.
 
ok, I'm off for the day, catch ya later
 
(I get a memory problem in another test)
 
9:49 PM
The gc value is bad on the string.
 
so, i just spent ten minutes thinking about why the code adds 1 to something called "class_name_len"
as it's dealing with nul byte magic, I figured I had some off-by-one error in my brain
Turns out some asshole simply called something "class_name_len" that wasn't actually the class name length :(
 
Which structure?
 
@LeviMorrison unmangle property name
 
@NikiC What is it actually storing?
 
hello
can anybody help me out with this? stackoverflow.com/questions/25851143/…
 
10:02 PM
@NikiC Can you explain this more?
 
Hopefully this fixes my opcache issue as well. Rebuilding now.
Bummer. Did not fix opcache issues :/
@NikiC Thanks for help on fixing the real issue with my other spot.
 
10:21 PM
Finally a Linux version of application I have to administer is available! No more OSX! \o/
It's OpenSUSE only, but beggars can't be choosers
 
@DaveRandom Does Linus Torvalds knows about Linux?
 
I might endorse Linus for Windows XP
 
Does Rasmus Lerdorf know about PHP?
 
NO.
 
Does Room 11 know about ?
5
 
10:33 PM
Does Levi Morrison know about php-src? Good heaven's, no! I'm basically doing monte carlo programming here!
Eventually the randomness settles on a close enough solution that someone else will fix.
 
♬ Hey, I just met you, and this is crazy, so here's my number, stackoverflow.com/questions/25857815/…
@LeviMorrison My experience of php-src tells me that you are not alone...
 
10:57 PM
Does Satan know about Laravel?
 
yes
 
No, wait... does Satan know about Wordpress?
 
@AndreaFaulds David Cameron isn't in my network so I can't make that endorsement
 
@DaveRandom Cameron isn't the devil, just one of his minions
 
11:14 PM
the only real array in php is the *char array? aka. string???
 
@CSᵠ PHP has arrays
 
@AndreaFaulds of course, Satan invented Laravel !
 
@AndreaFaulds no. He's jealous of it though...
@CSᵠ SplFixedArray is a real array... as an object... thingy...
 
@ircmaxell thanks! is it really faster than usual array() ?
 
no
 
11:24 PM
by what order of magnitude is slower?
 
what are you doing, and why do you care about microseconds?
 
It's kind of sad, though, considering that the documented advantage is that it allows a faster array implementation ...
In terms of accessing elements it should be faster on the whole, though.
But iteration is faster on normal arrays.
 
no, accessing is slower... Creation is much faster. Inserting is much faster. But access is slow/same
 
The advantage of SplFixedArray is smaller memory footprint. Not performance.
 
Then perhaps the documentation should be updated to reflect that.
 
11:34 PM
There's no reason it would be faster on lookup since we optimise numerically-indexed arrays
 
Admittedly my experience is solely based on a few small tests done some time ago ...
 
@NikiC but performance is a nice side-effect
 
@AndreaFaulds By optimised, do you mean that an array with 10k elements has 10k buckets?
 
@ircmaxell I don't think it has any significant advantage in performance in master.
 
@NikiC we're not talking about master though ;-)
 
11:39 PM
just tried, still has an edge on master (for insertions)
 
slight though I'm assuming?
 
@Ja͢ck Lookup is optimised
 
I'd say 25%
 
wow, that's not slight (though it's still trivial)
 
By the way, everyone vote Yes on my integer semantics RFC. :p
 
11:42 PM
@AndreaFaulds Sure, but considering a distribution of three items per bucket, after hashing the index it still iterates the chain .. right?
If each element sits in its own bucket, the chain will always be 1
At least, that's assuming my understanding of arrays is accurate.
afk
 
Since each has its own bucket, it's faster, yes
night
 

« first day (1430 days earlier)      last day (3515 days later) »