diff options
author | valmat <ufabiz@gmail.com> | 2014-03-09 02:09:36 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-03-09 02:09:36 +0600 |
commit | d76e1c204a1adcaa2a605ed3041a0f1711c716dc (patch) | |
tree | fa8f774486655a4723f652ba9934e16123039347 /Examples/CppClassesInPhp/check_map.php | |
parent | b86672080ecd25c8a3103c58cd68812902728631 (diff) |
issue #23 : Removed comments and debugging information. Added an example.
Diffstat (limited to 'Examples/CppClassesInPhp/check_map.php')
-rw-r--r-- | Examples/CppClassesInPhp/check_map.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Examples/CppClassesInPhp/check_map.php b/Examples/CppClassesInPhp/check_map.php new file mode 100644 index 0000000..cdd5345 --- /dev/null +++ b/Examples/CppClassesInPhp/check_map.php @@ -0,0 +1,63 @@ +<?php + +/** + * For functionality testing. You can then delete. + * + */ + +class cl1 { + public $qwe = 45615; + public $asd = "asdasdasd"; + public $zxcv = "Привет!"; // check UTF-8 chars + public function fn($a) { + echo $a; + } + function __destruct(){ + echo 'cl1::__destruct'; + } + + function __toString() { + return 'I\'m class cl1'; + } + +} + +class emptyClass {} + +$arr = array( + 'qwe' => 'qweqweqweqw', + 'asd' => 'Привет!', // check UTF-8 chars + 'zxccvx' => 'sdfsecvyh6bug6yfty', + 1=>2, + '2'=>2, + 44, + new cl1(), + '%'=>'%$%$%', + ); +//$arr = array(5,17,'qwe' => 'qweqweqweqw',4=>88,'17'=>'170','1'=>4, new cl1()); +//$arr = array(3.14,2.7,11,0,500); +//$arr = array(); +//$arr = new cl1(); + +$q = new MyClass(); + +var_export($arr); + +//$q->loopArray($arr); + +// Works for objects and arrays +$q->loopObject($arr); + +$q->loopObject(new emptyClass()); + + +/* +// Validation removal (i.e. do I need to use zval_add_ref(value);) +echo "\nunset(\$arr):"; +unset($arr); +echo "\nunset(\$q):"; +unset($q); +*/ + + + |