#36174 [Opn->WFx]: PHP 5 should treat 'var' as 'public'

From: Date: Thu, 26 Jan 2006 23:39:32 +0000
Subject: #36174 [Opn->WFx]: PHP 5 should treat 'var' as 'public'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92533@lists.php.net to get a copy of this message
ID: 36174 Updated by: derick@php.net Reported By: mike at scrapegoat dot com -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: any PHP Version: 5.1.2 New Comment: It's just an E_STRICT warning which you very easily can turn off. Previous Comments: ------------------------------------------------------------------------ [2006-01-26 23:18:30] mike at scrapegoat dot com You have got to be kidding! This was declined?!?! I have a HUGE codebase that I need to maintain in both PHP4 and PHP5. In almost all cases the ONLY difference I have is the fact that I must change 'var' to 'public' and back again. So what you are telling me is that I MUST maintain 2 sets of code when the only difference is var and public? I have to make code fixed in TWO sets of code because you don't want to provide a USEFULL correction to the language? What a joke! This is such a simple thing to add. All it needs to be is an alias and then my code and hundreds if not thousands of developers lives would be eaiser and conversion from PHP4 to PHP5 would be more enticing to others. PLEASE!!!! Please rethink this. This is such a small change and will have such a HUGE impact on developers!!! ------------------------------------------------------------------------ [2006-01-26 22:50:13] helly@php.net That was discussed enough and declined ------------------------------------------------------------------------ [2006-01-26 22:30:17] mike at scrapegoat dot com Description: ------------ I am amazed that PHP5 does not treat 'var' as if it was the same 'public'. I am so sick of trying to maintain two sets of code for PHP4 and PHP5 all because PHP4 uses 'var' in my classes and PHP5 wants 'public', 'private' or 'protected' I would love to see 'var' be treated an alias for 'public' Reproduce code: --------------- class test { var $info; function test( $info ) { $this->info = $info; } } Expected result: ---------------- This should be the same as: class test { public $info; function test( $info ) { $this->info = $info; } } Actual result: -------------- error/exception is thrown ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36174&edit=1

« previous php.bugs (#92533) next »