Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nikita Popov:
PHP 7 Virtual Machine
Apr 17, 2017 @ 22:42:47

Nikita Popov has a new post to his site sharing a look behind the curtain of how the PHP 7 virtual machine works, the latest version in the Zend Virtual Machine that powers the language.

This article aims to provide an overview of the Zend Virtual Machine, as it is found in PHP 7. This is not a comprehensive description, but I try to cover most of the important parts, as well as some of the finer details.

This description targets PHP version 7.2 (currently in development), but nearly everything also applies to PHP 7.0/7.1. However, the differences to the PHP 5.x series VM are significant and I will generally not bother to draw parallels.

Most of this post will consider things at the level of instruction listings and only a few sections at the end deal with the actual C level implementation of the VM.

He then goes through many different points and piece of functionality in the VM and how they work including:

  • variable types
  • the stack frame layout
  • fetch modes
  • exception handling
  • finally handling
  • generators

There's lots of information here and it's definitely interesting to see what happens inside the language to create the fast and functional PHP 7 applications we have now.

tagged: virtualmachine php7 zend detail behindthescenes example

Link: http://nikic.github.io/2017/04/14/PHP-7-Virtual-machine.html

Mohamed Said:
The magic behind Laravel Valet
May 09, 2016 @ 15:34:19

One of the latest offerings in the Laravel ecosystem, Laravel Valet, was released this past week. It makes setup of new applications simpler and even allows tunneling back from the public web to a local system for easy sharing. In this post to his site Mohamed Said takes a look at the "magic" behind Valet and how it does what it does.

So yesterday Taylor Otwell and Adam Wathan released Laravel Valet, it's simply a tool that helps OS X users easily run their websites locally for development purposes, without the need to configure anything each time a new project needs to be created.

The idea behind valet is that it configures PHP's built-in web server to always run in the background when the operating system starts, then it proxies all requests to a given domain to point to your localhost 127.0.0.1

He starts by helping you get the tool downloaded (via Composer) and what happens when you run the valet install command. He gets into the detail of each piece that valet sets up:

  • the OS X daemon to run the PHP built-in server
  • the Valet configuration files
  • Dnsmasq (a DNS server)

He then talks about how handles the requests for your local ".dev" sites and the "drivers" it uses to decide which site to serve up.

tagged: laravel valet setup magic install behindthescenes daemon server dnsmasq

Link: http://themsaid.github.io/magic-behind-laravel-valet-20160506/

Jeff Madsen:
Eloquent Create, Update, New...the Untold Story 2016-04-01
Apr 06, 2016 @ 17:19:20

Jeff Madsen has a quick post to his site with the "untold story" behind Eloquent's save and create in the Laravel framework.

Over on Laravel Quick Tips we've been looking at a few of these functions and their uses, and I thought it might be helpful to collect all of them together in a single (I hope) coherent post.

Without further preamble, let's get to it. I'm going to use the basic User object and table that ships with a default installation of Laravel so you can follow along if you like.

He starts with the difference between "new" and "create", pointing out the one fundamental difference: one saves, one does not. He then looks at some of the other new/create functions (like findOrNew, firstOrCreate, updateOrCreate), what each of them does in the background and a quick snippet of code showing.

tagged: eloquent laravel create update new behindthescenes difference save

Link: http://codebyjeff.com/blog/2016/04/eloquent-create-update-new-the-untold-story

Thijs Feryn:
Making the PHPBenelux Conference happen
Feb 08, 2016 @ 19:20:05

If you've considered starting up a technical conference and wanted to get an inside look at what it takes, check out this recent post from Thijs Feryn about what it takes for the PHPBenelux organization to make the PHPBenelux Conference happen each year.

The PHPBenelux Conference edition 2016 took place last week in Antwerpen (Belgium). As an organizer, I’m really happy with the end result. I like to think that our attendees, speakers and sponsors also enjoyed it. It’s the 7th time we organize the PHPBenelux Conference and every year we try to introduce something new. Although the 7 years of experience and the well-organized crew have made it a lot easier to organize, it’s still a lot of work.

This post gives you a behind the scenes look at what it takes to organize the PHPBenelux Conference. It will reflect our passion, our strengths and our weaknesses.

The article covers what the conference is all about and what the name (PHPBenelux) represents. They also talk about some of the things that are important to them as an organization, the venus they've used for the past several years and some of the things that annoy them a bit about it. The article goes on to mention each of "the crew" behind the event, volunteers they have helping out and more about this year's event including the theme, how they handled sponsors and spending funds to make the event happen. They also cover one of the more fun things from this year's conference: the bumper cars from the speakers dinner.

Finally they end with a list of "lessons learned" and things they see they can do to help improve the event for years to come.

tagged: phpbenelux conference behindthescenes organizer lessons belgium

Link: https://blog.feryn.eu/making-the-phpbenelux-conference-happen/

Vertabelo.com:
ORMs under the hood
Aug 26, 2015 @ 14:55:01

The Vertabelo site has posted a tutorial that gives you an "under the hood" view of ORMs and what they're doing in the background to help make accessing your database information easier.

