Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20678 invoked by uid 1010); 9 Dec 2006 20:06:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20663 invoked from network); 9 Dec 2006 20:06:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2006 20:06:10 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2843] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/B5-50161-7171B754 for ; Sat, 09 Dec 2006 15:05:43 -0500 Received: (qmail 67090 invoked by uid 98); 9 Dec 2006 20:05:42 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 (clamdscan: 0.88.4/2311. Clear:RC:1(127.0.0.1):. Processed in 0.072704 secs); 09 Dec 2006 20:05:42 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.072704 secs) Received: from unknown (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 9 Dec 2006 20:05:42 -0000 Received: from 209.254.223.2 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Sat, 9 Dec 2006 14:05:42 -0600 (CST) Message-ID: <61701.209.254.223.2.1165694742.squirrel@www.l-i-e.com> In-Reply-To: <1C.0F.15259.4AAD5754@pb1.pair.com> References: <1C.0F.15259.4AAD5754@pb1.pair.com> Date: Sat, 9 Dec 2006 14:05:42 -0600 (CST) To: "Corne" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] variable types From: ceo@l-i-e.com ("Richard Lynch") Rather than re-designing the language, you might want to begin using: http://php.net/assert in your code... Just giving you an option you may have missed -- Not claiming you're "wrong" On Tue, December 5, 2006 2:45 pm, Corne wrote: > Hi, > > I was trying to make PHP a bit more type-safe, but until now without > success. > I just want to do this for local testing, it's not important but it > would be > nice if it would work somehow.. > Are there more people who tried this? > What I want is the following: > If you have a variable in you php code than it is typeless, for > example you > could do the following: > $var = 'test'; > $var = 1; > It would be nice for me if I can make it possible that if you used a > string > in a variable, and after that use an integer (for example) that PHP > then > gives a warning. > It would be even better if it is possible to force declaration of a > variable > with a type (something like int $varname), and than offcourse the > error if > you try to put something else inside.. > > This is the fist time I look in the source code of PHP, so I don't > have a > clue where to look for this or if it is even possible (without going > through > thousands of files).. > Does anybody know if it is possible at all, and if so where to look > for > this? > > Thanks, > Corne > > Ps. I'm sorry if my English isn't that great, it's not my native > language. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?