« first day (1446 days earlier)      last day (3485 days later) » 

8:00 PM
not to mention with the extension there's no need for modifying symbol tables, etc...
 
hey
 
I have a quick question
I have a json string
which i decoded with json_decode
How do I modify a value and then re-encode it?
 
/me blinks
 
/me wonders what was tried, while secretly knowing the answer already
 
paste.jesse-obrien.ca/AL3 suggestions how I can test this example/
I want to learn DI the easiest way by a very simple example.
 
8:08 PM
@Deep you modify a value like you modify an array/object
 
modify the value like... you modify any other value in PHP... then... I wonder what the opposite of json_decode is... :x
 
would I do something like

$jsonFile->{'thing'} = 'Whatever';

?
 
@Deep Just try it out and read the manual.
 
well you could do that,
 
I searched "json" in the manual, and none of the pages were useful
 
8:11 PM
lol
 
Funny, because when I search in the manual for JSON, I get exactly what you claim to need.
 
Yo
So @ircmaxell, how did you get the benchmarks to lie? :D
 
You mean php.org by "manual" right?
 
I mean php.net
 
.net
 
8:13 PM
same thing
 
riiiight
I conclude, you don't know your arse from your elbow
 
@Leigh he's a kid...
 
@AndreaFaulds gcc with -O2 and higher sees that most of the code isn't used for the result, so it removes it... It's cheating in spirit.
4
 
hehe
 
@AndreaFaulds also: all benchmarks lie.
 
8:15 PM
Suggestion for my DI example?
 
@PeeHaa something for you? 24hcodeit.nl
 
@Deep JSON is not PHP specific thing.
 
yeah, but Im using php to access it
 
16:12 <ircmaxell> the compilation code is at the bottom in a function
16:13 <igorw> compilers are magic
16:14 <ircmaxell> when I get this to production status, I'm going to make all of the compilers take a required argument `public function __construct(UnicornBlood $blood)`
16:16 <igorw> they have that in haskell too, it's called the I/O monad
 
8:17 PM
@NikiC I know some of these words.
 
@ircmaxell Yep
 
@ircmaxell Never trust a benchmark you didn't fake yourself.
16
 
Instastar.
 
For example, the Clousure::call() benchmark, while strictly true, might exaggerate the benefits
 
@NikiC well, even if you fake it yourself, you should be smart enough to realize why you shouldn't trust it :-P
I am going to write a new blog post about recki... After Sunday...
 
8:22 PM
Are you talking about it at PHPNW14?
 
@ircmaxell awesome
 
@AndreaFaulds yes, one of the talks I am going into the details of compiler engineering, and the different approaches that are taken by PHP runtimes
 
If you do a Q&A, I want to ask if Recki-CT can compile Recki-CT
 
ThW
lol
 
8:25 PM
@AndreaFaulds still far away. It's just a stated goal.
 
@bwoebi I already assumed it couldn't compile itself
Much like PHPPHP can't interpret itself
 
nice results for reckti D:
 
@AndreaFaulds I will, and I will simply open bug #1
 
@webarto I don't want to think about that anymore, please no
 
8:26 PM
@ircmaxell Seems familiar... ;) github.com/ircmaxell/PHPPHP/issues/2
 
@webarto E_NOT_ENOUGH_TRAITS
 
@AndreaFaulds Recki is specifically written so that the subset of code it uses is valid Recki code...
 
Let's all pretend nothing happened.
 
@ircmaxell Oooh...
 
8:27 PM
now, when that time comes, we'll need to migrate away from PhpParser, or rewrite it, because it's not compatible...
@AndreaFaulds so really the only thing we need is support for complex types (arrays and objects)
 
doing some horrible things myself as well today: 3v4l.org/ZvZtG
 
@ircmaxell you can just require the ast extension :)
 
@NikiC yay!
 
was there an RFC for removing PHP4 style constructors btw?
 
@Ocramius you are a bad person... $this->wrapped->__construct($bar);...
 
8:29 PM
PHP4-style constructors?
 
@ircmaxell I'm doing it for good, really :(
 
If someone has a little bit time, I am trying to get it a bit right in an example how DI works. This is what I've got so far: i.imgur.com/sSm1dSe.png How do I handle it that both classes and interface are 'connected' to eachother
 
:-P
 
@Ocramius wtf. please explain
 
ThW
@AndreaFaulds same name as the class
 
8:29 PM
@AndreaFaulds constructors with the same name as the name of the class
 
@AndreaFaulds class Foo { public function Foo() {} }
 
@Ocramius what is this I don't even
 
@AndreaFaulds NOOB
 
C#/Java/C++-style
 
8:30 PM
yup
 
evil
 
for tests' sake, god
 
dude, I think one of our servers is compromised
 
@Ocramius Dat resolution... MBP 15"?
 
8:31 PM
@JoeWatkins yes I did it
 
@AndreaFaulds yeah, taking screenshots sucks:
 
@webarto :)
 
@Ocramius No, that's AWESOME!
 
@ircmaxell it's actually my last LSP violation
@AndreaFaulds my roaming connection does not agree much
 
I have a Retina iPhone (the 5C)
@Ocramius downscale to 0.5x then
 
8:32 PM
@JoeWatkins it's returning random 500 for no reason, wifey says, but that's for dating vip admin...
500 as in SNAFU
 
[jwatkins@.......]$ cat /proc/loadavg
654.81 643.77 609.65 646/2035 10989
because that ...
 
@Ocramius uh huh
 
harhar
 
famous last words
 
haha
 
8:34 PM
@JoeWatkins
 
@JoeWatkins that's a bunch of processors, eih?
 
I still need to try aerys with my gaming rig...
 
that says there is >600 times more work to do that the 32 processors we have can handle ...
I didnt know load could go that high ... I'm surprised there isn't fire ... or maybe there is ...
 
4 processors with 8 cores?
yeah, I haven't seen that load ever
> Which leads us to a two new Rules of Thumb:
The "number of cores = max load" Rule of Thumb: on a multicore system, your load should not exceed the number of cores available.
@ircmaxell I watched the last episode and I'm sad.
 
vacations suck: so many unread emails.
 
8:36 PM
last episode?
/me needs to go watch aparently
 
@ircmaxell Of season 12, but now I see it started airing few days ago.
Family Guy's thirteenth season premiered on Fox on September 28, 2014 at 9 pm in the United States. On May 12, 2014, Fox renewed Family Guy for a 13th season. The season began with an hour-long crossover with The Simpsons entitled "The Simpsons Guy", guest-starring five of the six main Simpsons voice actors. Other guest stars throughout the season will include Julie Bowen, Liam Neeson, Lea Thompson, Allison Janney, Connie Britton, and Tony Sirico. In this season, Joe writes a children's book (The Book of Joe), Stewie becomes pregnant with Brian's baby (Stewie Is Enceinte), Meg becomes a foot fetish...
 
@Duikboot You should really just use github.com/rdlowrey/Auryn - it does everything 'right'.
 
Quick question: Do posix systems without glibc exist? Or can I take the glibc impl as reference?
 
Yes but I don't think I'm by using that the fundamental of how it actually works?
 
@boden_c @ircmaxell Yeah, I've seen it, but didn't want to pull in a dependency or implement something as complicated.
 
8:41 PM
:-\
 
@ircmaxell This is an infection started by the Symfony guys - they have no clue how to do DI or composite classes, so everything is getting more and more magical.
 
@ircmaxell well, just give him the Amphp/Amp Future class as interface.
 
Well, whatever, it's guzzle: happy to have switched to Artax for this stuff.
 
@HamZa Not sure. I saw beers in the demo though
 
Mtdowling has lots of other issues in the code he writes that seem to come from the symfony style of doing things.
 
8:41 PM
@bwoebi Seriously doubt that they exist... glibc provides the functionality required by the Single UNIX Specification, POSIX (1c, 1d, and 1j) ... but...
 
@PeeHaa hehehe
 
$s3Options = [
 'key' => S3_KEY,
 'secret' => S3_SECRET,
 'region' => S3_REGION
];
$s3Client = S3Client::factory($s3Options);
For example - because fuck named parameters.
 
ThW
@bwoebi windows nt had a posix 1 subsystem, but it was replaced later by en.wikipedia.org/wiki/Windows_Services_for_UNIX
 
@ThW only talking about Unix systems.
 
@Danack It even makes more sense because they're all related and contained inside array of options.
 
8:44 PM
@webarto because I saw that system() command is implemented as using only async signal safe functions in glibc. So, can I safely use it like other async signal safe functions?
 
ahhh
 
@bwoebi You mean assume that the system() implementation is provided by glibc?
 
@NikiC in POSIX systems, yes.
 
So you mean like, without support for BSD etc?
 
Seems like async signal safe functions are a POSIX-only concept.
@NikiC so just everything which implements POSIX-standard.
 
8:53 PM
BSD is usually mostly-posix conformant
but definitely does not use glibc, for obvious reasons
 
obvious reasons? … but okay, then I'll look up that too.
 
@bwoebi bsd is open source, can't use things that start with g.
 
@NikiC well, glibc is open source too!?
 
glibc is lgpl
 
oh, licenses strike again.
 
8:55 PM
lgpl != gpl
though it's still bad... it's just not as bad :-P
@ircmaxell @mtdowling http://t.co/XmpuipjV66
 
Btw
@ircmaxell Presumably, the PECL compilation mode of Recki-CT just compiles to C?
 
yup, but it also generates the header file and config.m4...
 
@ircmaxell We can link LGPL stuff against PHP, just not GPL :)
@ircmaxell So basically you reinvented HipHop :p
 
so at PHPNW my plan is to build a CLI compiler, where you give it an array of files and it'll do all the work to give you back a binary
@AndreaFaulds no, hiphop was designed to replace PHP. This is designed to augment it
 
Still very similar.
 
9:00 PM
you'll never compile an entire codebase with Recki... Because no global scope for one. But also because it doesn't make sense to compile highly dynamic code AOT when you can get much better results JIT...
 
Also, a realisation: We can have strict type hints for scalar types and it's not a problem. Why? Because if you want weak typing, that's what already happens if you don't hint the type.
On the other hand, it forces people using the function to do explicit casts... argh.
 
@AndreaFaulds That realization is late in coming...
 
well, there is a line there where I want 1.0 to be a valid int... But not "apple"... So there are gradiations of "weak typing"
 
@ircmaxell PHP code usually isn't so dynamic. Usually a variable is only one of these four: a primitive type, an array, an object or a resource.
 
@bwoebi you've obviously never looked at Drupal, or Wordpress
 
9:03 PM
@NikiC It also doesn't solve anything, see the message following it.
 
@ircmaxell I quickly close it when I see such shitty code.^^
 
@bwoebi and also by dynamic I mean not predictable ahead of time. Yes, it may be well behaved at runtime, but without that runtime info, good luck deciding on types...
 
@bwoebi Most scripted code is to large parts monomorphic, but you still need to handle the case where it turns out not to be the case
 
@ircmaxell for most code you can well determine which of these four types it is. What primitive type exactly is another discussion.
 
I wonder if a scalar type hint isn't such a crazy idea
 
9:05 PM
@bwoebi I don't think so... Not automatically at least... And you may be able to determine what it "may" be, but not what it's going to be...
 
as in: function foobar(scalar $a, scalar $b)
 
@bwoebi the information "is an object" is also not very useful
@AndreaFaulds It's useless, yes.
 
@AndreaFaulds I keep meaning to post to the list - It would be good to have strong scalar types like 'FirstName extends \string' - blog.jessitron.com/2012/03/strong-typing-in-java-religious.html
 
@NikiC it's just as useful as "is an array"...
 
having any scalars would be good - having stronger ones would be better imo.
 
9:07 PM
@bwoebi no. Saying that you want an array is common, but saying that "I want any scalar value and I don't care if it's a boolean or a string" is rare
 
@NikiC it's not rare, at least not in simple if()'s
 
it provides zero additional docs to not having a hint at all
 
ThW
inputs
 
@Danack Reminds me of Haskell.
 
ThW
you care about the value,but not about the type
 
9:09 PM
@NikiC not sure, but maybe I'm just thinking wrongly...
 
@Danack "By OO principles, we ought to be able to inherit from String to get its behavior."
 
Y U SO RELIGIOUS @ircmaxell?!
:P
 
ThW
@NikiC nice
 
@NikiC nice job
 
9:12 PM
<script language="php"> -- I had no idea this existed, but I am strangely glad it will be gone. It makes me uncomfortable, like my uncle.
 
@NikiC PHP reached a new stage of evolution… It gets rid of old language "features"…
 
ThW
Anyone remembers ActivePHP?
 
it still exists as it seems...
 
@Chris Have you considered writing an RFC to deprecate your uncle?
 
9:15 PM
No, I just learned to like it. I hope you know what I'm refering to.
 
@ircmaxell That's not too insane - a type of 'FirstName' that extends string should have the same methods as string in Java.
 
@Danack extension is not typedef
 
ThW
Haven't seen Wez for ages :-(
 
I think it was about the "oop principles" bit - OOP is not about inheritance
 
@Danack I didn't read it, but the code samples look like somebody's OOP masturbation went too far
 
9:17 PM
IIRC in Haskell you can do type URL = String or something like it
It's a good feature, it makes for more readable type signatures
 
@ircmaxell You've completely lost me. If I have a function `function foo(FirstName $name){...} and FirstName extends a String type that has methods, then yes the FirstName 'class' should inherit the functions from String.
@NikiC Which makes it completely indistinguishable from the rest of Java.
 
@Danack <3
 
URL -> IO ResponseBody is far more descriptive than String -> IO String
 
@Danack For all my dislike of Java, I refuse to believe that it can be this bad...
 
@NikiC no, Java isn't that bad. Just what people try to do with it...
 
9:21 PM
@AndreaFaulds a basic typedef
 
@Danack how else can I do this if I want both of them to work? Like if a user searches Pepsi and Bacardi OR Coca Cola and Bacardi, it should display the mix with ID#1
 
@ircmaxell Similar to the C typedef, yes.
 
@NikiC Java itself is quite nice. The problem comes when you try to use code written in java...
@AndreaFaulds right. Which isn't inheritance, it's an alias. They are fundamentally the same type, but gives the compiler something else to check
 
@Ibra038 slideshare.net/billkarwin/… you are trying to store multiple things in one field - this is not optimal.
 
It’s not enough to avoid writing code in the Java language. You must also avoid writing Java in another coding language. - twitter.com/raganwald/status/504252812272754688
@ircmaxell I'm not sure URL should be the same type... sure, it's implemented using a string, but that doesn't mean it should be considered the same
 
9:22 PM
URL, no
Well, URL I think is a bad example, because it's fundamentally not a string, but can be represented (serialized) as one
 
@AndreaFaulds Just post the tweet - it autos it:
Important: It’s not enough to avoid writing code in the Java language. You must also avoid writing Java in another coding language.
6
 
Oeps, that went wrong, did you recieve my last message Dannack ?
 
@Ibra038 Have you read all 70 of the slides in the link I posted?
 
THEY WERE 225!!! If you tell me I can make this when I have read that all, Ill directly read all of it, just confirm it please (:
 
9:25 PM
Searching about stdlib.h function system()... Everything I find is unrelated to it.
 
ThW
@ircmaxell did that kill something?
 
@bwoebi man system
 
it was something that gave me some headache this afternoon
 
@RonniSkansing man page is not good enough. That's usually the first thing I try, even before google.
 
9:27 PM
@Danack Do you think if I read all of the 250 pages (slideshare.net/billkarwin/sql-antipatterns-strike-back) I could solve this problem?
 
@Ibra038 Yes. Or at least you would know what is the the right problem to solve.
@ircmaxell Why would it make any difference between type-hinting for something that is a string and is stored as a string, compared to something that just looks like a string and is stored as a string?
 
@Danack because, as an abstraction (which is what objects are) a URL is not a string. It's a structured collection of meaningful parts. It has a string representation. But at its core isn't not conceptually a string until you render it as one...
it's saying there's a difference between concept and representation
A first name is a string, because there's nothing else to it but the string
but a full name is not a string, because it has components (a first name, a surname, and possibly one or more middle names. Along with prefixes and suffixes)
 
@Danack Oke that's all I needed to hear. One more try tho: is this a step in the right direction? i.imgur.com/Svn2gRY.png
 
Same could be said for a phone number, or a street address. A surname, though... that's a textbook string.
 
@Chris depends what you're doing. And that's the point...
 
9:35 PM
@Ibra038 Probably - I don't understand what the text means - each table should have it's own set of ids.
 
9:45 PM
Looking over Auryn by rdlowrey -- looks awesome.
 
So I hear.
Shite name though.
We can rebuild rename him...we have the technology
 
@Danack why?
 
I won't admit how much of a factor the lack of a cool name has played in deterring me from publishing code :p
 
@bwoebi How the fuck do you pronounce it?
Also, after you've verbally told someone the name, how the fuck are they meant to google for it?
 
@Danack German pronunciation of it ^^
 
9:48 PM
It's a spanish word...
 
@Danack and I have no clue about speaking out Spanish words^^
 
I am terrible with pronunciation of non-English terms. When I do my radio show, I don't play artists that I can pronounce, so Meshell Ndegeocello is off the table completely.
 
@Ocramius HHVM still hasn't fixed it.
 
I also skipped Chvrches for a long time :p youtube.com/watch?v=ktoaj1IpTbw
 
9:51 PM
@bwoebi why would it by bar?
 
@Ocramius because the definition of the method is called bar?
 
yes, but then there's no way to know that it is used as baz
 
@Ocramius If you look up the line of the function, you also don't get the line of the alias…
 
unless I build a diffing tool -.-
yeah, nasty :\
 
9:53 PM
So I'd have to provide my own ReflectionMethod implementation that honors the constructor arguments now
:sigh:
 
pffft
 
@ircmaxell traits are poop anyways, so heh :P
 
@ircmaxell no idea if good or bad. Bad because it doesn't honor the intent of traits. Good because it adds some nice possibilities… I'm just unsure if that really is a good thing...
 
@bwoebi traits avoid the rabbit-hole of multiple inheritance by not being typed... Making them support interfaces makes them typed. Hence making them multiple inheritance. Which is a problem
 
@ircmaxell Okay. Now look at this. 3v4l.org/ahqW4
 
9:59 PM
anyway, off to home, laterz
@bwoebi wow
just wow
something's wrotten in the state of HHVM
 
so... I don't think getName should be returning the trait's declaration name, as it is not useful information (at all)
 
@Ocramius So, how would I then get the traits declaration name. Today you have an use for the method name, tomorrow someone else might have one use for the decl name.
 
@bwoebi I'd rather change or add API to separate "declaration" and "implementation"
 
10:04 PM
Still think that getting the used name there is both more useful and more intuitive
 
implementation is in the trait, declaration is in the class
the trait doesn't exist as an actual thing unless it's used in a class declaration
 
not gonna fix it tho, because I don't give a shit about traits
 
@NikiC well, I haz an open bug, heh :P
both on my component and on zf2 .-.
grmbl, can't find a bug for it <_<
 
10:19 PM
G'night.
 
10:31 PM
I set my foreach result in a array variable, the array give me some id's, $categoryIDs = explode(', ', $result->category_id);, if i show result with print_r i see correct result, how can i convert it into: 32,432,21,543 ?
 
11:03 PM
@m_73 erm... implode?
 
urgh... my research for the bug landed in a large "refactoring" commit by Dimitri :-(
 
@webarto if i use implode and try to display result with echo or print_r then is result empty
 

« first day (1446 days earlier)      last day (3485 days later) »