- array_push: documentation ( source)
- array_shift: documentation ( source)
<?php
class PushAndPull
{
public $queue=array();
public function push($push)
{
array_push($this->$queue,$push);
}
public function pull()
{
return array_shift($this->$queue);
}
}
$obj = new PushAndPull();
$obj->push(1);
$obj->print_r($queue);
?>