Grow as a Team
Grow as Individuals
Learn Together
Have fun doing it
🧐
🎉
🏋️♂️
🙌
Geekin' Out With
Josh
Cummings
1. Kids would fill out the form
2. The data (and picture) were stored in a sqlite database file
3. The file was brought back to the office and opened in the Viewer application
4. The Viewer opened the entire database so the person could easily find what they were looking for
It had only one problem...
The more successful they were the slower it ran, ultimately crashing the computer and corrupting the database...
<?php
$bool = true;
$small = 0;
$big = PHP_MAX_INT;
$text = 'Learning about memory!';
$array = [
'getting', 'more', 'complicated'
];
$associative = [
'how' => 'does', 'this' => 'even', 'work?'
];
$object = new StdClass();
$object->exists = true;
$object->answer = 42;
PHP & JS are Dynamically Typed Languges
Storage & Memory Terms
Bit
Byte
Double / Word
Quadrupal / Paragraph
Check out this old thing!
Object Variable
Object
Pointer #1
Pointer #2
Pointer #3
Pointer #4
Integer
String
Boolean
Object
Pointer #1
Pointer #2
Garbage Collection!
<?php
$data = 'Hey there'; // 1
$greeting = $data; // 2
unset($data); // 1
unset($greeting); // 0 - collect
function circularReasoning() {
const x = {};
const y = {};
x.badIdea = y;
y.badIdea = x;
}
circularReasoning();
Variables take up memory. Memory is finite.
The device running your app probably has less memory than your machine.
Memory is fast, so use it, but be conscious of how it's being loaded and dumped
Avoid circular references in your code
Objects are strange birds — all references point to the same memory
Failure is not the end of the world. Live and learn.
With
Kyle Johnson