|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-29 07:03 UTC] php at bicou dot com
Property with a negative integer default value is not correctly initialized :
<?php
class TestNeg {
var $v = -10;
}
$tn = new TestNeg;
echo $tn->v;
?>
outputs '0' instead of '-10'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
A function with negative integer default value would have the same problem. <?php function test($var = -1) { echo $var; } test(); ?> And the output is 0. not bug?