Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

3.1K
Visualizações
PHP str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Dear all Iam getting this error on while run my app.

Here below i attached the image file for the code that shows error

{"data":[
    ["omron","<span class=\"label label-success\">Active<\/span>",
    "<button type=\"button\" class=\"btn btn-default\" onclick=\"editBrand(4)\" data-toggle=\"modal\" data-target=\"#editBrandModal\"><i class=\"fa fa-pencil\"><\/i><\/button> <button type=\"button\" class=\"btn btn-default\" onclick=\"removeBrand(4)\" data-toggle=\"modal\" data-target=\"#removeBrandModal\"><i class=\"fa fa-trash\"><\/i><\/button>\n\t\t\t\t"]
    ]
}
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: 8192</p>
<p>Message:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated</p>
<p>Filename: core/Output.php</p>
<p>Line Number: 457</p>


    <p>Backtrace:</p>

UPDATE: Code

if ($this->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); 
}

Onload Consition

enter image description here

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Use a ternary operator.

Before Codeigniter existing code:

$output = str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output);

Hopefully, it's will work fine.

After Use Ternary Operator:

$output = $output ? str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output): "";
over 4 years ago · Santiago Trujillo Relatório

0

This error message can show up if you have not loaded any views. Codeigniter's internal output buffer is never initialized thus being null. The output buffer is the third parameter to str_replace(). There might be other ways to trigger this error message.

You probably want to load a valid view, at some point.

PHP 7 and lower just would ignore the missing parameter, while PHP 8+ displays the warning. It may also vary with your environment / debug settings.

over 4 years ago · Santiago Trujillo Relatório

0

I have had such an error

This is the only way to get rid of the error. That you PHP 7 & 8 install you'r System

php install in c/:xampp & c/:xampp2 installed. beacuse difrant drive in error occuerd

And

Benefit in other programs

Multiple xampp installations windows

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda