Author: Manuel Lemos
Last month viewers: 8
Categories: Lately in PHP Podcast, PHP opinions
The new features planned for PHP 5.7 was one of the main topics covered by Manuel Lemos and Arturs Sosins in the episode 51 of the Lately in PHP podcast. They also did an extensive review the new features of PHP 5.6.
Now listen to the podcast, or watch the hangout video, or read the transcript to learn more about these PHP release features.
PHP Releases 5.4.32 and PHP 5.5.16 (1:56)
PHP 5.6.0 Launch and New Features Review (3:59)
PHP 5.7 New Feature Plans (26:20)
PHP Innovation Award Winners of June 2014 (47:44)
PHP Innovation Award Ranking of 2014 (54:51)
Download Size: 50MB Listeners: 1980
Introduction music Harbour used with explicit permission from the author Danilo Ercole, from Curitiba, Brazil
In iTunes, use the Subscribe to Podcast... item of the Advanced menu, and then enter the URL above to subscribe to this podcast.
Note that the timestamps below in the transcript may not match the same positions in the video because they were based on the audio timestamps and the audio was compacted to truncate silence periods.
See the Lately in PHP podcast play list on YouTube and Subscribe to this channel there.
- RFC: intdiv()
- RFC: Closure Apply
Manuel Lemos: Hello. Welcome to the Lately in PHP podcast hangout episode 51. This time, again, I have here with me, Arturs Sosins from Latvia.
Hello, Arturs. How are you doing?
Arturs Sosins: Yeah, hello. As you see, I have already made myself recognizable by the lower third, the one we used to not have.
Manuel Lemos: Yeah.
Arturs Sosins: You're famous by yourself. You don't need one, right?
Manuel Lemos: I don't know. My mother used to say that she knew me.
Arturs Sosins: At least somebody does.
Manuel Lemos: Yes, at least in my street, my mother knew me.
Of course, I do not need to say that I am Manuel Lemos, creator and developer of the PHPClasses site.
Some people love it; other people hate it. I don't know why because it's such a useful resource, almost 1.3 million registered users.
Last time I said that on Twitter, because somebody say, "Oh, PHPClasses is irrelevant." "Oh, well, maybe you disagree with the other 1.3 million registered users of the site."
And in that same week, a flood of new classes was submitted. I don't know if it was because of that post. I don't think many people followed the stupid arguments that go on Twitter. But well, at least something positive simply came out of that, if that was really the case.
PHP Releases 5.4.32 and PHP 5.5.16 (1:56)
Manuel Lemos: Anyway, not to talk specifically about PHP Classes, but PHP matters in general. So we are going to start precisely with the latest releases starting from the latest 5.4 release, which is basically just a bunch of bugs being fixed as usual, like the latest releases.
According to the plans, this will be probably one of the last releases of the PHP 5.4, because after that, it will only get security fixes.
So if there are any bugs that are not about security, the fixes will not make it to this version. So, they will make it only into 5.5, because it still have probably one year more of lifetime, in terms of development, bug fixes and maybe other minor things. I don't think it will also get any new features being added or changed.
And talking about PHP 5.5, there was the 5.5.16. I did not mention but the 5.4 release was 5.4.32. Basically, the same bugs were fixed, probably just minor differences that I did not even notice which one those could be. But this is just their regular monthly update of these versions.
PHP 5.6.0 Launch and New Features Review (3:59)
Manuel Lemos: What was really, really new this month was the - actually not new, but something expected - it was the 5.6 release that was finally launched. I think it was in August 28th.
Well, maybe you can review some of these features. Now, that is official, I think that is when it will start getting real usage, because until now we have been looking at beta and release candidate versions. Now that it's final, people will start considering using it. So let's take a look at these features.
Let's start from this list, beginning with constant scalar expressions. It's like now you can't define a constant based on values of another constant.
Arturs Sosins: I actually did not know what it was not possible.
Manuel Lemos: Yeah.
Arturs Sosins: That means I had never needed a situation to use it. OK, yeah, it's good to know it's possible now.
Manuel Lemos: In reality, I think it was possible, but not with this syntax. If you use the define syntax, you could use define equals to something. But I think define cannot, I'm not sure if define, I think define is just for strings or not. I'm not sure. No, I think define also can define integers.
Arturs Sosins: The good thing, that we can forget about it and start using PHP 5.6.
Manuel Lemos: Yeah.
Arturs Sosins: Because it's much easier.
Manuel Lemos: Well, I don't know. What I meant is that traditionally, I would not use this way of defining constants. I use define, so I was not even aware we could define global constants. I thought it was more like inside of classes. But well, we are always learning more about PHP.
Anyway, what matters is that you can have expressions and this way, you can use that common example, for instance, if you want to define the number of seconds in a day, instead of doing the calculations separately, you can just put there it's 24 * 60 * 60. So, you can multiply the number of hours by minutes and seconds of the day and you would define a constant that way.
It's probably more efficient in the lower level. Maybe it will not make a big difference in performance. I mean a difference that you notice, but it will be more efficient.
So this is one of the new features. Another feature is the variadic functions using the (...) ellipsis here. So, if you have a function that can take a variable number of arguments, you can define the part that is variable, because you can still have a constant number, a minimal arguments and then have a variable part.
The variable part, it can be sent to an array and you can actually look into that as a variable, and use the regular array functions to traverse the array to count the number of elements. I think this is probably nicer than using the function func_get_args().
Arturs Sosins: Yeah, previous, if you need to implement a variable function with multiple unknown amount of parameters, it was kind of messy.
Manuel Lemos: So just keep one line of code and you'll be much happier now, because before you could say $params=func_get_args() and do the same as it is proposed now. But now, it's nicer.
Arturs Sosins: As you see now, you can have a couple of predefined variables and then pass the rest of the arguments.
Manuel Lemos: Yeah, that's true. It is not exactly the same thing because the func_get_args() will get all the arguments, not just the variable part.
Other than that, we have exponentiation...
Arturs Sosins: No, there is also an unpacking with the same operator. Basically, we can pass a...
Manuel Lemos: Sorry, right. I was considering it to be the same feature.
Arturs Sosins: It's the same important feature.
Manuel Lemos: Yeah, that is a nice feature, although I have to figure use case, I would use it. But well, OK, you can unpack an array and shove it into a function that takes a variable number of arguments or something like that.
Arturs Sosins: There was a list or something like that could I think... I don't remember. I haven't coded in PHP for awhile.
Arturs Sosins: OK, it seems to be easier to do it this way. But there could be instances when you want to pass whole array, and leave the function that you are using is not yours to define, you can define it to accept arrays, accept arguments. So yeah, it's better to unpack than...
Manuel Lemos: Yeah. You've been using too much Lua and you don't remember it correctly.
Arturs Sosins: Yeah, but it Lua, unpacking is very important because there are lots of operation stages.
Manuel Lemos: Oh, they also have unpacking in Lua?
Arturs Sosins: Sure, why not? Of course.
Manuel Lemos: So, it's only PHP did not have that feature, because it says here that these things, you also have in Ruby.
Arturs Sosins: Maybe.
Manuel Lemos: But too bad, nobody uses Ruby except for those 3 developers there in the corner.
Manuel Lemos: OK, anyway, moving on, the next feature to comment is a exponentiation via **. There is not much to say except that now, there is this operator that you can...
Arturs Sosins: And previously, I think there was a pow () function, right?
Manuel Lemos: Yes, power. It will be the same thing. Except that now, it will look nicer because you don't need to call a function. I don't know why they use the **. Probably they could use exponentiation, but I think that there's a different meaning, probably.
I mean, the circumflex accent. But I think if I'm not mistaken that's... I don't know if it is in PHP or I am confused that operator is to XOR operation or something.
Well, anyway, we are talking about PHP and what matters here is the way it is done in PHP. Now, you can have this operator and you can also have the shorthand assignment operator, like assign it if you want to...
Arturs Sosins: This is a basic arithmetic operator, basically.
Manuel Lemos: Yes. Like you can use this syntax to raise a variable to a given power number, which would be the right hand side of the shorthand assignment here.
OK, other than that, then we can now use the 'use' operator to specify namespaces from where you'll be using certain functions or certain names or certain constants.
Arturs Sosins: Basically, that 'use' operator is already in PHP, but now, we can also define the functions and constants, probably constants related to the above feature that constants will upgrade it. Now, we can use them with the namespace.
Manuel Lemos: So, if you use multiple namespaces, now, you can specify from which namespace you can use functions or variables or constants.
So, this probably will help solving some ambiguity that could happen in case different namespaces define different symbols and functions.
Arturs Sosins: Not only that, it is also shorter to write. If you're using its function, it's a lot better to define it shorthanded.
Manuel Lemos: Yes, that's true. Eventually, it will be easier to type these things. But what matters is that the answer is 42.
Arturs Sosins: It always is.
Manuel Lemos: And then, I want to check, just because you talked about it, I want to check the test from Hitchhiker's Guide To The Galaxy.
Arturs Sosins: I don't remember why it was actually, but yeah, it's very popular.
Manuel Lemos: But there's a thing in the Internet called Google, you type 42 and it shows videos of the movie and things like that.
So, as you may see, the constant Foo is 42.
Manuel Lemos: Next, there is this new interactive debugger called phpdbg, which is implemented as a SAPI module. And a SAPI module means that it is a sort of an extension.
There are many SAPI modules. There are SAPI modules to integrate PHP with Apache, with CGI, FastCGI, CLI, which means it's the command line.
This phpdbg debugger is implemented as a new SAPI. I did not try it so I may not be correct, but from what I got, you start it from the command line just like the CLI and you get an interactive debugger.
I don't use debugger from the command line. Either they are integrated in the IDE...
Arturs Sosins: You mean editor?
Manuel Lemos: An editor, exactly. Now you got it right, it's an editor. Or I don't use them because it's too complicated and you have to guess the syntax of the command line. Although I use the command line all the time for other things...
Arturs Sosins: There was also that debugger... how was it called, Xdebug... that simply output in the HTML all the information that ever happens, something like that. So you can trace the problem. That was also useful.
Manuel Lemos: But in that case I think it was an extension of PHP. In this case, it is something well integrated as a SAPI module.
Arturs Sosins: Usually, I think my first really interactive for advanced debugger for PHP I tried to use was the first prize I ever won in PHP Innovation Awards, was an add-on to Visuals Studio that implemented PHP debuggers. So, yeah, it was kind of cool. And I think probably this should be as advanced as that one.
Manuel Lemos: Yeah. But that was a long time ago, when you were young.
Manuel Lemos: Well, anyway, people that would like to debug something and enjoy doing it from the command line, I'm sure they'll appreciate it, to use this.
Although here, there is Remote Debugging support bundled with that Java GUI. I'm not even sure if this is good thing.
Arturs Sosins: Yeah, I knew you would say something like that.
Manuel Lemos: It's too many bad things in the same sentence. Well, that's my opinion, of course. Different people have different opinions.
Anyway, now you know there is a new debugger. Talking about the rest of the other new features, we also have mentioned here that the default character set encoding will be taken from default_charset function, I mean, constant defining the configuration.
I think there was some change in PHP 5.4 that they change the default encoding.
Arturs Sosins: To UTF-8?
Manuel Lemos: Yeah. And if you were not assuming UTF-8, you would have to either test some parameters or change the configuration setting.
Arturs Sosins: I don't know which version it was, but yes, it is like that.
Manuel Lemos: I think they now made it more consistent.
Arturs Sosins: You can now define the default_charset, and all the other functions will automatically use it without it passing into it. So if previously, there was a UTF-8 I think everywhere, then now you can change the default and it will...
Manuel Lemos: Yeah. I wonder if you can also change the default_charset at runtime. I mean, the configuration option. I think so, but I did not try it, because I'm not sure if all configuration options can be changed at runtime.
Arturs Sosins: Anyway, you can use ini_set, something like that. But yeah, I don't know, you need to check specific options if you can change them or not.
Manuel Lemos: Right.
And then, there is a mention here that php://input is reusable. This means that for instance, if you are taking HTTP PUT request... or I think even POST... you can read the actual input from this virtual filename. It's not really a filename, and it can do it multiple times in the same script. I'm not sure why this is important but I'm sure why this is important.
Arturs Sosins: Or it leads to the next feature, no?
Manuel Lemos: Yeah, or not. I don't know. Maybe it's related with the large file uploads.
Arturs Sosins: Yeah, I think so, at least.
Manuel Lemos: Yeah, because when PHP takes an upload first, it takes the whole request. Only then it starts the actual script.
So, maybe, the server is getting the file. Actually, PHP is storing a copy of the file and only then it starts the actual script that takes that upload.
Arturs Sosins: Yeah, fortunately, there is no knowing how to implement it, but yeah, that could be a good guess.
Manuel Lemos: I'm not sure if you can actually start the script right away, and before the whole upload ended and then start reading it from php://input. I think you can configure PHP to work that way, but I'm not sure right now.
It's not something that I have to deal on a normal websites, dealing with very large uploads like 2GB or more. It's a very large file now.
Arturs Sosins: Yeah.
Manuel Lemos: It probably won't even be feasible to store it in a database, or at least in a regular database field.
Probably with blob but using the prepared statements, because if you try to insert it in query like we used to do before... for instance MySQL supported native prepared statements... it was very slow because we need to encode the whole file contents and paste it in query. It was very slow.
Arturs Sosins: That makes it safe.
Manuel Lemos: Well, not just safe but for instance, if it's a binary file, probably you have to escape null characters and...
Arturs Sosins: That's what I mean by safe, so it won't basically...
Manuel Lemos: But you would hardly have to do that, because you can insert text value with new characters in the middle. You just have to escape them.
So the problem is not just escaping but if you have a large file, escaping it would take a lot of time and a lot of memory. Because when you actually generate the SQL query, you have to concatenate all the values into a single text query.
Arturs Sosins: Yeah.
Manuel Lemos: And then, it would exceed your PHP memory limits, depending on how large a file it is.
Arturs Sosins: And you would need to upload it again.
Manuel Lemos: No, the best solution is to use prepared statements and for that, you need to use a database API that supports blob.
Arturs Sosins: Like PDO.
Manuel Lemos: No, PDO, it emulates everything. Don't use PDO. For this purpose, PDO is not a good idea because it emulates the prepared statements. So it will do the same. It will paste the file contents in the query.
Arturs Sosins: OK.
Manuel Lemos: And if you use MySQLi extension, I mean the prepared statements, it will actually only pull the contents of the file by the time the query is executed, not when it is prepared. This makes using MySQLi more efficient.
So if you need to deal with large files, use my MySQLi, not PDO. Unless PDO has evolved which I have no recollection, and it supports native prepared statements, which would be a good thing.
Anyway, moving on to the next feature of PHP 5.6, now you can have numbers that have arbitrary and precision. I mean, they are actually represented as strings with an unlimited number of digits so they do not lose precision, and you could perform operations with them. So previously, you would use the GMP extension.
Arturs Sosins: Probably still need it. Still needs the extension.
Manuel Lemos: Yes, you still need the extension, but now, you can assign a variable to a GMP number, and then perform operations...
Arturs Sosins: Basic arithmetic operators...
Manuel Lemos: ...instead of using gmp_add, have you use the + sign and then you have the result. So if you need to use arbitrary precision math, now it got nicer.
And then, there are other features. Probably, we're not going to cover all of them here because they are not so important. But you can check this page on the PHP.net site for more details.
One last feature that I wanted to mention, just because I already got a report, is that SSL and TLS connections used in HTTPS protocol, they now have peer verification enabled by default.
This means that when you try to connect to a server, it verifies if that server says it is what it is, to verify if there is no man-in-the-middle security attack.
The reason why I wanted to mention this is because I have a SMTP class and there is a user that told me that it is issuing warnings because the TLS connections are now enabling peer verification.
And when it connects to Gmail, the server says it is one given IP address. I mean, the server says it is a given name and the class checking for an IP address, something like that.
So, given that, I need to see if either I disable peer verification or change the way it connects to the SMTP server. I'm not sure yet, I did not fully analyze the problem.
So if you are having warnings, difficulties to connect to secure servers in PHP 5.6... I mean, if you're planning to upgrade to PHP 5.6 and you are doing secure connections, you need to make sure that you don't face this problem. And probably consider not upgrading at least until you fix your code with some workaround or something.
Arturs Sosins: Or Manuel would fix this old code and submit an update.
Manuel Lemos: Well, I can fix my code, but I can't fix the whole code of the rest of the PHP community that probably deal with these problems.
PHP 5.7 New Feature Plans (26:20)
Manuel Lemos: So given this, let's move on with other topics. Now that PHP 5.6 was released, there are already plans for eventually 5.7 release.
There is a proposal here from Andrea Faulds. He's been very active submitting patches and proposals for new features.
And it seems he's saying that probably PHP 7 may take more time that we'd like and it would be great to have an intermediate version that would be just merely an upgrade to PHP 5.7. Eventually, it would not have a great backwards incompatibilities.
I don't know, this is something that is going to happen, from what I could understand. Arturs, did you follow this? What do you think will happen?
Arturs Sosins: First, when I read it, the whole message seemed to be like, "Let's create PHP 5.7 to delay release time of the PHP 7 because it needs more time, of course." It is complicated, lots of features in a future version.
But it could also mean interpreting things that way, that while PHP 7 is developed, there will be more new additions and patches coming from other members of the community, and well, we need to put them somewhere.
So, probably it would make sense if there would be a between release to include them, or at least to prepare for the possibility that there would be the release and there would be some new things to put in there.
Sure, I think that's viable and that it will happen. There will be a 5.7 release.
Manuel Lemos: Yeah, I think from what I read... sometimes it's very hard to follow the discussions because it's not certain that everybody is agreeing... but from what I understood, it seems that it's generally accepted that there will be an intermediate version before PHP 7. So that will be PHP 5.7.
Regarding that, there seems to be already some proposals that are targeting PHP 5.7. Let me take a look. There were actually two proposals which is to implement...
Arturs Sosins: Integer division.
Manuel Lemos: ... integer division which would be... Well, the original intention is to have an operator which would be %%, which mean that the result of two values with this operation would return the integer division, even if there is a reminder.
So 3 divided by 2 would result in 1, not 1.5, and it will return an integer, not a float number.
This is just to actually implement something that is used quite a lot, but personally, I've been using the intval function to divide 3 by 2 and call the result, pass that result to intval and intval would return just the integer part. It's practically the same thing, except that with this operator, it will be implemented as a built-in function.
Arturs Sosins: Yeah, basically one percentage symbol gives you division, two gives you the whole part, the integer part. So, yeah, it makes sense.
Manuel Lemos: Yeah, and it says in the proposal here that it would be the same except that if you have large integers with more than 53 bits, the return would be float and you'll lose precision.
Arturs Sosins: Yeah, that's if you do the full division and then cast the integer, then probably you'll lose something.
Manuel Lemos: Yeah, so I would use intval and they're using cast here, it's the same thing.
Arturs Sosins: Yeah.
Manuel Lemos: So the idea is to make this more accurate for very large numbers. What happens is the fallback proposal is to implement this function called intdiv and that function was approved as proposal, but the actual operator was not approved.
I do not know why but there are many people refusing it. It's probably that they don't like it to add more complexity to the parser. I don't know, sometimes these symbols collide with something else.
OK, so the operator was not approved but the function was approved. So, this was targeting PHP 5.7. I was trying to read where it says that. Or maybe I'm confusing with some other proposal.
Arturs Sosins: Yes, it connects PHP, its earlier version, yeah.
Manuel Lemos: 5... Yes, that's another proposal. I already mentioned the 5.7.
Well anyway, this a proposal for a future version, and since it is already accepted, I think there was a patch that was already merged into master. So it is already available for the next release which we expect to be PHP 5.7.
Next to this proposal, there is another proposal called closure call, which would allow you to, for instance, assign a closure, which is basically a pointer to an anonymous function like you see here. This is an anonymous function because it doesn't have a name. And then, assign it to a variable and then you could call that function, passing any eventual arguments.
The proposal was to implement it like this, with a call. This proposal was already voted and approved. So, well, I don't know...
Arturs Sosins: Basically...
Manuel Lemos: Would it be possible just to put the bracket here. Just call FooBar, brackets () and parameters? Well, I don't know.
Arturs Sosins: I can imagine use cases, but again they might be a little far-fetched. But for example, you have some superclass and then lots of inherited classes that reuse the methods, then you can create anonymous function that would reuse the instances into our own methods and variables, so you can pass any instance of any of these class which has the same functions and variables and use it in anonymous function. Something like that.
Manuel Lemos: Yeah, well, I don't know. My question is more regards the syntax. Do you really need to call, use the function 'call'?
Manuel Lemos: Exactly. That's what I meant. That seems to be more obvious.
Arturs Sosins: But also as readable.
Manuel Lemos: Well, I don't know.
Arturs Sosins: Sometimes, it's hard to follow all those parentheses. But this is understandable. It seems that function is treated with an object, and is...
Manuel Lemos: Yeah, but we are smart men. Would just putting a 'call' there is not going to make that much difference in terms of readability, I think.
Arturs Sosins: 'call' was more for consistency, it's probably used somewhere else also. Probably methods or something like that. Now, it's just added to anonymous functions.
Manuel Lemos: I don't know, maybe there's an issue with what I'm suggesting and it's not possible for some reason, or it is something inconvenient.
Anyway, another proposal that is being discussed is about function referencing as closures. This is a bit weird, unless you are C programmer.
Arturs Sosins: Yeah, it's a regular PHP developer. For C, it's normal stuff.
Manuel Lemos: Exactly. And C functions have addresses. They are things that exist in memory. So you use the & operator to take the address of the function and then you can call it or pass it as a parameter, as they do it here.
Basically, this referencing function, that you can pass function reference... if I can call it that, that's we call it in C. I don't know if it would make sense for those that do not understand C... but function references as parameters. Maybe this makes sense or not.
Anyway, this is a proposal that is still being discussed. I did not actually follow the discussion but the vote did not yet start. So, they did not yet decide if this is going to be included or not.
I don't know, do you see any good use case for this? I think they are able to take built-in functions, references to built-in functions instead of passing functions by name like a string with a name and then call it, as we used to do since the PHP 2 days.
Arturs Sosins: Yeah, I see, Now, we can do it this way. OK, that makes sense, maybe.
Manuel Lemos: I don't know.
Arturs Sosins: Basically, you can reference in any function and then use it as a closure. OK, now, I get it.
Manuel Lemos: Anyway, this is a proposal, still being in discussion, so we don't know.
Finally, there was one proposal that was actually voted unanimously and was accepted, to make defining multiple default cases in a switch a syntax error.
I saw there was a big discussion about this, I'm not sure why, as if this is a big deal that somebody faces every day. How many times are you going to put multiple default cases in your code?
Arturs Sosins: And why?
Manuel Lemos: Exactly. It would certainly be a mistake, but I never caught myself doing that mistake. Not because I'm smart, but because it wouldn't make sense to even make that mistake.
Anyway, this was a proposal that was approved by everybody. It would just make a syntax error, so if you try to put multiple default statement in a switch, it will fail with an error. It won't run.
Arturs Sosins: Yeah, basically, it sounds to me more as a bug fix rather than a new feature proposal.
Manuel Lemos: Yeah, well, I don't know. Maybe people are facing cases that define this more often than I can imagine.
Anyway, this feature is being proposed already for PHP 5.7 on which it will first raise deprecated error, and then on PHP 7, it will raise a fatal error, I mean, compile error.
Arturs Sosins: Basically, it will be an incorrect syntax, yeah.
Manuel Lemos: That's OK. I don't think it make much difference to me.
Arturs Sosins: It should be correct thing from the start.
Manuel Lemos: Yeah, I don't think that it would make a big difference, but that's OK. That's something that is being planned. It won't hurt to have it there.
Manuel Lemos: And with this, we practically are reaching the end of this podcast, because we covered many topics, and now would be the usual sections on which we comment the Innovation Award winners of first JSClasses and PHPClasses.
Anyway, starting this month, we are having that recording of the nominees and the rankings separately.
So this would be time that I will say, Now, let's take a look at the nominees of the Innovation Award.
Arturs Sosins: And we may change our clothes.
Manuel Lemos: Exactly. Or not, maybe we just share the screen and nobody would see us.
Arturs Sosins: Oh, yeah.
Manuel Lemos: So let's take a look.
So we are now going to one final regular section on which we comment the Innovation Award winners, in this case, of June.
In June, the activity was sort of low. Everybody was paying attention to World Cup soccer, so only two classes were sent.
Arturs Sosins: Football.
Manuel Lemos: Yes. Football, soccer, it depends...
Arturs Sosins: On perspective.
Manuel Lemos: ...who prefers. Maybe there are some Americans that are listening and they say, "Oh, football, that thing that we play with hands. Oh, that's right. " It's soccer to make it obvious that you play with your socks.
Manuel Lemos: Or not.
Arturs Sosins: Or not.
Manuel Lemos: With some boots, of course, on top of your socks.
Arturs Sosins: We should call booter.
Arturs, which of these two components would you like to comment this month?
Arturs Sosins: I'm already trying to share my screen, but it seems a part of the item working, screensharing is not. Let me try it one more time. OK, now, it's opened something. Yup, it works.
The one I would want to comment is a class by Daniele Cruciani from Italy. He... show context sensitive menu.
I don't know if it could be counted as something really special or not, but I really like his approach, easy approach.
Let me show you the code a little. So, basically, you have some functions, and then you just name the options and parse this functions to the plug-in.
What it does, it create the context menu with the options that you provided, and the specific function, so the interface is pretty simple and easy to use.
Of course, as he mentioned, in his code, there are some things needed to be worked out and may not work in all browsers. But yeah, it's a great idea, great accessory. That's why I really like it.
Daniele Cruciani received a book of O'Reilly for it.
Manuel Lemos: Yeah, that's great. Let me switch to the other screen here. I'm not sure if this is looking well, because I zoomed it.
Arturs Sosins: Oh, you mean, it's not responsive?
Manuel Lemos: I mean zoom it in a different place.
Arturs Sosins: Oh, I see, it's you. OK, now you're out.
Manuel Lemos: OK, the other object that I'm going to comment, this one was sent from Jason Gerfen from the United States. It's called comm.js.
It's a component that seems to do something that seems common, which is to send AJAX request, Websockets request. But it provides a unified solution that also works not only with the Websockets and the AJAX, but also with XDR.
XDR is XDomainRequest. Since this is something for Internet Explorer or something, because I have never heard of XDR before until I saw this component.
Arturs Sosins: Yeah. All I know is XHR. Right?
Manuel Lemos: Yes. But it's different. It's XDomainRequest. I suppose this is for sending cross-domain request because AJAX request do not work if you do not have a cross domains, unless you are using, I think, AJAX 2 that with some permissions to enable that from the sender domain, I mean, receiving domain of the AJAX request. It's either that or I'm switching the order of the words.
Manuel Lemos: Anyway, this is somewhat unusual, so congratulations to Jason for this contribution. For that he picked a prize which is a book of choice that he picked from Packt.
Packt is also a book publisher like O'Reilly. They have many books that are specific to many topics that are not general topics, I would say.
Manuel Lemos: As for the Innovation Award ranking of June so far, and also considering the winners of July that were already announced, the positions have not changed so much by author, because only two authors that were not yet very well-ranked scored some points. So the main leaders of the ranking by author remain practically the same.
So far, Andoitz Jordan Marmolejo from Spain leads with 2 packages and 10 points. Jimmy Bo from Canada follows with 3 packages and 7 points, and then several other authors with 1 or 2 packages and less points.
By country, we can see that Spain is leading now, actually sort of increased its lead... thanks to points by Tony L. Requena from Spain in the July already.
Spain so far has 3 packages and 12 points, followed by Italy with 3 packages and 8 points, then Canada, also, with 3 packages and 7 points.
Then, we see Sweden has already increased its ranking, with two packages and five points. And then, several other countries follow with 1 package and less points.
PHP Innovation Award Winners of June 2014 (47:44)
Manuel Lemos: This month of June, we have 9 nominees. OK, let's take a look at this. Arturs, would you like to start?
Arturs Sosins: Let me share again. Share my screen here. Yeah, I'm sharing the right.
So first one I would like to comment is the class by wapmorgan... it's probably a nickname... who is from Russia.
He created a really useful package that allows you to manage different archives like ZIP, RAR, TAR. It's really useful if you know how to upload archives, its multiple files content and then you need to manage them like uncompress them to the files on the server.
You would have to use a different library for each one of them and this manages it all together, so that's basically useful.
Manuel Lemos: Yeah,
Arturs Sosins: And wapmorgan received a PhpStorm IDE personal license for it. IDE Web development environment. You know those languages have several editors.
Manuel Lemos: Over here we just call them editors.
Arturs Sosins: Like this. OK.
Manuel Lemos: I don't know why they put... Yeah. People use those complex names, but then, in the end, we just call them editors.
Arturs Sosins: Yeah, well, they're more than that. They can profile debuggers and stuff like that. But yeah, editors, OK, works with me.
So next one I want to comment is Mark Cole that implemented a way to parse some specific markup and generate an HTML code for that. Basically, it's more meant to be used as a help file generator.
I can try to show that now. I already have that open. So basically, you have a specific markup that can generate help files. Let me check.
So, Mark Cole is from Great Britain, and he did not select his prize. Interesting, but why?
Manuel Lemos: This one?
Arturs Sosins: Yeah.
Manuel Lemos: Well, that's good that you mentioned that, because sometimes authors either do not receive the messages, notified them, so that they do not reply. Usually, I try to insist for a week, and after that I move on. And in this case, I'm not sure.
But sometimes, authors also said, "Oh, no, I'm happy to participate in this award, but I would not like to get a prize." And that's OK, it's always great that people participate, because they are having fun. Actually, I think it's awesome that they're already having fun with prizes or not.
But I'm not sure, I do not remember this one, because there are so many winners getting prizes that I'm not sure if it was the case.
Anyway, this one, Mark Cole, Mark, if you are listening to this, for some reason, you did not get the message to get your prize, feel free to contact the site. You may still get the prize if you want.
So on my behalf, I'll comment on the remaining five packages starting from this one, PHP Push Advert from Rochak Chauhan from India.
He has been a great contributor. He has sent 52 packages, which makes him the top contributor in terms of number of packages. He also is currently one of the top users with more downloads.
Arturs Sosins: So, it's pretty similar what mobile devices does, like AdMobs and stuff like that.
Manuel Lemos: Yeah, I think that's... Well, although this is meant for HTML not really, I think, AdMob is for more true embed on actual applications.
Arturs Sosins: Yeah, yeah. It's a similar...
Manuel Lemos: Yes, exactly. So, he probably have to implement something for a project of his, and then he submitted the package to the site, which is great.
So the next package that I wanted to comment is another one and in this case, from Sergei Pryz from Ukraine. I hope all is fine in Ukraine, and he is not affected by the war with Russia. I hope he also can continue to send interesting package like this.
This one is for calculating prices of for instance orders on which you have multiple items of a certain product. And then, it performs calculations.
In this case, he uses arbitrary precision in math, to avoid losing precision when you perform multiple operations that could result in loss by rounding.
So, this package is interesting precisely because we don't want to start losing money, just because the rounding errors propagate. So kudos to Sergei for his contribution.
And in this case, he has chosen his prize, one subscription to the PHP Architect magazine, which is a very nice prize.
That is a magazine that has been in the market since the very early days of PHP. I remember it was launched by Marco Tabini in the past. Nowadays, he handed over the business of PHP Architect to Eli White, who is a great well-known developer in the PHP community.
PHP Innovation Award Ranking of 2014 (54:51)
Manuel Lemos: As for the Innovation Award ranking for PHP, since it has many more authors contributing to this ranking, the positions seem to have changed a bit.
So, by author, we can see that Chi Hoang from Germany is leading so far, with 5 packages and 21 points, followed by Andoitz Jordan Marmolejo from Spain with 3 packages and 16 points. Then comes Orazio Principe from Italy with 2 packages and 11 points, then Roger Baklund from Norway with 3 packages and 9 points. Then there are several other authors with only one package and less points.
As for country, so far, Spain is still leading with 6 packages and 27 points, so thanks to the contributions of several authors.
It's followed by Germany with 5 packages and 21 points. These are mostly all the packages of Chi Hoang, which alone has been helping Germany to rank in the second position.
Tied with Germany, there is Italy with 21 points, but only for packages. Then, Brazil follows with 3 packages and 17 points, Russia with 2 packages and 13 points, Romania with 2 packages and 10 points, then Norway with 3 packages and 9 points, Great Britain with 1 package and 8 points, India with 2 packages and 7 points, and Latvia with 1 package and 7 points.
So the PHP Innovation Award ranking for 2014 is getting quite hot with many countries and authors competing to see who will be the winner for this year. Let's wait and see what the coming months will get us in terms of evolution of this ranking.
Manuel Lemos: So, well, with this, we practically ended this podcast. We commented on many interesting topics related with the upcoming versions of PHP.
Starting this month, as I mentioned before, there will be a separate recording just for the Innovation Award winners and nominees. And also a comment on the rankings, how they are coming so far individually and by country. So that would be published first, but we include part of that in this hangout that you will be able to see it together.
Other than that, I would like to invite all, especially the nominees or even winners of the Innovation Award, to also come to the podcast that we will try to record together, so you can also comment about your own nominated packages.
I think that will make it more interesting because people can comment with more detail why they developed such innovative classes. That would make it more interesting.
Arturs Sosins: Yeah, basically, we could try it. We can have more questions and authors have more feedback.
Manuel Lemos: Yes, exactly. And they'll have a great exposure. They then can call their mothers and, "Hey, mom, come on in this Internet. That's me. I'm being interviewed. It's for the TV. It's for the Lately in PHP TV." And that would make it more interesting.
Anyway, since we have reached the end. I think we're done with all the topics. That is all for now. To all, bye.
Arturs Sosins: Bye.
You need to be a registered user or login to post a comment
Login Immediately with your account on: