title: How to solve this PHP notice error?
body: <p>I am getting PHP notice error. This code was working fine in php 5.3 but then I upgraded my PHP to PHP 7. What I'm trying to do is, fetch the URL from the link, and just display the parameters attached with the URL. Here is the code.</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;?php 
      require_once('bootstrap.php');
      $bootstrap = new Bootstrap($_GET);
  ?&gt; 
  </code></pre>
  
  <p><strong>bootstrap.php</strong></p>
  
  <pre><code>&lt;?php 
  class Bootstrap{
      private $controller;
      private $action;
      private $request;
      public function __construct($request){
          $this-&gt;request = $request;
          if($this-&gt;request['controller'] == ''){
              $this-&gt;controller = "Home";
          }
          elseif($_GET($request['controller'])){
              $this-&gt;controller = $this-&gt;request['controller'];
          }
          if($this-&gt;request['action'] == ''){
              $this-&gt;action = "index";
          } else{
              $this-&gt;action = $this-&gt;request['action'];
          }
          echo "&lt;br /&gt;$this-&gt;controller&lt;br /&gt;$this-&gt;action";
      }
  ?&gt;
  </code></pre>
  
  <p><em>Output on going to URL: localhost/myDir/index.php/abc/def</em></p>
  
  <p>Notice: Undefined index: controller in /srv/http/myDir/bootstrap.php on line 8<br/>
  Notice: Undefined index: action in /srv/http/myDir/bootstrap.php on line 14</p>
  
  <p>Home<br/>
  index</p>