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

Amazium Blog:
PHP in the Dark Input/Output
September 05, 2011 @ 11:25:32

On the Amazium blog Jeroen Keppens has a recent post looking at some of tools available to you when needing to filter input and escape output in your applications. This post specifically covers filtering on command line applications.

When you need data input in a web context, you send a GET/POST request to your script. On the command line, things work differently. In this blog post, we will talk obout input and output in php-cli.

The post is broken up into a few different sections:

Tools mentioned include everything from getopt and PEAR's' Console_Getopt out to using file descriptors and working with readline.

0 comments voice your opinion now!
input output filter arguments readline options


Christian Stocker's Blog:
FOTD REFLECTIONCLASS()->NEWINSTANCEARGS($ARGS) is "slow"
September 18, 2008 @ 13:17:36

Christan Stocker has posted a finding of the day that he ran across and wanted to share to help out other developers out there:

For okapi we needed to have a function which loads any class with any number of arguments. This is not so easy in PHP as it looks like [...] Since 5.1.3 you can use the reflection extension to do this much nicer.

The difference comes in at about half the time for both side of the examples - with the switch and via reflection.

0 comments voice your opinion now!
reflection switch instance class arguments


PHPHacks.com:
Shell Scripting with PHP CLI
August 09, 2006 @ 15:47:50

On PHPHacks.com, there's a new tutorial that covers a a use for PHP that's not utilized nearly enough - working with it on the command line, shell scripting.

As most of us already know, PHP is the best language for developing dynamic web pages available today. Not many people are aware that it can be used as a shell scripting language as well. While PHP as a shell script isn't as robust as Bash or Perl it does have definite advantages, especially if you're like me and are more proficient in PHP than you are in Perl.

The requirements for using PHP as a shell language is that you must compile PHP as a CGI binary instead of as an Apache module. There are certain security issues related to this so please refer to the PHP Manual when doing so.

The author shows a simple example first, just outputting information. He also demonstrates how to grab the input parameters and how to read in from the command line interactively (both single lines and multiple).

2 comments voice your opinion now!
scripting shell cli tutorial arguments interactive scripting shell cli tutorial arguments interactive


Tnx.nl:
PHP in Contrast to Perl
May 22, 2006 @ 06:21:33

As long as people "choose sides" when it comes to programming languages, there will always be articles like this to compare them. This time, it's a look at PHP versus another much-loved language, Perl.

The article takes a look at several different topics under this one umbrella, including:

  • Arguments and return values are extremely inconsistent
  • PHP has inconsistent function naming
  • PHP has no lexical scope
  • PHP has too many functions in the core

Obviously, they all seem to take a negative slant on PHP, but they do provide some content under each of the headings to back up their claims. They break out the contents of each of these examples to make comparison of Perl's and PHP's similar functionality easier. At the end, they also provide links to other resources and other posters illustrating some of the points they've shown.

0 comments voice your opinion now!
contrast perl arguments function naming scope contrast perl arguments function naming scope


Codewalkers.com:
Named Arguments Discussion on PHP Mailing List
January 17, 2006 @ 06:54:21

On Codewalkers.com today, there's a note about an interesting bit of discussion going on over on the PHP mailing lists dealing with "named arguments".

There is an interesting discussion going on in the internals list on whether or not to have named arguements in php6. The start of the discussion is here with a break off thread here.

Named arguments would allow you do to something like this:

testFunc(name:"test",vals:"stuff")

Naming the items in the code and allowing them to be accessed via one variable internal to the function. There are some pretty good arguments on both sides of things, but it still doesn't seem like it's going to be taken much further than this...

0 comments voice your opinion now!
named arguments discussion mailing list named arguments discussion mailing list



Community Events





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


deployment tips update series laravel framework opinion release podcast community interview api install package symfony language zendserver library introduction unittest

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