Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Reference Passing in PHP
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Tamal Saha
March 05, 2017
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reference Passing in PHP
Tamal Saha
March 05, 2017
More Decks by Tamal Saha
See All by Tamal Saha
Kubernetes application packaging from first principles
tamalsaha
0
8.4k
OverHelmed: Experience of a Helm chart publisher and consumer
tamalsaha
2
1.8k
Other Decks in Programming
See All in Programming
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
JIS keyboard support in Omarchy
lef237
0
120
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
sbt 2.0: takeoff
eed3si9n
0
160
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
Test your architecture with Archunit
thirion
2
2.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
The Pragmatic Product Professional
lauravandoore
37
7.5k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Optimising Largest Contentful Paint
csswizardry
37
4k
Transcript
Reference Passing in PHP Tamal Saha
Pass Scalar Types by Reference
Pass Scalar Types by Reference 5 5 <?php $instance =
5; $assigned = $instance; $referenced =& $instance; $instance $assigned $referenced
Pass Scalar Types by Reference 10 5 <?php $instance =
5; $assigned = $instance; $referenced =& $instance; $instance = 10; $instance $assigned $referenced
Pass Scalar Types by Reference null 5 <?php $instance =
5; $assigned = $instance; $referenced =& $instance; $instance = 10; $instance = null; $instance $assigned $referenced
Pass Scalar Types by Reference null 5 <?php $instance =
5; $assigned = $instance; $referenced =& $instance; $instance = 10; $instance = null; echo '$instance = '; var_dump($instance); echo "\n", '$assigned = '; var_dump($assigned); echo "\n", '$referenced = '; var_dump($referenced); $instance $assigned $referenced
Pass Objects by Reference
Pass Objects by Reference obj-id obj-id <?php class SimpleClass {
public $deviceToken = 'original'; } $instance = new SimpleClass(); $assigned = $instance; $referenced =& $instance; $instance $assigned $referenced deviceToken: original
Pass Objects by Reference obj-id obj-id <?php class SimpleClass {
public $deviceToken = 'original'; } $instance = new SimpleClass(); $assigned = $instance; $referenced =& $instance; $instance->deviceToken = 'modified'; $instance $assigned $referenced deviceToken: modified
Pass Objects by Reference null obj-id <?php class SimpleClass {
public $deviceToken = 'original'; } $instance = new SimpleClass(); $assigned = $instance; $referenced =& $instance; $instance->deviceToken = 'modified'; $instance = null; $instance $assigned $referenced deviceToken: modified
Pass Objects by Reference null obj-id <?php class SimpleClass {
public $deviceToken = 'original'; } $instance = new SimpleClass(); $assigned = $instance; $referenced =& $instance; $instance->deviceToken = 'modified'; $instance = null; echo '$instance = '; var_dump($instance); echo "\n", '$assigned = '; var_dump($assigned); echo "\n", '$referenced = '; var_dump($referenced); $instance $assigned $referenced deviceToken: modified
Pass Array by Reference
Pass Array by Reference [0] = 1 [1] = 2
[0] = 1 [1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance $assigned $referenced
Pass Array by Reference [0] = 6 [1] = 2
[0] = 1 [1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance[0] = 6; $instance $assigned $referenced
Pass Array by Reference [0] = 6 [1] = 2
[2] = 3 [0] = 1 [1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance[0] = 6; array_push($instance, 3); $instance $assigned $referenced
Pass Array by Reference null null null [0] = 1
[1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance[0] = 6; array_push($instance, 3); $instance = null; $instance $assigned $referenced
Pass Array by Reference null null null [0] = 1
[1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance[0] = 6; array_push($instance, 3); $instance = null; $instance $assigned $referenced
Pass Array by Reference null null null [0] = 1
[1] = 2 <?php $instance = array(1, 2); $assigned = $instance; $referenced =& $instance; $instance[0] = 6; array_push($instance, 3); $instance = null; echo "\n", '$instance = '; var_dump($instance); echo "\n", '$assigned = '; var_dump($assigned); echo "\n", '$referenced = '; var_dump($referenced); $instance $assigned $referenced