PHP Classes

undefined offset notice

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in

      Brainf*** Interpreter  >  All threads  >  undefined offset notice  >  (Un) Subscribe thread alerts  
Subject:undefined offset notice
Summary:It's good to disable notices.
Author:Hamed Afshar
Date:2011-08-20 13:10:56

  1. undefined offset notice   Reply   Report abuse  
Picture of Hamed Afshar Hamed Afshar - 2011-08-20 13:10:56
It's a nice class, but I found a small issue.
in line 82, there's this line:

since $this->stack[$this->pointer] is not defined at first, so a notice is displayed by PHP.
By adding the followin lines before the switch block, the problem will be solved:

if (!isset($this->stack[$this->pointer])) {