Yii Framework Forum: Trace Variable As Integer Strange Behaviour - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Trace Variable As Integer Strange Behaviour Rate Topic: -----

#1 User is offline   simonweb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 10-April 11
  • Location:London

Posted 16 January 2013 - 05:13 AM

Hi guys,

I'm trying to trace a variable in my code that is an integer and it appears to be logging it to the file as a different number.

Here is my logging route:

array(
    'class'=>'CFileLogRoute',
    'levels'=>'trace,error, warning, vardump',
),


And the code:

$chmod = 0777;
Yii::trace("---------------------- chmod: $chmod");


And this is the line in application.log that is appearing:

2013/01/16 10:07:19 [trace] [application] ---------------------- chmod: 511


The line should say 'chmod: 0777' as the variable has been set but for some reason its displaying '511'.

Operating system - Ubuntu 12.10 Desktop
Web server - Ubuntu 12.10 Desktop
Browser - All
Yii version - yii-1.1.12.b600af
My Yii powered websites:

0

#2 User is online   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,358
  • Joined: 12-October 09
  • Location:Croatia

Posted 16 January 2013 - 05:19 AM

0777 octal is 511 decimal

In PHP integers starting with 0 are considered in octal notation - http://php.net/manua...pes.integer.php
Find more about me.... btw. Do you know your WAN IP?
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users