Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:41952 php.internals:41953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36789 invoked from network); 16 Nov 2008 14:16:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2008 14:16:15 -0000 X-Host-Fingerprint: 61.50.134.238 unknown Received: from [61.50.134.238] ([61.50.134.238:15248] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/74-13764-D2B20294 for ; Sun, 16 Nov 2008 09:16:13 -0500 To: internals@lists.php.net,=?UTF-8?B?Ik0uIEthcnBlbMOocyI=?= Message-ID: <49202B23.4070100@gmail.com> Date: Sun, 16 Nov 2008 22:16:03 +0800 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 CC: internals@lists.php.net References: <56.41.13764.40D10294@pb1.pair.com> <1226841630.14940.26.camel@localhost> <492021AB.9040106@gmail.com> <1226843472.14940.39.camel@localhost> In-Reply-To: <1226843472.14940.39.camel@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 61.50.134.238 Subject: Re: [PHP-DEV] Can someone explain me why this happens please? From: jiangcat@gmail.com (Chris Jiang) Ok, I see. Thank you all for replying. I guess there are a lot to be learned for me now. I'm actually trying to learn C and put it in use of writing PHP extensions. Because from years of working with PHP, I start to feel that PHP might be a bit weak for performance sensitive tasks. Well, it's a long way ahead, and I'd better get going now. Thanks again for the help, and I'll send more 'spam' if I've got problem with PHP and Zend in the future. :D M. Karpelès 写道: > Le dimanche 16 novembre 2008 à 21:35 +0800, Chris Jiang a écrit : >> Still, this is a really strange experience. Where are those characters >> come from? Shouldn't it be a clean array when I first created them? >> Anything related to the zval structure? > > This is not PHP-related. When you *define* a variable, it has no > content, you have to initialize it. The characters you got are from the > uninitialized space you used in the stack. > > C won't initialize variables for you as it would be a waste of time in > the case you already initialize it with a non-NULL value. > > Anyway as this is not PHP-related, I suggest this discussion to be > continued outside of the PHP internals mailing list, if you have any > question, I can probably give you some pointers to good documentation, > just need to understand what you are trying to do. > > > Best regards, > Mark >