#38160 [NEW]: var is no longer raising E_STRICT

From: Date: Thu, 20 Jul 2006 14:13:41 +0000
Subject: #38160 [NEW]: var is no longer raising E_STRICT
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373544@lists.php.net to get a copy of this message
From: RQuadling at GMail dot com Operating system: Windows XP SP2 PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: var is no longer raising E_STRICT Description: ------------ The dox say ..."The PHP 4 method of declaring a variable with the var keyword is no longer valid for PHP 5 objects. For compatibility a variable declared in php will be assumed with public visibility, and a E_STRICT warning will be issued." The following code would expect to generate the appropriate warning ... Reproduce code: --------------- <?php class myc_class { var $ttt; public $pub; protected $prot; private $priv; public function __construct() { $this->ttt = 1; } public function test() { echo "$this->ttt\n"; } } $x = new myc_class(); $x->test(); var_dump($x); // Prove E_STRICT is working. echo mktime(); ?> Expected result: ---------------- An E_STRICT warning about var being public. E_STRICT is active within php.ini as mktime() generates this message. Actual result: -------------- 1 object(myc_class)#1 (4) { ["ttt"]=> int(2) ["pub"]=> NULL ["prot:protected"]=> NULL ["priv:private"]=> NULL } Strict Standards: mktime() : You should be using the time() function instead in D:\Data\Web Sites\Quick Scripts\public_html\EE Scripts\ppp_problem.php on line 23 1153404753 -- Edit bug report at http://bugs.php.net/?id=38160&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38160&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38160&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38160&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38160&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38160&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38160&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38160&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38160&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38160&r=support Expected behavior: http://bugs.php.net/fix.php?id=38160&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38160&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38160&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38160&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38160&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38160&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38160&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38160&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38160&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38160&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38160&r=mysqlcfg

« previous php.doc (#969373544) next »