PHP UK Conference 2012 - PHP under the hood, by Johannes Schlüter

PHP UK Conference · 4K views · 2012 · 48:31

Open on YouTube

Python, Ruby & scripting languagesCompilers, interpreters & program analysisWeb developmenttalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about how PHP arrays, references, object passing and shutdown behave internally.

Recommended by 2 people across 6 different months, 2012 to 2014.

What it is

A conference talk from PHP UK Conference 2012 in which PHP core contributor Johannes Schlüter explains how the PHP runtime works internally without requiring the audience to read C. It covers HashTables (the basis of PHP arrays), reference counting, object handles and the executor.

What people said

Recommends tereško · 2012-04 · Stack Overflow · on “What are Arrays in PHP”

In php arrays are not arrays. If you really want to know how this whole thing works, i would recommend for you to watch this presentations: PHP UK Conference 2012 - PHP under the hood, by Johannes Schlüter [this video] . Also, as @RepWhoringPeeHaa mentioned : use var_dump() [LINK] .

Recommends tereško · 2012-05 · Stack Overflow · on “Where can I learn about PHP internals?”

Another lecture on "how does it work" theme: PHP UK Conference 2012 playlist [LINK] - PHP under the hood [this video] slides [LINK] , by Johannes Schlüter

Recommends tereško · 2012-09 · Stack Overflow · on “My object contains multiple instances of itself, should I be concerned?”

**-1** : **wrong**. Since PHP5 objects are passed around by object handlers. Please watch [this video] for additional details.

Recommends hakre · 2013-05 · Stack Overflow · on “Making $_SESSION available in controllers”

`$_SESSION` is a superglobal, so it is available *everywhere*. And for the shutdown phase, superglobals are killed within, sessions sometime in there closed. There is a nice talk by Johannes Schlüter, see PHP Shutdown Sequence [this video] ca. 25:50

Recommends tereško · 2013-08 · Stack Overflow · on “Access and change a variable in model class in Codeigniter”

Actually, there is one more outdated thing, that is not present in your example, but is all over CodeIgniter's code: assigning object by reference. Use of `$CI =& get_instance()` (or similar assignments of objects by reference) is considered outdated, and in PHP 5.x will potentially cause memory leaks, because it messes with recounting. See this lecture [this video] for more information.

Recommends tereško · 2013-09 · Stack Overflow · on “Efficiently use mysqli in object oriented setting”

@Hossam , you might find this [LINK] and this [this video] video useful then. I would also recommend for you to watch this [LINK] lecture.

Recommends tereško · 2013-09 · Stack Overflow · on “Pass PDO connection objects by reference?”

I would say that the same basic solution applies to all case when you want to share an object between multiple instances. Also, please not that object in PHP 5.0+ are not passed around by references (for more info on that please see this [LINK] and this [this video] video).

Cites johannes · 2014-05 · Stack Overflow · on “Pass non-existing array element to function”

This is a famous video of me explaining some things about references: [this video] thoae are commonky quoted ted blog articles by me: [LINK] and [LINK] (sorry - server issues break layout)