Showing 6 to 10 of 16 blog articles.
93 views · 17 days ago

![Happy Thanksgiving](https://images.ctfassets.net/vzl5fkwyme3u/210WuoFQk8i8YI8iAUsyuA/a31e17d34e57fd9dc83c795d1b59ac73/AdobeStock_177353492.jpeg?w=1000)

A brief (by Mike's standards) note

> As we express our gratitude, we must never forget that the highest appreciation is not to utter words, but to live by them. - John F. Kennedy

I wanted to take a brief moment to express my gratitude this holiday season. First and foremost, a huge thank you to the beautiful Tanja Hoefler who has put in countless hours behind the scenes of Nomad PHP, ranging from finding the best articles and tweeting them out, to tracking down great speakers, to countless hours of video editing (including fixing all my mistakes from the live broadcast).

### Thank you to our Founders

I also need to thank Cal and Kathy Evans, an amazing husband and wife team who have done so much for the community over many, many years - including founding and being an inv...

335 views · 24 days ago

![Creating a Virus with PHP](https://images.ctfassets.net/vzl5fkwyme3u/1Ake3wrxwAyQSMs0amgYmG/79bd99b12402c71afb4f2290c5962daa/virus.png?w=1000)

In his talk, “[Writing Viruses for Fun, Not Profit](https://beta.nomadphp.com/video/220/writing-viruses-for-fun-not-profit),” **[Ben Dechrai](https://twitter.com/bendechrai)** (after making the viewer take a pledge to only use this knowledge for good and not evil) walks through how many viruses operate, and just how easy it is to build your own self-replicating virus in PHP.

The danger of many of these viruses according to Ben is that the most dangerous viruses often escape detection by not looking like a virus. Instead they encrypt their code to hide their true intent, while also constantly adapting and evolving.

Perhaps even more dangerously, they act like they’re benign and don’t actually do anything - often times laying dormant until called upon by the malicious actor.

### Crea...

151 views · 35 days ago

Hey there! This reading is not going to be a technical one. Instead, it's just a little portion of information that you might have not known before. I once worked for a project that did currency exchanges. As you probably know, currencies have 3-letter codes (ISO 4217), and I asked myself if there's a currency with code "PHP".

[PHP: Philippine peso](https://en.wikipedia.org/wiki/Philippine_peso)! In Philippines you can code PHP for PHP!

![Philippine Pesos](https://upload.wikimedia.org/wikipedia/commons/e/ea/PHP_2010_New_Generation_Currency_Banknotes.jpg)

But there's more to it.. "PHP: Prvi Hrvatski Pištolj" stands for "first Croatian pistol". Next time someone tells me that it's too easy to shoot your own leg with PHP, I'll definitely agree.

__If you don't believe me - checkout these [10 most common mistakes PHP programmers make](https://www.toptal.com/php/10-most-common-mistakes-php-programmers-make) from Toptal!__

Or che...

542 views · 40 days ago

![Type Arrays with Variadic Functions in PHP](https://images.ctfassets.net/vzl5fkwyme3u/6e5WrjNthmKmS6C2AAWoi0/889f4e4afe965d040b17fbe7834ad07a/AdobeStock_200448817.jpeg?w=1000)

It's a very common task to work with an array of values, each of the same type. Integers, strings, all kinds of objects etc. But PHP is still a weakly typed language, so it's hard to tell if an arbitrary array actually contains only values of a given type.

Of course, you can always use a class:

```

class IntArray {

private $values = [];

public function add(int $value) {

$this->values[] = $value;

}

}

```

Then, whenever you need an array of integers, you may write something like this:

```

class BatchProcessor

{

private $ids;

public function __construct(IntArray $ids) {

$this->ids = $ids;

}

}

```

Not bad. You'll need a class per type, though, and that may seem a bi...

215 views · 40 days ago

![PHP Basics](https://images.ctfassets.net/vzl5fkwyme3u/6mNUFZDod2SQKm20g4YsoC/b36221b3a8260ee3047a377edc6470b1/AdobeStock_69092685.jpeg?w=1000)

It's 2018, and you're a top-notch modern web developer, with a load of knowledge and tools right there at your disposal: Google and StackOverflow, debugger with a GUI, IDE with autocomplete, you name it. Occasionally, though, you still find yourself in a plain old text console on a remote server, or you have to do something without IDE, or there is no network connection... In such cases it might be helpful to feel comfortable in a simple terminal. In this post I'm going to list some switches for the PHP command that you can use to get information and some utilities.

### Getting basic information about PHP

```

$ php -i

phpinfo()

PHP Version => 7.2.10-0ubuntu1

System => Linux awesome 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64

Build Date...

SPONSORS

SPONSORS