3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arrs = array( array('id'=>1,'name'=>'root','pid'=>0), array('id'=>2,'name'=>'root1','pid'=>0), array('id'=>3,'name'=>'level1','pid'=>1), array('id'=>4,'name'=>'level11','pid'=>1), array('id'=>5,'name'=>'leve21','pid'=>2), array('id'=>6,'name'=>'level2','pid'=>2) ); class digui{ function index( ){ $this->test($arr); } private function doarr($arrs){ print_r($arrs); } /* private function test($n){ if($n!=0) { echo $n; $this->test($n-1); return $n; } }*/ } $d = new digui; $d->doarr($arrs);
based on teqEm
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to private method digui::doarr() from context '' in /in/oCWOS:34 Stack trace: #0 {main} thrown in /in/oCWOS on line 34
Process exited with code 255.
Output for 5.6.0 - 5.6.26
Fatal error: Call to private method digui::doarr() from context '' in /in/oCWOS on line 34
Process exited with code 255.