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

Nikita Popov:
Order of evaluation in PHP
September 25, 2013 @ 10:51:35

If you're the kind of person that wonders more about the internals of PHP and how it works "under the covers" you'll find this new post from Nikita Popov a good read. It talks about how PHP handles its order of operations in more complex evaluation statements.

At this point many people seem to think that the order in which an expression is evaluated is determined by operator precedence and associativity. But that's not true. Precedence and associativity only tell you how the expressions are grouped.[...] What does this tell us about the order of evaluation? Nothing. Operator precedence and associativity specify grouping, but they do not specify in which order the groups are executed.

He gives a few examples to illustrate his point including multiple increments of the same variable at one time and how it's the "fault" of the compiled variables that were introduced in PHP 5.1. He shows the opcode version of the same PHP userland code and talks briefly about how to avoid this odd functionality in your application.

0 comments voice your opinion now!
order evaluation opcode compiled variable

Link: https://gist.github.com/nikic/6699370

MaltBlue.com:
ZendDbSqlSelect - The Basics (Columns, Limit & Order)
July 02, 2013 @ 09:53:32

Matthew Setter has posted the third part of his series looking at the Zend Framework 2's DbSqlSelect component and its use. In this latest (and last) tutorial, he talks more specifically about columns, limiting and ordering.

Welcome to the third and last part in this series, introducing you to working with the ZendDbSqlSelect classes in Zend Framework 2. In part one we looked at building SQL Where clauses using the where related functions, predicates and closures, as well as compound queries. In part 2, we looked at all forms of SQL joins as well as a slightly more esoteric feature of SQL - UNIONS. Here, in part 3, in the words of Coldplay, we're going back to the start, and looking at the fundamentals.

He looks at three specific elements - the class constructor, the "limit" and "order" functions and the "Expression" class. He includes sample code showing how to create the class - one normally and one bound to a specific table. The next example shows how to define the columns to be selected using the "select" method. Finally, he shows the use of the "Expression" objects to perform SQL operations in the query (like "COUNT").

0 comments voice your opinion now!
zendframework2 db sql select series part3 column limit order

Link: http://www.maltblue.com/tutorial/zend-db-sql-the-basics

Community News:
6th Generation of ElePHPants is Born!
April 20, 2011 @ 12:11:13

The team that has brought you the infamous PHP ElePHPants in the past is back with another round - the 6th generation of the cuddly PHP mascot in both traditional blue and pink.

April 19, 2011 PHPère is happy to show you the first pictures of two premature elePHPant the 6th generation of PHP. As you can see ... ElePHPant the blue, is in great shape and has found its new home very pleasant

These are shots of the first turnouts of this latest batch and the rest will follow in June/July of this year. Those that have already ordered them will be contacted soon and, if you're interested in picking up some of your own, send them an email for complete instructions.

0 comments voice your opinion now!
elephpant stuffed animal blue pink order generation


Community News:
ElePHPants - the Next generation
December 17, 2010 @ 06:52:22

If you've been trying to get your hands on one of the cuddly little mascots for PHP (the elePHPant) but haven't managed to yet, there's some good news! Another run of the fuzzy little animals is being done (the 6th) and this time they're offering something new - pink elePHPants.

As we are now out of every of the 5 first generation of the elephpants, it is time to start a 6th. You'll find here all information to include yourself. [...] Fill in your elephpants wishes. We do not need any payement now. We will contact you directly before starting the generation for the actual payement.

Their schedule hopes to end the pre-order process on December 20th (just three days away) and to strat production on these pre-orders by January 10th. The end results would be shipped out for delivery in April 2011. If you'd like to lay claim to some of your own, go over to the order form and select the size (large/small) and the color (blue/pink) and fill in the contact info. Unfortunately, because of production restrictions, single elePHPants cannot be ordered, so consider getting together with a local user group and all chipping in for a box!

0 comments voice your opinion now!
elephpant order preorder pink blue large small animal


Simon Jones' Blog:
Understanding the stack index for Zend Framework Controller plugins
July 21, 2010 @ 14:58:49

New on his blog today, Simon Jones has posted a handy guide for those using the Zend Framework out there to the stack index for plugins the framework uses.

Zend Framework Controller plugins are a powerful way to inject logic into your controller system at various points, such as before and after an action dispatch. Plugins are run in the order they are added, though it is possible to change the order by defining a custom stack index. ZF internal plugins such as Zend_Controller_Plugin_ErrorHandler, which displays a nice Error 404 page, has a stack index of 999 to ensure it runs at the end of any plugin cycle. However, it's not so obvious from the ZF manual how to set a custom stack index.