It often happens that if something is loved, it is also hated with the same power. The idea of object relational mapping fits into this concept perfectly. You will definitely come across many opposite points and fierce discussions as well as unwavering advocates and haters. So if you have ever asked whether to use ORM or not, the answer “it depends” will not be enough.

They start with a definition of an ORM to get everyone on the same page, highlighting how they represent database contents and what some of the benefits are in using them. From there the article talks about the importance of good SQL and a few common dangers in using an ORM and not knowing SQL. Then the article gets into how ORMs work and some of the common design patterns they can implement. It lists some of the more popular ORMs (for Python, Java and PHP) and covers some of the main disadvantages to their use. The article ends with examples of some of the libraries mentioned, highlighting the Propel ORM for the PHP world.

tagged: orm behindthescenes introduction advantages disadvantages types propel example

Link: http://www.vertabelo.com/blog/technical-articles/orms-under-the-hood

Julien Pauli:
Zoom on PHP objects and classes
Mar 26, 2015 @ 17:50:49

Julien Pauli has a recent post to his site that "zooms in" on objects and classes with a look behind the scenes at how they're handled in the PHP source (at the C level) with plenty of code examples and explanations as to how they work.

Everybody uses objects nowadays. Something that was not that easy to bet on when PHP5 got released 10 years ago (2005). I still remember this day, I wasn't involved in internals code yet, so I didn't know much things about how all this big machine could work. But I had to note at this time, when using this new release of the language, that jumps had been made compared to old PHP4. The major point advanced for PHP5 adoption was : "it has a new very powerful object model". That wasn't lies. [...] Here, I will show you as usual how all this stuff works internally. The goal is always the same : you understand and master what happens in the low level, to make a better usage of the language everyday.

The article does a great (if lengthy) job of covering everything that happens with PHP's objects and class system, including stats about memory consumption. He includes both the PHP code and the C code to illustrate what's happening with classes, interfaces, traits and object methods/attributes (including object references). He also talks about what "$this" is and how class destructors are handled.

tagged: object class behindthescenes detail c code memory usage

Link: http://jpauli.github.io/2015/03/24/zoom-on-php-objects.html

/Dev/Hell Podcast:
Episode 50: The Airing of Grievances
Sep 10, 2014 @ 17:05:02

The /Dev/Hell podcast has released their latest episode today - Episode #50: The Airing of Grievances hosted by PHP community members Chris Hartjes and Ed Finkler.

EPISODE FITTY!!!!! Learn the INSIDE SCOOP on THE ORIGINS OF DEVELOPMENT HELL! EXCLUSIVE BEHIND the SCENES ACCESS!!! WE SUMMARIZE HOW CRAPPY ALL THE EPISODES ARE!!! Also how Chris’ DNS got haxxored.

You can listen to this latest episode either through their in-page audio player or by downloading the mp3 (all 53MB of it). If you enjoy the show, be sure to subscribe to their feed to get this and more episodes as they're released.

tagged: devhell podcast ep50 airing grievances origins behindthescenes

Link: http://devhell.info/post/2014-09-09/the-airing-of-grievances/

Sherif Ramadan:
PHP OOP: Objects Under The Hood
Dec 04, 2012 @ 15:15:27

In another of his series looking "under the covers" at what actually happens in the PHP language during its use, Sharif Ramadan has posted this look at the object handling in PHP's OOP functionality.

I would love to take a good long look under the hood at just how PHP objects and classes do the work that they do, and hope that you could benefit from that knowledge. [There are] many questions that come across my desk, on a regular basis, from developers and beginner PHP enthusiasts that I’ve worked with over the years, and are some of the key points this article attempts to help you answer.

He talks about classes "giving birth" to objects, how they're stored internal to PHP and how they provide the "blueprints" for it to lay out the storage of the object's data. He talks about using identifiers for variable/property access, object handlers and how "$this" fits into all of it. He notes that OOP, while a major part of PHP now, wasn't in the initial versions (until around PHP4). He finishes off the post talking about lateral/vertical context switching, the lifecycle of an object and the "early binding problem" and class scope.

tagged: oop language class object detail lowlevel behindthescenes

Link:

Ibuildings Blog:
Off-The-Shelf Server Setup
May 30, 2008 @ 13:43:28

On the Ibuildings blog, Ian Barber has a reminder to PHP developers out there used to their servers "just working" because of the popularity of LAMP. He recommends digging a little deeper to the "behind the scenes" of how the server is configured.

PHP programmers generally know what a good systems architecture should look like, but it is often a reality of development that they will have little input on the system itself until the last minute. In fact, it's far from uncommon for a developer to be faced with an off-the-shelf dedicated LAMP server, and left up to their own devices.

He recommends getting to know things like the package manager for your distribution (apt, yum, yast, etc), stripping down the modules your installation is using, check that all of the packages in use need to be enabled and ensure that the network connection is set up correctly and is what you need for the site.

tagged: oftheshelf default installation configuration behindthescenes lamp server

Link:


Trending Topics: