This document discusses the inner workings of PHP including its architecture, core components like the lexer, parser, compiler and virtual machine. It covers key concepts like opcodes, variables as unions of C data types, and memory management. Understanding PHP internals like its stack and heap implementation, copy-on-write variables, and reference counting is important for optimizing performance and avoiding memory leaks. Resources and objects also have important internal representations that developers should be aware of.
PHP is one of the most popular open source programming languages in the world. It powers some of the highest traffic sites in the world, and at the same time it powers some of the lowest traffic sites in the world. But have you ever wondered how it works under the hood? Have you been overwelmed by the thought of looking at the C code that runs PHP? Well, this talk is for you!
We're going to explore how PHP works under the hood, by looking at a PHP implementation of it: PHPPHP! Have you ever wondered what an OPCODE Cache is really doing? Have you ever wondered what a T_PAAMAYIM_NEKUDOTAYIM is? Have you ever wondered why an interpreted languages has a compiler? We'll explore all of these topics, and more! And the best part of it all? You don't need to know C to understand the details! Using PHPPHP, we can explore the language details in a high level language, where things like memory management don't get in the way of the real content. If you've ever wanted to know how PHP works, this is the talk for you!
PHP is one of the most popular open source programming languages in the world. It powers some of the highest traffic sites in the world, and at the same time it powers some of the lowest traffic sites in the world. But have you ever wondered how it works under the hood? Have you been overwelmed by the thought of looking at the C code that runs PHP? Well, this talk is for you!
We're going to explore how PHP works under the hood, by looking at a PHP implementation of it: PHPPHP! Have you ever wondered what an OPCODE Cache is really doing? Have you ever wondered what a T_PAAMAYIM_NEKUDOTAYIM is? Have you ever wondered why an interpreted languages has a compiler? We'll explore all of these topics, and more! And the best part of it all? You don't need to know C to understand the details! Using PHPPHP, we can explore the language details in a high level language, where things like memory management don't get in the way of the real content. If you've ever wanted to know how PHP works, this is the talk for you!
This is the fourteenth (and last for now) set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
PECL Picks - Extensions to make your life betterZendCon
One of the biggest strengths of PHP is its "glue" power. Take any C library and with a little magic and a compiler you have a fantastic extension. These extensions hide in PECL, but few people can tell the good from the unmaintained or just plain broken. Find the best extensions for your project, learn about PECL, and find out how to become a part of the PECL developer community.
This is the first set of slightly updated slides from a Perl programming course that I held some years ago for the QA team of a big international company.
I want to share it with everyone looking for intransitive Perl-knowledge.
The updates after 1st of June 2014 are made with the kind support of Chain Solutions (http://chainsolutions.net/)
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
This is the fourteenth (and last for now) set of slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
PECL Picks - Extensions to make your life betterZendCon
One of the biggest strengths of PHP is its "glue" power. Take any C library and with a little magic and a compiler you have a fantastic extension. These extensions hide in PECL, but few people can tell the good from the unmaintained or just plain broken. Find the best extensions for your project, learn about PECL, and find out how to become a part of the PECL developer community.
This is the first set of slightly updated slides from a Perl programming course that I held some years ago for the QA team of a big international company.
I want to share it with everyone looking for intransitive Perl-knowledge.
The updates after 1st of June 2014 are made with the kind support of Chain Solutions (http://chainsolutions.net/)
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
Using AutoIt for Millennium Task Automation HandoutBecky Yoose
Handout to IUG presentation, 4/20/10.
Description: Side one: List of questions to keep in mind while looking for an automation tool. Also contains several automation products, with cost and web address. Side two: Summary of some of the uses of AutoIt at Miami University Libraries. Includes links to screencasts, scripts, and documentation.
Event sourcing w pigułce czyli podróże w czasie i odporność na coraz to bardziej kreatywne wymagania biznesowe. Kiedy, jak i po co tworzyć naturalny log wydarzeń Twojej aplikacji - plusy i minusy wzorca, przykłady implementacji, event sourcing a CQRS.
We train the candidates who are excited in doing PHP training in Chandigarh so that we could appoint them in our own organization or constitution them with other associated companies. We provide PHP industrial training in Chandigarh to B.Tech, MCA & diploma candidates as well as providing one year course for website designing and development.
https://youtu.be/rT7qVmQpfJg
https://github.com/utmgdsc/2023-c-workshop
C Workshop
Sam Chan on February 24, 2023
CSC108 level of knowledge required, CSC148 basics recommended
Friday 24th, 5pm
What you’ll learn:
* C vs. Python: what are the main diffs?
* Structs, typedefs and pointers
* Manual memory management
* What can go wrong (segfaults, UB)
* Stack and heap
* Memory management best practices (malloc, free)
our application is great – and popular. You have translation efforts underway, everything is going well – and wait a minute, what’s the report of strange question mark characters all over the page? Unicode is pain. UTF-32, UTF-16, UTF-8 and then something else is thrown in the mix … Multibyte and codepoints, it all sounds like greek. But it doesn’t have to be so scary. PHP support for Unicode has been improving, even without native unicode string support. Learn the basics of unicode is and how it works, why you would add support for it in your application, how to deal with issues, and the pain points of implementation.
How to train the next generation of Masters One of the best ways to move yourself forward as a developer is to have mentors who can help improve your skills, or to be a mentor for a newer developer. Mentoring isn’t limited to just ‘hard’ or technical skills, and a mentoring relationships can help in all aspects of any career – be it open source, a day job, or something else entirely. Learn some skills and tips from people who make mentoring an important aspect of their lives. From how to choose a mentor and what you should expect from a relationship as a padawan, to how to deal with the trials and successes of the person you are mentoring as they grow in their career. Also learn about setting up mentorship organizations, from the kind inside a company to one purely for the good of a community.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
5. SAPIS
Server API
CLI, CGI, mod_php, phpdbg, embed
input args
output, flushing, file descriptors, interruptions, system user info
input filtering and optionally headers, post data, http specific stuff
6. Extensions
Talk to a C library
do stuff faster then PHP
make the engine funny
8. Who Cares?
Pick the right SAPI
Fewer extensions = better
Static extensions = better
Lifecycle is important for sharing stuff
Newer PHP = better faster stronger
9. turn on the “go_fast” ini setting
Thread, fork, async, very wow
10. Threading
Thread Safe != reentrant
Thread safe != parallel
Thread safe != async
Thread safe != concurrent
Thread safe == two threads running at the same time won’t stomp on the others data
yes really, that’s all it means
11. Reentrant
Let’s quit this, and run it again
and it will be like we never ran it
12. Async
I’m gonna work on this stuff
But I’m not going to block you if you have important stuff to do
13. Parallel … Concurrent
Concurrent – two things at the same time that need communication
Parallel – two things at the same time
14. TSRM
Thread safe resource manager
global data in extensions
making some C re-entrant
thread safety
15. Why do I care?
react-php (parallel)
pecl event (async)
pthreads (concurrent)
pcntl (fork and pray)
proc_open/popen (subprocessing)
queues and jobs and workers
native tls rfc
16. Welcome to the Engine
Lexers and Parsers and Opcodes OH MY!
17. Lexer
checks PHP’s spelling
turns into tokens
see token_get_all for what PHP sees
26. Numbers
Booleans are unsigned char
Integers are really signed long integers
Longs are platform dependent
Floats and doubles are doubles not floats
27. 64 Bit Madness
LLP64
short = 16
int = 32
long = 32
long long = 64
pointer = 64
(windows)
LP64
short = 16
integer = 32
long = 64
long long = 64
pointer = 64
(unices)
28. Strings
Char *
Translated to what we see by an algorithm
ASCII, UTF8, binary – EVERYTHING has a codepage
wchar? screw you
32. Why do I care?
Know the limitations of your data types
Remember that arrays aren’t arrays
Beware of many many resources
Beware of many many objects
64 bit can be broken in strange ways
34. Stack? Heap?
Stack = scratch space for thread of execution
can overflow!
slightly faster
size determined at thread start
Heap = space for dynamic allocation
managed by program
can fragment
leaky!
35. Zend Memory Manager
Internal Heap Allocator
frees yo memory (leak management)
preallocates blocks in set sizes that PHP uses
caches allocations to avoid fragmentation
allows monitoring of memory usage
36. COW (not moo)
Copy On Write
1 zval, many variables
each variable increases refcount
destroy after refcount
Oh no, a change! copy
37. Refcounts, GC, and PHPNG
Sometimes you have a refcount but no var to reference it
This is a circular reference, this sucks (ask doctrine)
GC checks for this periodically and cleans up
PHPNG
38. References are not Pointers
PHP is smarter than you are
access the same variable content by different names
using symbol table aliases
variable name != variable content
39. Side Track – Objects are not References
$a = new stdClass;
$b = $a;
$a->foo = 'bar';
var_dump($b);
$a = 'baz';
var_dump($b);
40. Places to Learn More
http://www.phpinternalsbook.com
http://php.net
http://lxr.php.net
http://wiki.php.net
http://nikic.github.io/
http://blog.krakjoe.ninja/
41. About Me
http://emsmith.net
@auroraeosrose
That’s Aurora Eos Rose
auroraeosrose@gmail.com
freenode in #phpmentoring #phpwomen #phpinternals
Editor's Notes
story of how I got into internals in the first place
and how each new discovery (extensions, sapis, engine, oh look now I can do it all) led down the alice rabbit hole
but it also made me a better PHP programmer
because I knew all the WTFs
So PHP does the architecture of it’s system right – it’s as big as it needs to be, and no bigger – but all the important components are pluggable and extendable which makes it awesome glue
take a side track about learning more about programming and how down or up the stack is usually more valuable in general than going across stacks
well talk more about this later, but this is the part that actually looks at and analyzes your source code
and makes it actually like – talk to your cpu and run
yes, this isn’t really different from say c# or java – the difference is WHAT it compiles to
C compiles to machine code your system can immediately use
c# goes to msil which is run on their runtime
java gotes to bytecode that runs on the java vm
smarty compiles a template to a (horrible) php file
so the core functionality of PHP (in main) is kind of a mishmash – but generally it’s IO
the php manual lies though – if you look up “core” functionality what is actually IN core is not nearly so much
instead what you’re seeing is extensions you can’t “turn off” – well you can if you’re nuts
try it sometime, PHP is really boring without it’s “standard lib”
SAPIs provide the glue for interfacing PHP into an application. They define the ways in which data is passed between an application and PHP
this is really what sets PHP apart
this can also make or break you if you choose poorly
a lot of sapi choice is dictated by server choice, although most have gone to fastcgi at this point, which although it’s an old protocol it works well and is stable and “shared nothing”
for example python invented it’s own interface (wsgi) which requires a separate server that talks something your server actually talks (fastcgi, scgi) instead of using a pluggable model
there are those that whine that PHP doesn’t have this “middleware” – it’s actually easily doable though – you could do a dedicated sapi or just use the embedded sapi
sapis take care of setting up interpreter context, dealing optionally with headers and input args (don’t need to do anything, it’s entirely optional, if you want yur PHP code itself needed work)
we could use more sapis! people run away from writing these which is sad – I recruit – have a list of ones I’d love to mentor you into writing
almost everything is an extension
there are two types, regular and “zend” extensions
zend extensions can “hook” engine behavior using opcodes
99.9% of the functionality you use comes from this
SO – threading makes this a little weird – because MINIT is not run in new threads
so ginit is called right before rinit if ZTS is on (annoying)
so why is it important to know this stuff
you need to know what extensions are available
why you would compile your own PHP with all static extensions
sharing can be limited when requests aren’t shared
This is going to annoy some people because they go on and on about how PHP is “thread safe” – but really it’s not
it’s kind of almost able to be threaded when compiled right most of the time
others blame things on libraries
no – no there are some very bad things in core that totally prevent this
ah “thread safety”
Parallelism is the act of taking a large job, splitting it up into smaller ones, and doing them at once. People often use "parallel" and "concurrent" interchangably, but there is a subtle difference. Concurrency is necessary for parallelism but not the other way around. If I alternate between cooking eggs and pancakes I'm doing both concurrently. If I'm cooking eggs while you are cooking pancakes, we are cooking concurrently and in parallel. Technically if I'm cooking eggs and you are mowing the lawn we are also working in parallel, but since no coordination is needed in that case there's nothing to talk about.
talk about what each of these means
Lexical Analysis
Converts the source from a
sequence of characters
into a
sequence of tokens
Syntax Analysis
Analyzes a
sequence of tokens
to determine their
grammaticalstructure
5.6 and 7+
Generate
bytecode
based on the information gathered byanalyzing the
sourcecode
abstract syntax tree – decouples compiler and parser steps – even though we compile to opcode, it’s still a compile
before php7 we emit opcodes directrly from parsing (a bit eww) now we can do better, cooler stuff
so zend is actually a “virtual machine”
it interprets OPCODES and does stuff with them
reads each opcode and does a specific action – like a giant state machine
underlying it all PHP just has some basic types
every zval stores some value and the type this value has
A union defines multiple members of different types, but only one of them can ever be used at a time
unions store all their members at the same memory location and just interpret the value located there differently depending on which member you access. The size of the union is the size of its largest member
so why do we care that this is how PHP stores stuff? at the end of the day those are actual C types underneath we’re just “mapping” to with many of the conversion rules that go along with it
char = smallest addressable unit of the machine
IEEE 754 single-precision binary floating-point format = float
IEEE 754 double-precision binary floating-point format = double
this is more precision – but remember to use gmp for real math
The disadvantage of the LP64 model is that storing a long into an int may overflow
converting a pointer to a long will “work” in LP64
useful for – the lazy
LLP64 is generally the “safer” route – you can’t convert a pointer to a long (WTF WOULD YOU?) and a long to an int won’t overflow (BC considerations) therefore logical choice for windows
handling of strings >= 2^31
handling of 64 bit integers
large file support
handling of numeric 64 bit hash keys
Fixed in PHP7
null terminated array of chars
Another way of accessing a contiguous chunk of memory, instead of with an array, is with a pointer.
the character array containing the string must already exist (having been either statically- or dynamically-allocated)
C is a programming language that was developed in an environment where the dominant character set was the 7-bit ASCII code. Hence since then the 8-bit byte is the most common unit of encoding. However when a software is developed for an international purpose, it has to be able to represent different characters. For example character encoding schemes to represent the Indian, Chinese, Japanese writing systems should be available. The inconvenience of handling such varied multibyte characters can be eliminated by using characters that are simply a uniform number of bytes. ANSI C provides a type that allows manipulation of variable width characters as uniform sized data objects called wide character
story of Microsoft’s early adoption, utf8 on a napkin
Arrays in C are just regions of memory that can be accessed by offset
offsets must be continuous integers
complex key becomes integer via hash function
for hash collisions – PHP stores all the items with the same hash in a linked list
so – advantage of resources is they’re smaller than objecst in php
disadvantages are very numerous
they’re slow – depending on what you’re doing much slower than objects
they’re limited – you can literally run out of resources,
and they get shove in a giant list in the executor
no seriously
this is why they suck
sadpanda
like resources, these are stored in executor globals
like resources eventually some day you might run out
but you can sure do a lot more with them
store opaque data, deal with opaque data, etc
The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data. When that function returns, the block becomes unused and can be used the next time a function is called. The stack is always reserved in a LIFO (last in first out) order; the most recently reserved block is always the next block to be freed. This makes it really simple to keep track of the stack; freeing a block from the stack is nothing more than adjusting one pointer.
The heap is memory set aside for dynamic allocation. Unlike the stack, there's no enforced pattern to the allocation and deallocation of blocks from the heap; you can allocate a block at any time and free it at any time. This makes it much more complex to keep track of which parts of the heap are allocated or free at any given time; there are many custom heap allocators available to tune heap performance for different usage patterns.
Each thread gets a stack, while there's
typically only one heap for the application (although it isn't uncommon to have multiple heaps for different types of allocation).
things get crazy when you add dynamically loaded modules – they may have their OWN heap
fewer calls to malloc – less cpu usage, less kernel madness
less fragmentation
LIBRARIES do not use it!
you can turn it off, but 99.9% of the time it’s better with it
The behavior is very straightforward: When a reference is added, increment the refcount, if a reference is removed, decrement it. If the refcount reaches 0, the zval is destroyed.
All values in existing Zend Engine implementation were allocated on heap and they were subject for reference counting and garbage collection. Zend engine mostly operated by pointers to zvals
phpng stores data in a totally different wayand even though I saw an interesting talk on it at zendcon I’m stillw rapping my head around the code
basically it seperates scalar from non-scalar and uses flags to give it information (type, etc)
Assigning values by references when you don't need to (in order to later modify the original value through a different label) is NOT a case of you outsmarting the silly engine and gaining speed and performance. It's the opposite, it's you TRYING to outsmart the engine and failing, because the engine is already doing a better job than you think.
in other words, references are basically useful for – digging into internal nested arrays and input/output parameters – that’s about it
objects do behave in a references
but remember a variable that is assigned to an object just holds a pointer to the actual value of the object – which is elsewhere
if you later assign that