« first day (1683 days earlier)      last day (3262 days later) » 

1:00 PM
Unless you're saying Framework X sucks because Framework Y does something that Framework X doesn't do, or does worse... then all you're really saying is Framework X has gained some traction and I'm a hater.
 
@SergeyTelshevsky yeah, that's exactly what it was
 
@Patrick its designed to be wrapped in a singleton so that you can yank redbean out in production code and replace with pdo or whatever you want. example: github.com/r3wt/StarterKit/blob/master/libs/StarterKit/DB.php
 
@r3wt it is designed like crap and you should not use it
 
whatever, i'm going to keep using it anyway.
 
@Sherif you know that saying that the good is the enemy of the best, I guess it works the other way round
 
1:02 PM
I'm going on, but I'll not give up of PHP be a good language any day.
 
That doesn't even make any sense.
 
You poor child, @r3wt
 
lalala cant hear you :D
 
@r3wt do you write unit tests for your code
 
nope
 
1:03 PM
@SergeyTelshevsky Who is the best in this context? I haven't heard you advocate one framework over Laravel. I just heard "Laravel sucks because bah"...
 
probably next on my to do list of things to start doing
 
This is the same old framework war that I've heard, just swap Laravel for Drupal, Joomla, WP, ZF, and every other PHP framework ever invented.
 
God selinux is a prick
2
 
Yes, my son, it is
 
@r3wt try it out =] I am sure it will change your relationship with static calls
 
1:05 PM
@PeeHaa instastar
 
@RonniSkansing do you care to elaborate on that? i don't have alot of time to invest
 
@Sherif ahem...
 
@Sherif I mean that there are 'bad' things and 'worst' things. What I mean is laravel is not the worst.
 
@tereško Thought you'd like this
 
@PeeHaa you really should try to play around with FreeBSD
 
1:06 PM
Which is my point. So if it's not the worst of the evils, why does it suck?
 
Ok, time to go, see you
 
Group-think ... I guess
 
@Sherif perception. It is no better than many of the others, yet has a marketing a community spin that puts it at best ever.
 
@Sherif because it's full of bad things? Just because there are worse things doesn't mean it's not as bad
 
@Jimbo awesome
 
1:08 PM
The community is toxic and is teaching people insular behavior and isolationism. After years of the larger community fighting that, laravel brings it right back, and is applauded for it...
 
@r3wt it is awkward/hard to mock out. Instead of having tight coupling, you could take all the static calls and put into a interface, make a class that implements it and use that as a dependency.
 
anyone knows a good guide to websockets?
 
@Naruto E_VAGUE
 
@DaveRandom LOL
 
been browsing some, and there seem to be multiple ways to use them
 
1:10 PM
@Jimbo "If I worked at Pixar I would want this machine" Nuff said
 
@ircmaxell beauty fades, stupid is for life
 
@Machavity Lovely looking board though that can handle a good cpu and even a titan and it's tiny
 
@tereško pain heals. Chicks dig skars. But glory, glory is forever.
 
for $9100 I'd expect it to be the best Micro-ATX ever made
 
@Naruto Recommend starting by reading everything on socketo.me. There are many many things you can do with them and many ways you can do them, but the underlying APIs is pretty simple, understand that and you will understand what you can do with them
 
1:13 PM
@Jimbo actually one would probably put FirePro in it
W9100
 
@DaveRandom thx m8, I will look into it :)
 
@ircmaxell And by isolationism you mean non-interoperability/portability of some sort?
 
@r3wt Happens a lot on SO, as do E_NONSENSE and E_BULLSHIT
 
@Sherif and many other things
 
@RonniSkansing IMO there are situations where static makes sense and vice versa. its short sighted to avoid static functions for such a trivial reason. use, not abuse
 
1:15 PM
@ircmaxell Such as?
 
@ircmaxell thats a controversial view. argument is tantamount to "everyone else is doing it this way, so you should to. how dare you innovate"
 
Correct me if I'm wrong, but isn't Laravel based on Symfony, which is just as interoperable as all of the other frameworks that rely on composer?
 
@r3wt very much no. Most of the other large communities have torn down the walls between them. They have focused on interoperability and portability of skills and concepts.
 
@Naruto That's the web site for Ratchet, you can usually find cboden in IRC if you want to discuss anything about that specific lib, you'll be able to find a bunch of things that use it if you want to look at some real-world usage examples (look for composer.json files that contain cboden/ratchet on Google). Ratchet is pretty mature, I'd recommend it certainly as a beginners intro to server-side websockets in PHP, many production apps use it as well.
 
1:19 PM
@Sherif I can't go into it now, about to close the boarding door.
 
@r3wt like what? I can only think of debugging
 
fuck that. PSR-7 is shit.
 
@r3wt elaborate
 
I mean, what I find shocking is how the industry is trending towards things like microservices, docker, and other language-agnostic architectures, yet PHP frameworks are still stuck in this antiquated MVC monolithic world that just doesn't work anymore.
Not sure how one can hate on a framework like Laravel, that is about as in the norm as every other PHP framework on the market, and not hate on every other PHP framework on the market.
 
You must be new here
 
1:21 PM
@Sherif symfpny is not an MVC framework
 
It's not?
 
it doesn't make sense to cram input vars into ($request). i very much disagree with abstracting away HTTP Methods in that sense. i think its dangerous. I prefer the approach of Slim 2.6.x framework. so i mostly disagree with the the new route closure signatures
 
It's a monolithic framework though, isn't it?
 
function ($request,$response)
 
Show me the MVC component in the standard framework...
I am out, later
 
1:22 PM
i think the routers responsibility should end once the closure is invoked, and the closure and whatever it contains should be responsible for producing the response
 
@Sherif stop digging the hole
 
Home?
 
Phone, autocorrect
 
Not sure what you mean. I'm just pointing out the bigger picture that seems to be missing from this discussion.
Which is that all PHP frameworks have fallen off the industry trend.
Monolithic frameworks just don't cut it anymore.
 
trend doesn't mean right, the industry is not on a steady path of improvement, it goes in hype cycles, ebb and flow, and you often don't find out what the proper way is until decades later, when all the lessons have been learned by having to maintain those codebases
 
1:25 PM
Technology is changing way too fast and way too fluidly for said frameworks to have any real impact on development costs at scale anymore. So why is everyone so hyped up on moot details like which framework has Feature X, Y, or Z when the real problem is the architecture is what's not changing.
 
Please, somebody enlighten him about composer,, writing many letters on phone is hard
 
Enlighten me? As in I don't know what composer is?
I think you're still missing the bigger picture. The problem isn't pluggable components in your framework anymore. It's that you're still using a monolithic framework.
There's a big difference.
 
You see completely unaware that symfony consists of multiple composer packages
Which are also used by Drupal an Laravel
 
I'm not. I'm fully aware of that given that I just mentioned it moments ago.
 
And shitload of other projects
 
1:28 PM
@DaveRandom thx for the advise, I will definitely look into it, thx again :)
 
@Sherif are you a proponent of PSR-7?
 
Then why do you insist on calling it "qa monolithic MVC framework"?
 
@r3wt I don't even know what PSR-7 is. Never really followed PSR much.
 
Microservices is a Hype which currently is at peak of inflated expectations. It's not for everyone. Monoliths won't go away anytime soon simply because they are simpler to build and more appropriate for small to medium apps.
 
^ voice of reason
 
1:30 PM
besides you can build all your microservices on symfony if you want.
 
@Gordon That's not entirely true. They are more appropriate for small to medium teams.
 
well, PSR-7 is a new pattern that all the big Frameworks are migrating to. its seriously fucked in my opinion.
 
You get to a certain size where deploying code built on top of a monolithic framework creates all kinds of development bottlenecks that can't be easily solved with such an architecture.
 
i gave a talk which touched on the subject of monolithic vs bazaar style architectures from the perspective of managing a long lived codebase (the subject of the talk)
 
@r3wt Can you sum it up for me in a few sentences. I'm lazy this morning :p
 
1:32 PM
what i've experienced is that it's impractical to maintain a consistent monolithic architecture on a big long-lived codebase
practices change, and you end up shifting to new architectures midstream
otherwise it's like you're working on an architecture trapped in amber, always time-travelling to get something done
not necessarily unproductive, but not pleasant either
 
@JoeriSebrechts Precisely. Microservices also promote non-sylod development practices.
When you work in sylos you tend to not be as productive as you should be.
 
And by sylo I mean silo of course
:)
 
but there's a big difference between bazaar/hybrid architectures and microservices (which are the "pure" version of that), i'm not convinced going all the way towards microservices is worth it for most projects / most teams
 
Probably not, no. In my experience it's best for Enterprise architecture and large scale teams.
 
1:35 PM
it seems to me to be quite complicated to manage large codebases that are completely micro-service oriented
 
For example, netflix went the microservices route as a consequence of scaling their engineering teams and moving to the cloud.
 
its a design pattern to make php frameworks interoperable; so you can port your controllers etc to any framework without modifications. the caveat is the new request/response paradigm for route closures. all input vars ($get, $post, $files) now reside in $request, and you must return your response in $response
 
for example, our codebase is around a million lines with around a 1000 service endpoint methods
managing that in a microservice approach with all interdependencies and version compatibility is ... tricky
 
@r3wt Sounds like a reasonable interoparability play. What's so bad about it?
 
but we're moving towards completely versioned services anyway, because we're finding it impractical to update all front-end code to back-end changes
too many clients, too much front-end code
 
1:38 PM
@JoeriSebrechts Well, it can be. But I did manage to migrate legacy PHP code from a monolith to a more service-oriented architecture with a few nifty tricks. It's not as impossible as some people think.
It just requires a lot of ingenuity on the part of the architect.
 
ha, nothing is impossible, but "slightly less practical" can be just as bad when deadlines are due
 
@r3wt that is what I did in my http abstraction more than a year ago
 
@JoeriSebrechts Right, which is why I advocated for an approach that leads to complete separation between the application layer and the services.
So you could literally deploy changes to a services in production and not break someone's application logic.
Internal versioning with a twist.
 
its fixing something that isn't broken. Slim Framework is the one who got it right, and i think its a shame to see it all go down the gutter. the other frameworks should simply die and slim should be all there is.
 
Lolwut
 
1:40 PM
@r3wt Not familiar with Slim Framework. What did they get right that PSR-7 got wrong? Examples?
 
its fast, lightweight and provides you with everything you need, and nothing you don't.
 
@r3wt $app = new \Slim\Slim(); aaand I'm out
 
Yea, I wasn't interested in reading the documentation to the framework at this very moment. Just the on-going discussion :)
 
@Sherif makes sense to me. by porting our UI to client-side JS layered on top of web services it became a lot more maintainable, just due to better decoupling (the old UI had a lot of "let's call this one function here quickly" style code, and it was a mess to maintain)
 
@r3wt Meh, terms like fast and lightweight are pretty subjective though. In order to be meaningful they have to be relative to something. I think pretty much all PHP frameworks are fast-enough for the weekend warrior. Making them faster is likely not going to be the biggest-win for someone of any significance.
I mean Those bottlenecks will likely be in optimizing your database, throwing in an opcode cache, or tweaking your hardware, etc... When you have a DB query that takes 8 seconds it will likely dwarf any 20-30 ms gain you get from moving to a "lighter" framework.
 
1:46 PM
@DaveRandom you've got mail
 
Let's face it ... the cost of highly optimized PHP frameworks has a diminishing return for the majority of serious players these days.
 
The biggest wins are in how much data you're dealing with and that's likely never going to get better as a result of your framework.
 
Fuck, it's raining
 
What's a 30 ms edge when the cost of switching frameworks is millions of dollars in developer man hours.
 
1:48 PM
@Sherif yeah, but slim framework provides you with a powerful router and leaves the rest of the implementation up to you, which is the key win
 
I'm not convinced by the performance argument not being that relevant. How big is the per-request overhead just before you get to the meat and bones of the service implementation? is it 10 ms? is it 40 ms? that can make a factor of three difference in required hardware if that service cannot return cached data
 
@tereško Unless it's raining men I'm not interested.
5
 
@r3wt Yeah, but you can pretty much just take the router of any of the existing frameworks these days and throw away the shit you don't need.
That's not much of a win.
 
@Sherif and that was my original point
 
@DaveRandom Can I get Hallelujah brother?
 
1:49 PM
Half these companies already built their code ontop of some crappy out-dated framework and they're not likely going to make the switch just because they won't have to throw away bloat. They'll likely just throw away the bloat in their existing framework.
 
that's a fair point
 
@Danack You can get an Amen
 
Anonymous
I found the lyrics for the song "a whole new world" :p
 
Morning
 
@SergeyTelshevsky , please check this link I have created select tag and 2 variables contain half each array elements and finally attach them at the very end. codepad.org/JO9EbbQm
 
2:03 PM
posted on May 26, 2015 by kbironneau

/* by MrNeutro */

 
Anonymous
@PeeHaa can we ban this ^
 
shall I get result from mysql in array format? I know there is function mysql_fetch_array() but for this we need to use while() loop but is there any method we can use for() loop on mysql result directly?
 
@John You should be using either PDO or MySQLi - and then you can get all the results by [while ($stmt->fetch()) {}](php.net/manual/en/mysqli-stmt.fetch.php]
/f markdown
 
@samaYo No? Please no?
 
@DanLugg Please yes, it's horrible
 
2:19 PM
The codinglove feed? You're nuts. You're all nuts. Nuts.
 
user895378
Don't worry @DanLugg; if @PeeHaa goes rogue and removes the coding love feed I will use my room owner powers for good and reinstate it.
 
Anonymous
the site is too slow, jokes are not funny and 3 adsese in one page? That's shamelessly need-teh-money site @DanLugg
 
user895378
Hmm ... adblock means I've never seen the ads
 
What's adblock? Is that something I don't know about because of NoScript?
 
Anonymous
hmm always been curious quora.com/…
 
2:30 PM
@samaYo We can, but I won't. If one of the other owners have a problem with it they are free to remove it
 
Anonymous
eh owner privileges :/
 
You can ignore Feeds if you so desire...
 
lol /me send @DaveRandom a mail gets a penis enlargement back within 2 minutes
magic
 
@ircmaxell typo in that tweet
 
@PeeHaa that's probably what you've asked him to do? ^^
 
2:49 PM
Well, I'll not give up of a preprocessor for the language. :3
 
OMG, somebody used double negation operator to cast to boolean.
 
Quite common in JS
 
How didn't I think in that before...
I commonly use switch(false) { case !(expr) } to simulate pipe-switch and avoid "ifs".
 
2:57 PM
> PHP != Javascript
:P
 
@PeeHaa PHP != !!Javascript
 
!! is a pet hate of mine, because it's so susceptible to being misread and/or "fixed" by a passing dev
 
@HaskellCamargo wut
 
@DaveRandom I just (bool).
 
Exactly
 
2:59 PM
That's how LiveScript's switch is implemented, @NikiC.
 
(bool) preg_match( ... ) // because fuck integers
 
Anonymous
@DaveRandom i saw that once, I thought it was a mistake
 
In JS I actually Boolean(expr) but people shout at me for that
@samaYo Point proved, I feel...
 
@HaskellCamargo \/
function evaluate(callable $emitter, array $argMap = [])
{
    ob_start();
    $emitter($argMap);
    return eval(ob_get_clean());
}

evaluate(function (array $argMap) {
    ?>

    <?php if ($argMap['isDebug']): ?>
        ini_set('display_errors', true);
        echo 'debug mode engage!' . PHP_EOL;
    <?php endif; ?>

    echo 'all the things' . PHP_EOL;

    <?php
}, [
    'isDebug' => true,
]);
 
a = ->
| foo => bar
| faa => zar

Generates:

var a;
a = function(){
switch (false) {
case !foo:
return bar;
case !faa:
return zar;
}
};
 
2:59 PM
I thought !! was pretty much standard practice by now in JS development?
maybe it is confusing though to people who don't program JS very often
 
My main programming languages are AdvPL (Clipper-based) and LiveScript. That's quite common to see these things in JS (Although not so legible).
 
@DaveRandom The amount of typos I was able to put in the thing is astonishing btw
 
the mere mention of "clipper" takes me back to when i was a little boy watching my dad write dos-based database software with clipper
he's 65 now and still programming on a daily basis
parents should give their children something to aspire to :)
 
BTW2 and totally unrelated I still use json.pieterhordijk.com on a daily basis @DaveRandom /me <3 small useful services
 
3:07 PM
I work with Clipper and Harbour, Joeri.
That's quite common here.
I love Clipper's preprocessor and I'm porting it to PHP.
 
@PeeHaa how do you add users to that thing btw?
 
@Ocramius I log in and add them :) You want in?
Or are you talking about your own feed (instead of the room 11 regulars)? In which case you can just login
 
@PeeHaa yeah, otherwise I just spend time spamming here anyway
 
Added you to the room 11 regulars feed as admin
 
@PeeHaa Meh, most of them were PHP Storm "spelling" inspection being anal about non-camel-cased var names, but once I started its kind of addictive.
 
3:13 PM
@PeeHaa ta
 
Also @PeeHaa the original reason I started was because of github.com/Room-11/Feedr/commit/… which causes a fatal which you wouldn't have ever seen because you are admin on everything
Notice: Undefined variable: request in /srv/www/Feedr/routes.php on line 151
Fatal error: Call to a member function getBaseUrl() on null in /srv/www/Feedr/routes.php on line 151
Just needs that use($request) to fix it
 
AT LAST, I am home
 
Anonymous
What's a good way to remove the forward slashes from the array in this example?
 
Anonymous
$prop = [
	'foo'=>'foo/bar',
	'bar'=>'foo/baz'
 ];
 
What do you mean "remove the forward slashes"? What do you want as output?
 
Anonymous
3:20 PM
$prop = [
	'foo'=>'foobar',
	'bar'=>'foobaz'
 ];
 
Anonymous
output ^
 
This is a classic map problem.
 
Anonymous
I want to use array_walk but not sure if there is a better way
 
Iterate over the input and do something to it, and store the result.
 
Anonymous
hmm..
 
3:21 PM
(although, array_map doesn't preserve keys I think)
(It's just one reason I always write my own)
 
Anonymous
@LeviMorrison Just curious, would there have been an easier solution if that array was inside an object? as in if it was a class property ..
 
Not really.
I mean, you can foreach over the array, build a new one, and then assign it to the original property at the end.
Basically a mapping operations inlined
 
foreach .. $prop[$key] = removeForwardSlash($value)
 
Anonymous
Oh ok, I have seen so many SPL iterators and I thought they were useful for that kind of stuff i.e iterating ...
 
@samaYo They should be. They sometimes are.
 
user895378
3:26 PM
@LeviMorrison I think I've encountered a bug with TypeException ...
 
user895378
class Foo {
    static public function bar(): string {
        return []; // Should be a TypeException
    }
}
function gen() {
    echo "a\n";
    $string = Foo::bar();
    echo "b\n";
    yield;
}
$gen = gen();
 
user895378
/cc @NikiC ^^ That should error right? I just get no output and the script dies
 
@rdlowrey Not some display_errors or some other feature?
Can you wrap it in a catch with TypeException?
 
user895378
@LeviMorrison It doesn't even echo "a\n";
 
user895378
And if I wrap with try/catch(\BaseException $e) still nothing
 
3:28 PM
Does appear to be broken; maybe @NikiC's exception changes somehow messed it up?
No, that doesn't look right.
Can look into it in about an hour if someone hasn't by then.
 
user895378
It's no rush ... just encountered it working on the server late last night and narrowed down to a simple repro case so we can fix it :)
 
@rdlowrey Why do you expect an exception there?
You don't run any code
You only create the generator
We don't do compile-time detection for static values presently
 
user895378
okay. Anyway, that's was a narrowed down case ... there is still an issue somewhere because I'm encountering fun debug build memory leaks when a bad return type happens in a static function call at runtime ... let me try to get another repro case
 
yah, memory leaks are a bug ^^
 
user895378
e.g.:
 
user895378
3:34 PM
[daniel@centos aerys]$ php7 -c ~/php.ini bin/aerys -d
Starting server ...
[Tue May 26 11:34:31 2015]  Script:  '/home/daniel/dev/php/amphp/aerys/bin/aerys'
/home/daniel/dev/c/php-src/Zend/zend_objects.c(145) :  Freeing 0xB74F1480 (168 bytes), script=/home/daniel/dev/php/amphp/aerys/bin/aerys
Last leak repeated 1 time
[Tue May 26 11:34:31 2015]  Script:  '/home/daniel/dev/php/amphp/aerys/bin/aerys'
/home/daniel/dev/c/php-src/Zend/zend_string.h(98) :  Freeing 0xB7577E70 (36 bytes), script=/home/daniel/dev/php/amphp/aerys/bin/aerys
 
hello everybody
anybody home?
 
@rdlowrey Should you find the time, github.com/php/php-src/pull/1223 is getting impatient ^^
 
can i ask some dumb question here?
 
user895378
@NikiC Yeah my plan is to finish up some userland stuff today then spend the rest of the week on ext/openssl
 
:(
 
3:41 PM
@DaveRandom ow wow. Easy fix
 
@PeeHaa I suspect I may have a fix for #1 as well, difficult for me to test, moment have to go do some real work then will explain
 
Steps to compile PHP 7 with Feedback Directed Optimization: http://git.php.net/?p=php-src.git;a=commitdiff;h=7dac4d449f72d7eb029aa1a8ee87aaf38e17e1c5 Dmitry says "may give up to 10% real performance boost!"
Oh no, new PHP builds will use FDO to ensure only WordPress runs performantly D:
Is that Haskell troll actually called Haskell or is it just a silly pseudonym
 
I saw "Haskell" there? :P
I'm not a troll, Andrea.
 
@WTFZane Is there any other kind?
 
I just care about language design.
That is why I'll keep developing the language preprocessor.
 
Anonymous
3:57 PM
<?php
class foo{
    static function bar($find = null, $replace = null){
        $array = ['foo', 'bar', 'tar'];
        array_walk($array, function() use ($array){
            return (object) $array;
        });
    }
}

var_dump(foo::bar()); // NULL
 
Anonymous
Is there any reason why that returns NULL ?
 
Yeah. You are applying array_walk with a function, but not returning anything in bar.
 
Anonymous
yeah, but the thing is var_dump inside the array_walk shows the object, but not return .. .
 
Anonymous
there is something logically wrong in there.
 
No, you are calling bar and applying var_dump in bar.
 
3:59 PM
@HaskellCamargo You are a troll. You're coming into a language help/discussion board to tell people why their language is bad.
 
Try "return array_walk"...
 
Anonymous
@HaskellCamargo that only return bool (true)
 

« first day (1683 days earlier)      last day (3262 days later) »