title: PHP str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
body: <p>I'm getting this error while running my app:</p>
  <blockquote>
  <p>PHP str_replace(): Passing null to parameter #3 ($subject) of type
  array|string is deprecated</p>
  </blockquote>
  <p>I am Using CodeIgniter Version : V4.1.8 PHP Version : 8.1.2, full error output below:</p>
  <pre><code>{&quot;data&quot;:[
      [&quot;omron&quot;,&quot;&lt;span class=\&quot;label label-success\&quot;&gt;Active&lt;\/span&gt;&quot;,
      &quot;&lt;button type=\&quot;button\&quot; class=\&quot;btn btn-default\&quot; onclick=\&quot;editBrand(4)\&quot; data-toggle=\&quot;modal\&quot; data-target=\&quot;#editBrandModal\&quot;&gt;&lt;i class=\&quot;fa fa-pencil\&quot;&gt;&lt;\/i&gt;&lt;\/button&gt; &lt;button type=\&quot;button\&quot; class=\&quot;btn btn-default\&quot; onclick=\&quot;removeBrand(4)\&quot; data-toggle=\&quot;modal\&quot; data-target=\&quot;#removeBrandModal\&quot;&gt;&lt;i class=\&quot;fa fa-trash\&quot;&gt;&lt;\/i&gt;&lt;\/button&gt;\n\t\t\t\t&quot;]
      ]
  }
  &lt;div style=&quot;border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;&quot;&gt;
  
  &lt;h4&gt;A PHP Error was encountered&lt;/h4&gt;
  
  &lt;p&gt;Severity: 8192&lt;/p&gt;
  &lt;p&gt;Message:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated&lt;/p&gt;
  &lt;p&gt;Filename: core/Output.php&lt;/p&gt;
  &lt;p&gt;Line Number: 457&lt;/p&gt;
  
  
      &lt;p&gt;Backtrace:&lt;/p&gt;
  </code></pre>
  <p>UPDATE: Code</p>
  <pre><code>if ($this-&gt;parse_exec_vars === TRUE) 
  { 
      $memory = round(memory_get_usage() / 1024 / 1024, 2).'MB'; 
      // below is line 457
      $output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output); 
  }
  </code></pre>