PHP - Worker::stack() 函数


Worker::stack() - Stacking,更多的相关函数请看:PHP Worker 函数

语法


public int Worker::stack( Stackable $work )

Worker::stack() 函数将引用的 Stackable 附加到被引用的 Worker 的堆栈中。

Worker::stack() 函数返回 stack 的新长度。

示例


<?php
   class Work extends Stackable {
      public function run(){
         /** ... **/
      }
   }
   class My extends Worker {
      public function run(){
         /** ... **/
      }
   }
   $my = new My();
   var_dump($my->stack(new Work()));
?>