He shows how to use the second parameter of registering a plugin to define the stack level and how to get the listing of the current stack to see just where yours might need to be placed. He also includes code samples and an output example of the default Zend Framework stack.

0 comments voice your opinion now!
zendframework controller plugin stack order


PHP Women:
PHPWomen Calendar 2010 On sale!
December 01, 2009 @ 09:08:22

Just in time for the holidays the PHP Women have released a calendar for the new year (2010) featuring photos of several of the founders and leaders in the group (as taken at php|tek 2009).

The rumours have been flying around for a while, and we even dropped some hints; since its December it is time for us to confirm that there is a PHPWomen Calendar available for 2010, and it is now on sale. It features our charter members dressed as the beautiful women they are, with a guest appearance by our booth babes.

You can check out the calendar over on Zazzle and pick up a copy of your own for prices between $24 and $30 USD (depending on the size ordered). Ten percent of each purchase goes directly back to the PHP Women organization where it will be used for their many programs (like mentoring and other programs to help out women in the PHP community).

0 comments voice your opinion now!
calendar phpwomen order


ProDevTips.com:
This is what's wrong with PHP
October 01, 2009 @ 08:10:43

On the ProDevTips blog today Henrik describes a situation where he "tried to be clever" with the array_map and array_filter functions and some of the confusion in their usage.

I knew array_filter existed and what it was all about since before, however I started working with something requiring array_map first, all well and OK, array_map looks like this: array_map('callback', Array). So then I assumed I could use array_filter in the same fashion, big mistake.

He was caught by the parameter order difference between the two and problems with how the callbacks worked. In the end, he he spent an hour to create a function to search an array for a partial match and didn't even end up using the array functions (opting for calls to stripos instead).

0 comments voice your opinion now!
wrong parameter order callback


Blue Parabola Blog:
Magento Feature Analysis Series, Part 7 Order Management Offering
September 04, 2009 @ 11:07:17

Matthew Turland has posted the latest article in his series on the Magento e-commerce platform. He's been talking an in-depth look at the features of the application and reporting his findings in a series of blog posts. This time he focuses on the order management features.

He lists out the seven main parts of this feature, describing each (with links to the Magento manual for some):

  • View, Edit, Create, and Fulfill Orders from Admin Panel
  • Create Multiple Invoices, Shipments, and Credit Memos Per Order for Split Fulfillment
  • Print Invoices and Packing Slips
  • Call Center Order Creation
  • Create Re-orders for Customers from Administration Panel
  • E-mail Notifications of Orders
  • RSS Feed of New Orders

He also briefly mentions a test he performed with the Opera browser versus Firefox in working with his Magento install. A bug causing sporadic crashes in Firefox was nowhere to be seen in Opera - though there was an issue with cookie propagation.

0 comments voice your opinion now!
magento feature review order management


AskAboutPHP.com:
Codeigniter Mixing segment-based URL with querystrings
March 10, 2009 @ 11:10:54

The Ask About PHP blog has a tutorial offering CodeIgniter users an alternative to the "no normal GET variables allowed" restriction the framework puts on its URLs - a hack to add those GET values back in as a configuration item.

Codeigniter does allow you to turn on the querystring capability, but that would mean you have to use a pure querystring approach, foregoing the segment-based approached. So, is it possible to mix segments and querystring?

Because of how the segmenting URLs are handled, the order of the parameters is very important as they're passed directly into the controller that way. By bypassing this structure and grabbing the GET variables out of a constant in one of the configuration files in one of two ways - mixing them globally and mixing them locally.

0 comments voice your opinion now!
codeigniter framework query string get variable order


Sameer Borate's Blog:
Finding if an array is ordered
January 08, 2009 @ 11:15:35

On the CodeDiesel.com blog today Sameer has posted a quick code snippet that lets you see if a numeric array is already ordered correctly (useful for something like unit testing).

I recently wrote a quick code to find if a numeric array is ordered i.e sorted in a ascending or descending order. I needed it to check a sort algorithm I had written. The problem is that the following code has a worst-case running time of O(N).

He includes the forty-five line function that takes in the array and the sort order it should match. The code then loops around through them checking the value against an incrementing local variable. Also included is an example of its use in a unit test, passing it into an assertEquals for a PHPunit test to check the given array.

2 comments voice your opinion now!
order check array unittest example



Community Events





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


introduction language series tool community install application package symfony laravel library voicesoftheelephpant opinion version interview podcast release framework composer security

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