Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24167 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75851 invoked by uid 1010); 20 Jun 2006 23:45:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75835 invoked from network); 20 Jun 2006 23:45:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2006 23:45:02 -0000 X-PHP-List-Original-Sender: david@tulloh.id.au X-Host-Fingerprint: 202.138.0.110 stiletto.hotkey.net.au Linux 2.5 (sometimes 2.4) (4) Received: from ([202.138.0.110:38545] helo=stiletto.hotkey.net.au) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 58/A0-25433-C7888944 for ; Tue, 20 Jun 2006 19:45:02 -0400 Received: from stiletto.hotkey.net.au (stiletto [127.0.0.1]) by stiletto.hotkey.net.au (Postfix) with ESMTP id 1100C3629; Wed, 21 Jun 2006 09:45:08 +1000 (EST) Received: from [192.168.0.200] (81.146-142-203.dart.iprimus.net.au [203.142.146.81]) by stiletto.hotkey.net.au (Postfix) with ESMTP id B9B673230; Wed, 21 Jun 2006 09:45:07 +1000 (EST) Message-ID: <44988882.6070009@tulloh.id.au> Date: Wed, 21 Jun 2006 09:45:06 +1000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050325 X-Accept-Language: en, en-us MIME-Version: 1.0 To: lists@block-online.eu Cc: internals@lists.php.net References: <200606210111.12187.lists@block-online.eu> In-Reply-To: <200606210111.12187.lists@block-online.eu> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Hotkey Virus Scan Subject: Re: [PHP-DEV] Looking for an explanation From: david@tulloh.id.au (David Tulloh) Oliver Block wrote: > Hello list, > > as you are familiar with the source code of php it might be easy to explain > how the brain of php interprets the following code: I think that this would be better suited to the startard PHP list. I would suggest posting any further followups there. > > print ($life = "hard") -1; ($life="hard") assigns "hard" to $life and returns "hard" "hard" -1 casts "hard" to an integer to do a math operation, "hard" casts to 0 0 -1 is -1, so -1 is printed > print "\nlife: {$life}\n"; Now you simply print the value of $life, "hard" David