WebReference.com: Unary, Binary, and Ternary Operators in PHP
117129
WebReference.com has a new tutorial that looks at the difference sorts of operators that PHP has to offer - unary, binary and ternary - to help you with the logic in your applications.   An operator is a special character or combination of characters that operates on variables.  There are 3 types of operators in PHP: unary, binary and ternary. They can be used to manipulate a variable with up to 3 arguments at a time.  This article wasn't written to discuss the meaning and usage of each operator in PHP, but rather to explain the differences between these types of operators and to give examples about how each functions.   They look at the different types of operators (and include examples for each) - unary (like ! or ++), binary (things like + / == and &&) and a special case - ternary. This uses two characters in conjunction (the question mark and colon) to replace a simple sort of If statement.
470829
In response to this previous post, Ben Ramsey has relayed some of this thoughts on the benchmarks that were done by Jonathan Street comparing functions and their aliases:   Mmy first reaction was something like: "Egads! These benchmarks are stupid and misleading! These functions are simply aliases of each other. There should be no discernible difference, and any buffoon should realize this fallacy!" This was before I clicked through from PHPDeveloper.org to read his post.   After reading his data and going on to the Better Benchmarks post that followed it, he found that most of the results of additional testing came out negligible and that there was almost no difference between the two.    Ben illustrates the proof of this with a few lines pasted from the "ext/standard/basic_functions.c" in PHP's source showing that the code is shared via a PHP_FALIAS function call.
396236
This month's issue of php|architect has been released and includes articles such as:  PHP5: Beyond the Objects The Ultimate PHP 5 Shopping Cart PHP and Databases Error Handling with PHP 5 and PEAR
769389
Latest PHPClasses.org Releases:Class TreeviewPHP User ClassDHTMLDumpSalatCSV Parse and ReadRSAsmb4phpClient infoTrue Singleton ClassRounded Border Table Generator
320728
In an earlier post John Lim pointed out an interesting issue with how certain numbers are handled in PHP - ones starting with a zero:   That's because any number preceded by 0 is treated as an octal number, and 9 is an invalid octal number. [...] The silly thing is that hardly anyone uses octal nowadays, but it continues to be part of the C, C++, Java and PHP standards. The mistake is also very common.   There's not much way around it, he notes - the format's been in use for a long time now and is so ingrained in just about every C-based language out there that it's "too deeply imprinted in modern compiler DNA" to take out.
690580
On the Dotvoid.com blog today, there's a new post that shares some handy code to parse out information from the incoming user agent string for the visitors for your site.   Recently I experimented a bit with an Apache log file analyzer written in PHP. It's not all that difficult were it not for trying to parse the browser, or user agent, string. [...] For my purposes I don't care much for the operating system details. This is the result so far. I'm still not very satisfied but I thought maybe other people might be interested and maybe help out.   He provides the code in the format of an encapsulated PHP function that returns the product they're using, the version number of the browser and other various comments.
386588
Latest PHPClasses.org Releases:Smarty and MIME message integrationYour SayphpPhotoGalleryInterfacesIlariaParser 7just7.comaDB PDO like database abstractionSAMP Socket
235642
Latest PHPClasses.org Releases:convertSimple navigationPHP TablesXML ClassSitemap creator for Google, Yahoo and MSNPHPBiDiSimplePaginatorSortable ElementsSnPayPalApiMBTemplate ClassHTTP ServerXCS Parser
493955
Tony Bibbs takes a look at an increasingly popular bit of functionality in PHP5, the SOAP extension, and notes that it still has a "ways to go".   In my latest round of web services work in PHP5 I was creating a PHP5 client that interacts with our Java-based ERP. The client needs to be a combination of a couple of WSDL's into one, nice, compact and powerful client. It should be noted this client will be distributed via the State of Iowa PEAR channel so it will undoubted by used by other project in our organization and throughout state government so the result needs to have a lot more fit-and-finish than would be typical.   He mentions his expectations for PHP's usage of the protocol, including the automatic generation of variables/methods/etc to help the developer use the remote application easier.
698334
Popular posts from PHPDeveloper.org for the past week:The Bakery: Six New Articles/Tutorials PostedEvert Pot's Blog: PHP: Arrays vs. ObjectsDevArticles: Learning AJAXInternet Super Hero: PHP: mysqli_fetch_all()David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)I/O Reader: 15 Cool Things & 12 Things to Dislike About PHPProPHP Podcast: Newscast - August 16, 2007PHPBuilder.com: Dynamic XML with PHPSite News: Popular Posts for the Week of 08.17.2007PRADO Watch Blog: PRADO Watch: Interview With Timani Tunduwani - Why I Moved From CakePHP to PRADO
562803
Greg Beaver has posted a quick note about the latest release of his PHP_LexerGenerator package through the main PEAR website - version 0.2.2.   I just released version 0.2.2 of PHP_LexerGenerator.  This release fixes two bugs, one where / characters were erroneously being replaced by  characters in regular expressions, and another where lexers with no %statename processing instruction were outputting "const 1=1;" which is invalid PHP.   You can grab this latest release directly from the package's homepage.
377236
In a new post to his blog, Sebastian Bergmann mentions a new effort he's undertaken - the porting of the Hamcrest library of matcher objects to PHP.   I have begun to port Hamcrest, which provides a library of matcher objects (also known as constraints or predicates) allowing "match" rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules, to PHP.   The hamcrest-php project compliments other current hamcrest-related projects and his ultimate goal is to make it available to the PHPUnit testing community (as well as with the PHPMock effort).
693070
Guilherme Blanco is proposing an interesting idea in his new blog entry - adding built in functionality to the PHP core that would allow a developer to register their own custom suprtglobals.   Currently, we deal with a lot of interesting situations of web applications, and some really interesting are the superglobals variables. Seems there will be a change in superglobals soon and that's why I decided to post about it here.   His example of the need for something like this is as an alternative to using the Singleton pattern to work with multiple database connections in an application. His proposal is that, by including this register_superglobal functionality, it would make it easier to share these kinds of connections. He even includes a simple code example of how it might look.
310656
Popular posts from PHPDeveloper.org for the past week:IBM developerWorks: PHP frameworks, Part 1: Getting started with three popular frameworksWeb Development Blog: Tutorial: FTP Upload via cURLJoey's Blog: 8 Practical PHP Regular ExpressionsJeff Moore's Blog: Keywords and Language SimplicityAlessandro Crugnola's Blog: AMFPHP and mbstringTravis Swicegood's Blog: Why Inheritance SucksStefan Mischook's Blog: Creating Custom PHP Functions Video Tutorial - Part 3Johannes SchlÃ¼ter's Blog: PHP 5.3 UpdateInternet Super Hero Blog: mysqlnd to support PDO, mysqlnd in PHP 5.3Jacob Santos' Blog: Object Oriented Programming Isn't Easy
541647
On Codewalkers.com today, there's a new tutorial posted concerning some of the looping features PHP has to offer.
466648
Stefan Koopmanschap has pointed out an interesting article over on the CIO magazine website that has some in the PHP community a bit up in arms about comments it makes towards the language.   The article, "You Used PHP to Write WHAT?!", covers the basics of the language - its status in the web programming world, the functionality it offers and the database interfaces it includes. They also include a hit list of reasons PHP is popular and why it's a good choice for your project.   Then things get a little strange - they move from their PHP praise to three things that have more to do with unresearched "facts" than the reality of the language:   Security and PHP Working with PHP and the shell Scaling and PHP (in enterprise environments)   These incorrect assumptions have lead to many comments both from the PHP community and from users of other languages (like Java and ColdFusion) sharing thoughts on the contents of the article and the language in general. Check out the article's comments to see for yourself.
644868
The International PHP Magazine has conducted a poll on its website over the past week, this time asking "You Did Not Know That...", asking developers which of the true statements about PHP they didn't know about.   The options this time were:  The trailing '?>' in PHP is Optional You can embed other programming languages in PHP Objects can be made to look like arrays by using Standard PHP Library require is faster than require_once Anything Less than 5.1.0 is Silly All  There wasn't a whole lot of difference in the results of this poll, but the most all-inclusive of the list was the one selected the most - "All". Following that, was that the trailing closing PHP tag is optional, then a tie for third between the "embed other languages" and "Less than PHP 5.1.0" options.   Be sure to cast your vote in their latest poll that asks readers that they're really looking for in their frameworks.