L1 · php-wasm

Reproducing php/php-src#12167

Loading php-wasm runtime…

Reproduction script

<?php
$xml = '<?xml version="1.0"?><foo><bar><?stylesheet hello ?></bar></foo>';
$sxe = simplexml_load_string($xml);
$pis = $sxe->xpath("//processing-instruction()");
$pi_text = isset($pis[0]) ? (string) $pis[0] : null;

echo json_encode([
  "php_version" => PHP_VERSION,
  "xpath_count" => count($pis ?: []),
  "pi_text" => $pi_text,
  "pi_text_empty" => $pi_text === "",
]);

Output

(running)