Richard Bagshaw


Freelance Web Developer - Tel 0115 923 1500

PHP 7 Null Coalescing Operator

In this series of blog posts I will be covering some of the new features available in the upcoming release of PHP 7, I know we are all very busy bees, so this series gets to the point and may be useful for anyone just wanting to understand these features quickly.

Part #1 - Scalar Typehints
Part #2 - Return Types
Part #3 - Spaceships
Part #4 - Null Coalescing Operator

The null whut .... ?

Firstly, judging a book by its cover you would probably expect this blog post to be quite a lengthy one. However, the opposite is probably true.

Continue Reading

PHP 7 Spaceships

In this series of blog posts I will be covering some of the new features available in the upcoming release of PHP 7, I know we are all very busy bees, so this series gets to the point and may be useful for anyone just wanting to understand these features quickly.

Part #1 - Scalar Typehints
Part #2 - Return Types
Part #3 - Spaceships
Part #4 - Null Coalescing Operator

The Combined Comparison Operator

The Spaceship Operator is the unofficial name for obvious reasons; the more professional sounding name is the "Combined Comparison Operator" but what does it do

Continue Reading

PHP 7 Return Types

In this series of blog posts I will be covering some of the new features available in the upcoming release of PHP 7, I know we are all very busy bees, so this series gets to the point and may be useful for anyone just wanting to understand these features quickly.

Part #1 - Scalar Typehints
Part #2 - Return Types
Part #3 - Spaceships
Part #4 - Null Coalescing Operator

PHP 5.x

Currently in PHP 5.x there is no way to specify what type should be returned by a method, you could argue that you can cast

Continue Reading

PHP 7 Scalar Typehints

In this series of blog posts I will be covering some of the new features available in the upcoming release of PHP 7, I know we are all very busy bees, so this series gets to the point and may be useful for anyone just wanting to understand these features quickly.

Part #1 - Scalar Typehints
Part #2 - Return Types
Part #3 - Spaceships
Part #4 - Null Coalescing Operator

PHP 5.x

Previously in PHP we would pass arguments to a method by just declaring the name of the argument as part of the method declaration like so.

Continue Reading

Motivation

What keeps me motivated?

I think the answer most people would expect to hear is money right? I mean, we go to work for 8+ hours each day to earn money so we can do stuff with the remainder of our lives, so surely the primary motivator is money?

Surprisingly, I don't think this is the case, don't get me wrong - I'm not arrogant enough to sit here and write how "money isn't a problem", I totally understand, just like millions of others I have bills to pay, mouths to feed and my fair share of debt, sadly this

Continue Reading

CSStyle

As web developers, I think it's fair to say we have all experienced our CSS files becoming big monolithic unruly monsters. Tools such as Sass and Less have personally helped me organise and structure my CSS in a much cleaner way.

BEM [block, element, modifier]

BEM is a way of naming things in your CSS files to provide meaning to other developers or your future self.

As an example of what BEM looks like, let's take a look at the three elements.

.component {
    /* represents a componenet */
}

.component__element {
    /* represents a small part that is used to make a component */
}

.component--modifier

Continue Reading