Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26806 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14007 invoked by uid 1010); 5 Dec 2006 21:00:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13975 invoked from network); 5 Dec 2006 21:00:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2006 21:00:31 -0000 Received: from [127.0.0.1] ([127.0.0.1:12784]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 59/5F-15259-EEDD5754 for ; Tue, 05 Dec 2006 16:00:30 -0500 X-Host-Fingerprint: 84.31.220.58 cp11553-a.tilbu1.nb.home.nl Received: from [84.31.220.58] ([84.31.220.58:10297] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/0F-15259-4AAD5754 for ; Tue, 05 Dec 2006 15:47:03 -0500 Message-ID: <1C.0F.15259.4AAD5754@pb1.pair.com> To: internals@lists.php.net Date: Tue, 5 Dec 2006 21:45:21 +0100 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-RFC2646: Format=Flowed; Original X-Posted-By: 84.31.220.58 Subject: variable types From: corne-dickens@home.nl ("Corne") 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.