note 53881 added to language.oop5
| From: | degregar at jama-tur dot pl | Date: | Thu, 16 Jun 2005 00:51:45 +0000 |
| Subject: | note 53881 added to language.oop5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90497@lists.php.net to get a copy of this message | ||
How can i read properties?
<?php
function getString( $strBuffer )
{
$strSomeContent = substr( $strBuffer, 39, -3 ); // you can use some regexp or something
return $strSomeContent;
}
class Test
{
private $strTest = 'some content'; // you can't read outside class' methods,
what is in $strTest.. for sure?
}
ob_start( 'getString'); // you can use buffering and simple function getString()...
$objTest = new Test;
print_r( $objTest, $blnSomeContent );
// return:
// Test Object
// (
// [strTest:private] => some content
// )
ob_end_flush();
?>
This simple script returns:
some content
Bug?
----
Manual Page -- http://www.php.net/manual/en/language.oop5.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53881
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53881&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53881&report=yes
Search -- http://master.php.net/manage/user-notes.php