note 72032 added to language.oop5.typehinting
| From: | jzakhar at gmail dot com | Date: | Fri, 29 Dec 2006 22:42:09 +0000 |
| Subject: | note 72032 added to language.oop5.typehinting | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121024@lists.php.net to get a copy of this message | ||
Something I got hung up on with regards to type hinting
<?php
class asdf
{
public $data;
function __construct()
{
$this->data = '1';
}
function foo( asdf $var )
{
print $var;
}
}
$x = new asdf();
$x->foo( $x->data );
?>
That fails, and its intended behavior, which begs the question, where is the value in type hinting?
----
Server IP: 216.194.113.175
Probable Submitter: 71.235.161.238
----
Manual Page -- http://www.php.net/manual/en/language.oop5.typehinting.php
Edit -- https://master.php.net/note/edit/72032
Del: integrated -- https://master.php.net/note/delete/72032/integrated
Del: useless -- https://master.php.net/note/delete/72032/useless
Del: bad code -- https://master.php.net/note/delete/72032/bad+code
Del: spam -- https://master.php.net/note/delete/72032/spam
Del: non-english -- https://master.php.net/note/delete/72032/non-english
Del: in docs -- https://master.php.net/note/delete/72032/in+docs
Del: other reasons-- https://master.php.net/note/delete/72032
Reject -- https://master.php.net/note/reject/72032
Search -- https://master.php.net/manage/user-notes.php