#38160 [Opn->Csd]: var is no longer raising E_STRICT
| From: | nlopess@php.net | Date: | Sat, 12 Aug 2006 16:44:28 +0000 |
| Subject: | #38160 [Opn->Csd]: var is no longer raising E_STRICT | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969373746@lists.php.net to get a copy of this message | ||
ID: 38160
Updated by: nlopess@php.net
Reported By: RQuadling at GMail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows XP SP2
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2006-07-20 14:13:41] RQuadling at GMail dot com
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 this bug report at http://bugs.php.net/?id=38160&edit=1