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:
Internal value representation in PHP 7 - Part 2
June 22, 2015 @ 10:45:41

Nikita Popov has posted the second part of a series looking at how PHP 7 represents values internally. In the first part of the series the focus was on the major change from PHP 5: the zval updates and how they're allocated. This new post gets into more of the details on each of the types and how they're handled.

In the first part of this article, high level changes in the internal value representation between PHP 5 and PHP 7 were discussed. As a reminder, the main difference was that zvals are no longer individually allocated and don't store a reference count themselves. Simple values like integers or floats can be stored directly in a zval, while complex values are represented using a pointer to a separate structure.

[...] In the following the details of the individual complex types will be discussed and compared to the previous implementation in PHP 5. One of the complex types are references, which were already covered in the previous part. Another type that will not be covered here are resources, because I don't consider them to be interesting.

He goes through a few of the different types including strings and arrays and then gets into detail on how objects have changed from PHP 5 to PHP7. He also talks about "indirect zvals" (the IS_INDIRECT handling) that points to another zval instance rather than embedding it. Finally, he talks about two other constants, IS_CONSTANT and IN_CONSTANT_AST, and how they're used behind the scenes with some example code to illustrate.

0 comments voice your opinion now!
internal value variable representation php7 zval types string array object constant ast

Link: http://nikic.github.io/2015/06/19/Internal-value-representation-in-PHP-7-part-2.html

ServerGrove Blog:
Linters for PHP projects
June 03, 2015 @ 12:34:53

In a new post to the ServerGrove blog they look at linting tools for various circumstances including standard PHP, Twig templates and Composer configuration.

Today's projects are built up from dozens of different components, configuration files, third-party libraries, tests, build scripts, etc. And even if you have the greatest test suite, bad things can happen sometimes. It's important to catch bugs as early as possible, and syntax validators can be a great (and easy) addition to your continuous integration system. You would be surprised at how many problems are caused by syntax errors. At ServerGrove, we see these kind of problems with our clients almost every day.

Their list shows you how to lint (syntax check) several different types of content:

  • standard PHP code
  • Twig templates
  • Composer configuration
  • XML files
  • Bash scripts
  • JSON files
  • YAML files

Some of them use tools that already come built-in (like PHP's "-l" or Twig's "twig:lint") but others require the use of external software such as xmllint or melody. Command examples are also included for each.

0 comments voice your opinion now!
lint project types twig bash composer xml json yaml tools

Link: http://blog.servergrove.com/2015/06/02/linters-php-projects/

Adam Culp:
Developer Anxiety, we're not alone
May 23, 2014 @ 09:39:07

In his latest post Adam Culp discusses something that developers are all to aware of, whether they will admit it openly or not, is a feeling of anxiety around problems they have, both personal and work/development related.

Yesterday I was approached by a developer, apprentice, friend, and sometimes mentor, who was having some personal issues. I consider this person to be very strong, and capable of great things. [...] During the conversation it was revealed how they're experiencing HUGE anxiety, complete with panic attacks, and are even consulting a physician who prescribed medication for it. [...It's a] common misconception is that anxiety is caused by the stress of the moment, which is simply not true. [...] For each of us the cause is slightly different, because we each struggle with our own problems and OCDs.

Adam shares some of the common stressors developers can feel around their work and life including not being "busy enough" at work, wanting to contribute but not knowing where to start and loud or open work spaces. He includes a few bits of advice on these things, some from his own experience including how to say "no" to deadlines, talking and sharing with others and doing some kind physical activity. Be sure to check out the comments for thoughts and ideas from other members of the community too.

0 comments voice your opinion now!
developer anxiety personal experience types suggestion

Link: http://www.geekyboy.com/archives/880

Anthony Ferrara:
Beyond Object Oriented Programming
November 12, 2013 @ 11:56:36

Following up on his previous post talking about going "beyond inheritance" in object-oriented development in PHP, Anthony Ferrara has a new post extends the subject, focusing more on types of classes and how his thoughts would apply.

In the last post Beyond Inheritance, we talked about looking past "types" and reasoning about objects differently. The conclusion was that inheritance wasn't necessary for OOP, and often results in more problems than it solves. Well, let's go beyond that and explore more of what will come from treating objects as containers of behavior. Let's look at what this means for various kinds of classes.

He looks at five different class types and gives a brief summary of the concepts they represent - Representers, Doers, Plumbers, Translators and Makers. He then shifts over to investigating how this all applies to the SOLID development principles. He follows this pattern of thought through and looks at how it breaks things down into decomposable behaviors and, ultimately, functional programming/code structures (including the suggestions that creating ValueObjects is directly related).

0 comments voice your opinion now!
beyond oop types solid development functional valueobject

Link: http://blog.ircmaxell.com/2013/11/beyond-object-oriented-programming.html

Jani Hartikainen's Blog:
How to use built-in SPL exception classes for better error handling
May 09, 2011 @ 08:47:12

On his blog today Jani Hartikainen looks at how you can use the SPL exception types to allow for better overall error handling in your application. Things like BadMethodCallException and OutOfBoundsException make the errors much more descriptive.

Since PHP 5, there has been a bundle of built-in exceptions - the "SPL exceptions" - in PHP. However, the documentation for these classes is quite lacking in examples, and it can be difficult to understand when you should be using them. The short answer is always.

The list of exception types he recommends include:

  • BadMethodCallException
  • DomainException
  • LengthException
  • OutOfRangeException
  • UnexpectedValueException

For each he gives an example usage of it, sometimes including a bit of code to illustrate.

0 comments voice your opinion now!
spl standardphplibrary exception handling classes types


DZone.com:
What you must know about PHP errors...
March 04, 2011 @ 13:15:06

Giorgio Sironi has a new post to the DZone.com Web Builder Zone today giving a high-level guide to some of the PHP errors you could encounter in your development time.

While pure object-oriented languages produces mainly exceptions to signal an error, PHP started out as procedural and so it has a wide range of errors that can be raised along with exceptions.

He talks about a few of the most common error related issues:

  • Exceptions
  • Errors
  • Error Types (E_NOTICE, E_PARSE, etc.)
  • php.ini directives
  • PHP functions for setting error handlers
0 comments voice your opinion now!
error exception phpini types errorhandler custom


Ralph Schindler's Blog:
Exception Best Practices in PHP 5.3
September 16, 2010 @ 10:26:17

Ralph Schindler has put together a new post for his blog about some of the best practices for using exceptions in PHP 5.3 - specifically dealing with some of the new functionality that comes with this latest PHP version.

Exception handling in PHP is not a new feature by any stretch. In this article, we'll discuss two new features in PHP 5.3 based around exceptions. The first is nested exceptions and the second is a new set of exception types offered by the SPL extension (which is now a core extension of the PHP runtime). Both of these new features have found their way into the book of best best practices and deserve to be examined in detail.

Some of the features he talks about were pre-PHP 5.3, but the focus is largely on these new features. He gives a bit of a background on exception handling in PHP and how custom exceptions could be thrown. He then moves on to the new features - first nesting exceptions and then some about the new core exception types (found here). All that being said, he includes some code to show the dynamic/logic/runtime exceptions in action including a look at best practices in library exception handling.

0 comments voice your opinion now!
exception bestpractices spl types logic dynamic runtime library


Jani Hartikainen's Blog:
The three types of programmers
August 13, 2009 @ 14:48:08

In this recent post from Jani Hartikainen he looks at the three different categories he sees developers fitting into - "smart-and-get-things-done", smart and "just a" programmer.

The other day I was thinking of programmer types. In a way, I think there are three kinds of programmers when looking at a high level [...] So how do you determine if a programmer goes into one of these categories?

The "just a programmer" is the developer that writes code because it's a better job with little passion. The "smart programmer" are talented developers but they miss the big picture things. The "smart and get things done programmer" can be the most ideal of the three - they're the ones with the vision and passion to really make great applications.

0 comments voice your opinion now!
types programmers smart justa get done


Chris Hartjes' Blog:
What Is Really Considered Documentation?
July 23, 2008 @ 10:26:33

In this new post, Chris Hartjes takes a look at something that is one of the banes of most programmers' existence - documentation. In it he wonders what should really be considered documentation and the importance of it.

As a committed user of open source technologies, the difference between me using something and not using something is the documentation. Is there documentation for it? Is it easy to find? Does it answer my questions? Is there someone I can call an idiot if I disagree with the level of documentation? These are all very important questions.

He uses the illustration of the documentation of the CakePHP framework that's helpful, but only really after you learn how to use the framework in the first place. He mentions people on both sides of the fence - those that love the framework and love the documentation and those that moved on to something simpler because they just couldn't get it.

He also mentions the variety of sources that can provide "documentation" for the framework when you're getting a bit stuck - everything from blogs to The Bakery to a different sort of documentation, unit test.

0 comments voice your opinion now!
consider documentation types cakephp example unittest manual blog


Xaprb's Blog:
Four types of database abstraction layers
August 14, 2006 @ 07:55:26

In this new posting from Xaprb's blog today, there's a look at four different types of database abstraction layers, each with their own unique strengths.

Quite a few people have chimed in on a recent discussion about PHP, MySQL, database abstraction layers, and performance. I think enough viewpoints have been covered that I don't need to comment, but one question I don't see answered is "what are the qualities of a good SQL abstraction layer?" I think it's a very interesting - and complicated - question. As it turns out, the term has several meanings, and I think it's important to understand them.

The four types he lists are:

  • Libraries that provide access to a database
  • Libraries that present a common interface to different server software
  • Libraries that write portable SQL
  • Object-relational mapping software
Each has their own description and example packages that show the strength. Following these notes, he shares some opinions on each, mentioning his likes and dislikes about the state of support for them.

0 comments voice your opinion now!
database abstraction layer four types opinion database abstraction layer four types opinion



Community Events

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


api application conference php7 project interview community example symfony framework opinion part2 podcast composer language introduction laravel list yii2 series

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