note 53881 rejected from language.oop5 by sean
| From: | sean@php.net | Date: | Thu, 16 Jun 2005 00:58:23 +0000 |
| Subject: | note 53881 rejected from language.oop5 by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90498@lists.php.net to get a copy of this message | ||
Note Submitter: degregar at jama-tur dot pl
----
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?