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

265
Visualizações
/opt/plesk/php/7.0/bin/php': free() - Error

I get this error: (because of char limitations on pastebin.com)

And I know that I get this error only because I want to make a triangle replacement. I know that because before I implement the triangle replacement, everything worked fine...

What I want to do is to get all price and price_base tags and swap them. But I do not know why PHP is complaining about that...

Here is the code:

function specialPriceToPrice($dom, $path ,$price, $specialPrice)
{

    $doc = simplexml_import_dom($dom);
    $items = $doc->xpath("//$path");
    foreach ($items as $item) {
        $node = dom_import_simplexml($item);

        $tmp = $node->getElementsByTagName($specialPrice)->item(0)->textContent;

        if($tmp != ""){
            $tmp2 = $node->getElementsByTagName($price)->item(0)->textContent;
            $node->getElementsByTagName($price)->item(0)->textContent = $tmp;
            $node->getElementsByTagName($specialPrice)->item(0)->textContent = $tmp2;

            $tmp = null;
            $tmp2 = null;
        }

        $node = null;
        $tmp = null;
        $tmp2 = null;
        $item = null;
    }

    $doc = null;
    $items = null;
}

I also tried $tmp != null- but same result... Can it be that this error comes up because of the feed?

Because sometimes I have a price_base which looks like this <price_base/> but it could also be that it looks like <price_base></price_base>. And of course, sometimes it's filled 13.13.

Here is the raw feed (I rename special_price to price_base)

http: //j-trier.de/cronjob/data/gamebillet.xml (Not allowed more then 2 links)

Could the error because in my output feed the price_base ends with / and not starts with /?

Greetings and Thank You!

over 4 years ago · Santiago Trujillo
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