---
title: "How do you pass a variable by value?"  
description: "How do you pass a variable by value?"  
author: "Anonymous User"  
published: 2011-11-04  
updated: 2020-09-17  
canonical: https://www.mindstick.com/interview/1320/how-do-you-pass-a-variable-by-value  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# How do you pass a variable by value?

Just like in C++, put an ampersand(&) in front of it, like $a = &$b

## Answers

### Answer by Anonymous User

Just like in C++, put an ampersand(&) in front of it, like $a = &$b


---

Original Source: https://www.mindstick.com/interview/1320/how-do-you-pass-a-variable-by-value

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
