News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell:
PHP 5.6 and the Splat Operator
March 17, 2014 @ 09:05:36

Lorna Mitchell has a new post to her site looking at a feature of the upcoming PHP 5.6 release, the splat operator (three ellipsis...).

We have a couple of new features coming in to PHP 5.6 with names that sound much less exciting than the features they actually represent: "variadic functions" sound positively academic, and "argument unpacking" isn't exactly catchy. However they both use a new operator in PHP which looks like an elipsis (three dots ...) and is referred to as either the splat operator or the scatter operator. I included them in a recent version of my "Upgrading PHP" talk so I thought I'd share the examples here too in case anyone is interested.

She includes an example of it being used in a variadic function, one that lets you define an optional number of parameters without having to resort to func_get_args. She also talks about "argument unpacking" or the passing in of an array of values with the splat to have it handled like a string. An example with the mail function is included.

0 comments voice your opinion now!
php56 splat operator variadic function argument unpacking

Link: http://www.lornajane.net/posts/2014/php-5-6-and-the-splat-operator

CodeUtopia.net:
Is PHP a good first language?
May 01, 2008 @ 13:39:53

The CodeUtopia blog asks the online community for their opinion - what do you think of PHP as a first language?

Sometimes I've seen people say PHP is a bad first language, because it teaches bad programming habits. But is this actually true at all? Often those who say that don't really like PHP themselves either, many times because of equally untrue reasons.

They argue both sides of the situation, mentioning what could make for a good first language, why PHP is a "nearly perfect" fit for it and some arguing points for the other side as to why PHP isn't the best option.

0 comments voice your opinion now!
good first programming language argument pro con


Rails for PHP Developers:
Three New Articles Posted (Scope, Variables & RegEx)
February 19, 2008 @ 08:44:00

Mike Naberezny has posted a few more articles to the "Rails for PHP Developers" website (based on this book) covering some more of the basics.

There's three new tutorials posted:

  • Ruby Block Scope - the basics of Ruby block scope, a common point of confusion for PHP developers new to Ruby.
  • Variable Arguments - an article that shows two common API patterns found in Rails, variable arguments and option hashes, and how to implement them both in PHP.
  • Regular Expressions in Ruby - a useful reference that maps all of the common PHP regular expression functions to the equivalents in Ruby.

Check out the rest of the site for even more great content.

0 comments voice your opinion now!
rails development regularexpression variable argument scope ruby


Jeff Moore's Blog:
Improved Error Messages in PHP
October 08, 2007 @ 10:29:00

Jeff Moore mentions a "sweet improvement" he noticed when comparing the error message from a PHP4 script to a PHP5 one - the location reported for error mesages.

Sometimes its the little things that make a difference.

His sample script (a function call without the argument needed) errors on the location of the function definition in PHP4, but happily PHP5 recognized the problem for what it's worth and echoed out the location of the call to that function instead for the line number.

One more reason to ditch PHP 4 and go php 5.
0 comments voice your opinion now!
improve error message php4 php5 argument call improve error message php4 php5 argument call


Stefan Mischook's Blog:
PHP Video Tutorial Functions
October 04, 2007 @ 08:43:00

Stefan Mischook has posted the latest video tutorials in his introduction to PHP series today - this time they look at the creation of and working with functions in your applications.

I just released the first 3 videos on PHP functions that covers some of the basics on this fundamental construct in PHP. In these videos I cover things like: what exactly are functions, what are a functions 'arguments' and why do functions 'return' things.

There's three videos in this set - part 1, part 2 and part 3. If you're new to PHP and want to get a good, solid base in functions and what they're for, be sure to check these videos out.

1 comment voice your opinion now!
video tutorial introduction language function argument return video tutorial introduction language function argument return


PHPit.net:
Using globals in PHP
June 27, 2006 @ 14:53:34

In this new tutorial from PHPit.net today, Dennis Pallett talks about using globals in PHP, desscribing what they are and how to use them.

Whenever you're developing a new large-scale PHP script, you're bound to use global variables, since some data needs to be used by multiple parts of your script. Good examples of global data are script settings, database connections, user credentials and more. There are many ways of making this data global, but the most commonly used way is to use the global keyword, which we will explore later on in this article.

It's good that he mentions right from the start that most global data is a bad idea, and can really start to clutter up an application. He does help the reader prevent this, though, through the use of a few handy techniques (and design patterns).

He looks first at the "global" keyword and its use, followed by three reasons that it's not all that favorable to use. He gives other options for the "just make it global" thinking, including passing the values in function calls, passing by reference, and using the Singleton and Registry patterns to contain things a bit more. He even includes a wrapper for the registry to handle the only other globals left - the superglobals - with the same registry functionality.

0 comments voice your opinion now!
globals using tutorial singleton registry reference argument globals using tutorial singleton registry reference argument


Marcus Whitney's Blog:
The PHP Argument
February 22, 2006 @ 06:45:17

Marcus Whitney has chimed in on Tim Bray's comments about PHP in his latest blog post.

PHP has arrived. Tim Bray posted on PHP and it's got the web all hot and heavy. I know that plenty of people like to take these opportunities to flex their blog muscles and tell off all the other languages, proclaim their programming expertise and explain why all those using certain languages are dumb as hell. Greg Beaver has already done a good job of pointing out why this is a waste of time so I wont repeat what he said.

So in short, here's the deal. PHP is getting hated on because she is the prom queen. Rails in the new contender, and Java is last year's hot stuff. All three are valuable languages that provide many an over-paid programmer with the tools needed to wow their co-workers. Pick your weapon and go to town.

He's basically of the same concensus that others stated - it's not about how good one language is overall, it's about what works for you in the situation you're in. It's almost impossible to find a langauge out there that's a perfect fit fo everything.

0 comments voice your opinion now!
argument tim bray comments attitude problem limited experience argument tim bray comments attitude problem limited experience



Community Events





Don't see your event here?
Let us know!


release install community introduction list laravel series opinion developer unittest testing code language podcast symfony2 configure interview framework threedevsandamaybe refactor

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework