---
title: "I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?"  
description: "I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?"  
author: "Anonymous User"  
published: 2011-06-13  
updated: 2020-09-17  
canonical: https://www.mindstick.com/interview/1041/i-am-trying-to-assign-a-variable-the-value-of-0123-but-it-keeps-coming-up-with-a-different-number-what-s-the-problem  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

PHP Interpreter treats numbers beginning with 0 as octal. Thats why you will get different output.

## Answers

### Answer by Anonymous User

PHP Interpreter treats numbers beginning with 0 as octal. Thats why you will get different output.


---

Original Source: https://www.mindstick.com/interview/1041/i-am-trying-to-assign-a-variable-the-value-of-0123-but-it-keeps-coming-up-with-a-different-number-what-s-the-problem

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
