Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
/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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda