Episode 159 of The SitePoint Podcast is now available! This week our regular interview host Louis Simoneau (@rssaddict) interviews Tim Boronczyk (@zaemis), the Managing Editor of phpmaster.com about the new features in PHP5.4, PHP’s strengths and weaknesses, and the DIY approach of the PHP community.
Listen in Your Browser
Play this episode directly in your browser — just click the orange “play” button below:
Download this Episode
You can download this episode as a standalone MP3 file. Here’s the link:
- SitePoint Podcast #159: PHP Master with Tim Boronczyk (MP3, 20:27, 19.6MB)
Subscribe to the Podcast
Louis and Tim Boronczyk talk about the starting up of phpmaster.com, about the new features in PHP5.4 including traits and the Session Upload Progress Indicator, PHP’s strengths and weaknesses including an exhaustive blog post made recently on the topic, and the DIY approach of the PHP community.
Browse the full list of links referenced in the show at http://delicious.com/sitepointpodcast/159.
Louis: Hello, and welcome to another episode of the SitePoint Podcast. We’ve got a bit of an interview show this week, with me on the show is Timothy Boronczyk, or Tim, do I call you Tim?
Tim: You can call me Tim, Tim is fine.
Louis: Alright, let’s go with Tim. Tim Boronczyk is the managing editor of phpmaster.com which is one of SitePoint’s latest ventures, so it’s a blog that’s all about the wonderful world of PHP. So, hi Tim, and welcome to the show.
Tim: Hi, thanks for having me, it’s exciting.
Louis: It’s great to have you. Have you been managing PHP Master from the get-go, or pretty much from the get-go?
Tim: Yeah, right from its beginning, probably I want to say about eight months, six, seven, eight months, thereabouts.
Louis: Alright. So do you want to just maybe for anyone listening who’s not familiar with PHP Master, or who hasn’t had a chance to see the site, what kind of things do you tend to publish about, how are things going, what’s the pitch?
Tim: Well, it’s a little bit of everything, we publish three times a week on Monday, Wednesday and Friday, so fire up your RSS readers if you haven’t already. We try to have a little bit of everything for everybody. We have some beginner level articles on there to help new programmers improve their skills and become a PHP master, we have some intermediate for those who have done their time in PHP apprenticeship land and are looking to improve their skills, and we have some really in-depth nitty-gritty articles for those who already consider themselves PHP masters.
Louis: Right. So I figured given that I got a chance to have you on the show we could talk a little bit about just PHP in general, where it’s at and where it’s heading, so, first and foremost, the latest version of PHP is version 5.4 and that’s a relatively new release, right?
Tim: Yes, it’s out probably a couple months now.
Louis: I’ve only been superficially aware of PHP in version 5.4, I work a little bit with PHP but mostly with Ruby and Rails, so maybe can you talk a bit about what the really cool features are in PHP 5.4.
Tim: There’s a lot of new features in 5.4 that you can be excited about, for me there are probably three or four that I personally think are pretty neat, the first one being the Session Upload Progress Indicator; the PHP developers have stuck information into the session while you’re doing a file upload so you don’t have to do any weird, hacky, flash, weird — just dirty code things; you can submit your form to post your file to the server and spin off an Ajax request behind the scenes that would just use the session variables to monitor the progress, the amount of file that has been transferred for you.
Louis: Alright, so that just kind of makes it easier to show a valid progress meter to the user showing how far along uploading that file they are?
Tim: Yep, exactly, and it’s a baked-in solution into PHP, you don’t have to use a third party library or some weird hacky workaround.
Tim: Another one is traits; if you’re a big OOP programmer, and traits are interesting, you may be familiar with them, I believe they have them in Ruby as well, they’re sets of functionality that you would use in a class, but they’re not in a class they’re just sitting off on the sidelines by themselves, and you can import this set of functionality into the class, so it makes code reuse easier, you don’t have weird convoluted class hierarchies trying not to repeat your code.
Louis: Yeah, that’s definitely something that’s really, really useful that I enjoy in Ruby is the ability to sort of mix in little snippets of functionality that don’t necessarily fit into an inheritance hierarchy; I don’t need everything to descend from a descendant of this master class in order to have this piece of functionality, I can just put it in a little module, in Ruby they’re called modules, and pull it in when I need it where I need it, so it’s great to see that kind of functionality in PHP as well.
Tim: Yep, that’s exactly right. Also, we have a built-in web server now in 5.4 which some people are really excited and they love it, or they’re kind of apathetic about it, but I think it’s kind of cool, it’s nice to have.
Louis: So is this mostly just for development; if I’m just playing around with some PHP scripts on my local machine I can dropdown to the command line and fire off this little development server that can serve those files without having to have Apache installed with MOD PHP and all that setup taken care of.
Tim: Yep, it makes it really easy for beginners to get up-to-speed on PHP without having to worry about configuring an Apache or an Nginex server. And now that you have SQLite as part of PHP as of version 5.0, I believe, you really don’t need the MySQL; if you’re doing just a bare basic web app you can have everything built into PHP now, just startup the built-in server and away you go. Some of the concern though is that it was a response to the Ruby community because this built-in server seems to be only good for local testing, I haven’t seen anyone do any real cool things with it yet, I’m sure someone will; I just haven’t seen it. But the criticism is PHP and MySQL and Apache is so prolific everyone has this already installed on their hosting environments; why have a built-in server for testing which doesn’t match the configuration in what you would be using in deployment.
Louis: Yeah. I mean I think it’s a valid point when you say this is something that looks like it was borrowed from Rails at least, because Rails has a very similar way of just firing up a quick little server for testing, but in Rails that’s almost a requirement because there are a lot more barriers to getting a real testing environment set up because the server setup isn’t as straightforward as just a few app get installs; in the case of PHP if you’ve got MySQL and Apace it pretty much sets itself up.
Tim: And that’s true, and I think that has to do with the driving force behind the language itself, PHP really was born as a web language, so it was tightly integrated into Apache from its beginning. All of your post and Git variables are exposed as functionality in the language, and like I had just talked about checking a session key to monitor your file transfer, again, that’s baked into the language, where if you have a general purpose programming language like Python, Perl and Ruby, you have to have the frameworks that provide the network interaction, the accepting of input data and flushing of output.
Louis: Yeah. Anyway, I mean I think it’s definitely a fun little thing, and especially as potentially people move to deploying PHP in environments other than Apache, you mentioned Nginx, that are perhaps a little bit trickier to set up, I can see how it would be valuable to have the ability to just run a really quick and dirty development server so that I can play around with your scripts and then worry about deploying them after once you’ve got them developed.
Tim: And I think my personal favorite is the new short array syntax. I had seen a few years ago when someone had first proposed it to the internals list, then it was voted up and down and all around, and I’m happy to see it finally made it into 5.4
Louis: Right. So this is basically PHP has always had this kind of idiosyncratic way of declaring arrays, where if you want to assign a new array to a variable you use the keyword array with parenthesis and then the contents of the array inside the parentheses.
Tim: Yeah, it’s just nice to be able to type an open square brace and close square brace and call it a day.
Tim: And you’re using square braces to access the array element anyway, so there’s no strange conceptual leap.
Louis: Yeah, yeah, exactly. And that’s something especially when I’m working back and forth between Ruby and PHP code on the same day, for example, declaring arrays is the one that always trips me up where suddenly I’ll be typing array in my Ruby code or trying to do this in PHP; I guess now this will work in PHP, so at least one of my two mistakes will be avoided.
Tim: Yes, your Ruby code will now work in PHP (laughter).
Louis: So, yeah, those are some cool new features. So is there much work done in terms of performance, I know that past PHP — well, I mean PHP’s pretty fast as it is, so.
Tim: Yeah, I genuinely do not know, I haven’t had a chance to look at any benchmarks.
Louis: Cool. Yeah, so really exciting, so have you started working with 5.4 in your day-to-day work already?
Tim: No, actually I’m in an interesting situation in my 9 to 5 job where we are currently maintaining a 10 year old code base, so we’re not really in a position to use 5.4 features in our code yet, we’re slowly using some native name spaces that came in the last version, 5.3, slowly rolling that in.
Louis: So another thing that a lot of people may have seen come up in the past few weeks referring to PHP is this person on their blog posted this really, really long rant about PHP, and the title of the post is “PHP: a Fractal of Bad Design.”
Tim: Yeah, I saw that.
Louis: Which I assume it means that’s it’s bad design embedded within bad design, so, yeah, and obviously I’ve seen a number of responses to this on other blogs, on Hacker News, and people explaining why they use PHP, why a lot of these features, or a lot of these complaints that this blogger’s raising are not actually real complaints, but yeah, I know we talked a little bit before the show and you haven’t read through the entire thing, but I did want to get sort of your quick read on this because it’s been circulating so much of late.
Tim: Yeah, I saw it when it first came out, and I saw the first paragraph and I’m like okay this is — alright, where’s he going with this, and I started scrolling down and down and kept scrolling down and down and down, and he just kept going point by point by point, and some of the points that he raised was the array issue that we had just spoken about, but PHP 5.4 solves by using array literals now. It also brought up that there was no true Unicode support, there are plans to do Unicode in PHP I believe in 6, but a lot of this has been known or rehashed over the years, inconsistent naming conventions for functions, and some of it has changed, some of it will be changing, some of it may never change, but I have to commend him for the length and for his passion.
For me I think it really proved Sturgeon’s Law in an ironic sense, but one of the comments down at the end said he did an excellent job, it was a very thorough write-up, which indeed it was, and suggested that he do one similar for Python and for Ruby, and I would really like to see those as well because PHP has a reputation of being beaten up, he’s a little kid in the schoolyard, and I don’t know if I really want to use that analogy because some of PHP’s issues are deserving of criticism, but overall in the industry PHP is not always the favorable choice where languages like Python and Ruby seem to have a lot more positive perception, so I would love to see someone take an honest look at those languages as well.
Louis: Yeah. I mean there’s tons to complain about in any language or framework, obviously this is a very, very exhaustive cataloging of one person’s gripes with this particular language, and as has been pointed out both by you and in other criticisms of this that I’ve seen, some of these gripes are either no longer valid or referring to problems that existed in PHP in the past but no longer do. But, yeah, obviously PHP has its strengths and one of those strengths as you’ve already referred to is just how easy it is for beginners to get to work on it. As a first language to learn for programming for the Web, and especially for people who start in front-end web design and want to start to building and accessing databases, that step of just creating a file putting it in your web directly and more or less you’re in business because you’ve already got Apache with Mod PHP.
Tim: Yeah, you honestly just have to write a file and if it has the right extension it works, you know, from a beginner’s standpoint; you don’t have to set up a magic framework, or you don’t have to set up a magic server.
Louis: Yeah. Not only that, obviously PHP having been around for so long is incredibly well-tested and stable and fast, and then of course obviously there are all these major projects out there that benefit from that ease of use and that ease of installation, you know, Drupal and WordPress and other similar projects, Magento, that because you can just grab those files put them on a server and shared hosting and they’re up and running as long as you’ve got a database to connect to is also incredibly powerful, and that’s why I think even with all that favorable perception of maybe Ruby and Python we still haven’t seen any kind of WordPress killer or Drupal killer come out of the Ruby community or the Python community or any other language really.
Another thing, given I’ve got you on the show I might want to ask is, are there any cool either scripts or libraries or frameworks that you’ve been playing with in PHP that you’d like to share or point listeners to?
Tim: Oh, I wish there were. I have to preface this with saying sometimes I wonder if I’m a professional programmer, with professional in quotes; certainly I do it as my day job and I’m paid for it, so I’m a professional, but there’s a feeling in the community that a professional programmer’s going to strive for code reuse, is going to use these libraries that are available to us to reduce the time spent in development and to ensure code that is tested and such. But every time I try to use these something always happens that frustrates, you know, I use what I have to use for work, and for my own projects I would just rather roll with my own, it’s more fun and I’m just now pulling my hair out trying to maneuver around someone’s library that is an API that’s written that suits them and their needs and not necessarily mine, or is so generic that it ends up being very bloated.
Tim: You know, I’m using WordPress in a particular project right now, and it’s just for a blogging site it’s excellent, there’s so much functionality that it provides, and plugins, if you’re using it as a very basic content management system, even if you strip out most of the functionality it’s still a very heavyweight solution to offer a client.
Louis: Yeah, there’s definitely a lot in there, and I can definitely sympathize with your point of view about libraries, you do often find yourself spending a lot of time fidgeting and figuring out how to make something work for your needs that wasn’t necessarily designed for them, I guess it’s always sort of a judgment call of whether you’ll spend more time and aggravation in doing that or writing it yourself; writing it yourself might take more time but less aggravation.
Tim: Yeah, and that comes part and parcel of being a programmer, we’re supposed to strive on finding problems and finding solutions to them, and that’s where I question my own professionalism sometimes because I just want to get something done and have it work and move on to the next thing.
Tim: Because I don’t have time to fiddle with things, and I don’t think I’m alone in the PHP community as a whole, I know — I think Ed Finkler did a blog post saying “I’m a PHP developer not a framework developer, “ you know, there’s a lot of fracturing in the PHP community, Perl has cpan and Ruby has Gems, and PHP has tried to do PHP classes, pair and peckle, and the community just never truly seems to accept it like the other communities have, everyone wants to try and roll their own solution for better or worse.
Louis: Yeah, like you said, for better or worse it seems like it’s one of the great strengths of the PHP community, and maybe one of its weaknesses is that extremely DIY approach to code. But it does mean that most PHP developers have spent a lot of time playing with things and figuring out solutions to all these problems, so it is really interesting in that respect.
Closing off, coming back a little bit to PHP Master, because that’s obviously the site that you manage, what are say a couple of your favorite pieces on PHP Master that we could maybe point listeners to if they want to check out some of the stuff that you guys have been doing over there?
Tim: That’s like asking a parent which child is their favorite (laughter), you should never do that.
Louis: I know it’s a cruel question but I’ll ask it anyway.
Tim: We have a lot of good content up there, and a lot that’s coming down the pipe. We had just done a two-part series, Continuous Integration, focusing on Jenkins. For those who do not know what Continuous Integration is it’s using automated processes to test and build your code so that you can guarantee the integrity of your code base as you develop.
Louis: Right, so it’s things that will run your test suite for you automatically when you commit new code to your master branch, and in some cases also take care of deploying that when and if the tests all pass, right?
Tim: Yes, yes. And we had some articles discussing many of the PHP 5.4 features such as the upload information in the session variable and the built-in server.
Louis: Right, and traits as well, I think I saw something on PHP Master.
Tim: Yes, we have a traits article as well.
Louis: Yeah, so there’s some stuff on traits and, as you said, the file uploads and these new features in PHP 5.4, so anyone listening who’s curiosity was piqued by our earlier discussion of these new features can head over to phpmaster.com and have a look, some in-depth information on how to make use of these new features.
Alright, well thanks so much, Tim, for making the time to get on the show, it’s been a pleasure talking to you.
Tim: Well, you’re welcome, and thank you so much for having me.
Louis: Absolutely. So other than phpmaster.com, if people want to follow you are you on the Internet on your own blog or on Twitter?
Louis: Alright, so yeah, listeners can find Tim there and also of course on phpmaster.com. So thanks again, Tim, and best of luck with PHP Master, look forward to seeing what’s going to come out of that in the next few months.
Tim: Well, thank you. Just a quick plug at the end if anyone’s interested in writing for PHP Master if they have a unique project that they’re working on and would like to share it with the world, or their unique perspective on PHP, shoot me an email.
Louis: Alright, absolutely, and they can find contact information in phpmaster.com?
Louis: Right, in the footer there’s a link that says ‘write for us’, so if you want to write for phpmaster.com just click on that link and send it on through to Tim. Alright, thanks again Tim.
Tim: Alright, thank you.
And thanks for listening to this week’s episode of the SitePoint Podcast. I’d love to hear what you thought about today’s show, so if you have any thoughts or suggestions just go to Sitepoint.com/podcast and you can leave a comment on today’s episode, you can also get any of our previous episodes to download or subscribe to get the show automatically. You can follow SitePoint on Twitter @sitepointdotcom, that’s sitepoint d-o-t-c-o-m, and you can follow me on Twitter @rssaddict. The show this week was produced by Karn Broad and I’m Louis Simoneau, thanks for listening and bye for now.
Theme music by Mike Mella.
Thanks for listening! Feel free to let us know how we’re doing, or to continue the discussion, using the comments field below.
- SitePoint Podcast #147: The CSS Ninja with Ryan Seddon
- SitePoint Podcast #123: ASP.NET with TIm Posey and Pranav Rastogi
- SitePoint Podcast #125: Taming the Stylesheet with Jonathan Snook
- SitePoint Podcast #129: Taking PHP to the Next Level with Lorna Mitchell
- SitePoint Podcast #135: WordPress Anthology with Raena Jackson-Armitage and Mick Olinik