note 63220 added to function.array-push
| From: | krristaps at inbox dot lv | Date: | Thu, 16 Mar 2006 11:52:46 +0000 |
| Subject: | note 63220 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105921@lists.php.net to get a copy of this message | ||
Here is the smallest chunk of php code describing data structure called stack:
<?php
class stack{
var $memory=array();
function push($value){
$this->memory[]=$value;
}
function pop(){
$count=$this->count();
if ($count){
$value=$this->memory[$count-1];
unset($this->memory[$count-1]);
return $value;
}
else return false;
}
function count(){
return count($this->memory);
}
};
?>
----
Server IP: 81.94.227.69
Probable Submitter: 194.8.16.3 (proxied: 1.0 PROXY01)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit -- http://master.php.net/note/edit/63220
Del: integrated -- http://master.php.net/note/delete/63220/integrated
Del: useless -- http://master.php.net/note/delete/63220/useless
Del: bad code -- http://master.php.net/note/delete/63220/bad+code
Del: spam -- http://master.php.net/note/delete/63220/spam
Del: non-english -- http://master.php.net/note/delete/63220/non-english
Del: in docs -- http://master.php.net/note/delete/63220/in+docs
Del: other reasons-- http://master.php.net/note/delete/63220
Reject -- http://master.php.net/note/reject/63220
Search -- http://master.php.net/manage/user-notes.php