From 78e9e45c4c3c83867ff2145e274841237a85de05 Mon Sep 17 00:00:00 2001 From: Maciej Kiejda Date: Tue, 11 Oct 2022 17:01:37 +0200 Subject: [PATCH] using length instead of count for php < 7.2 compatibility (#643) --- install-php-extensions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index fc7dd39..d734ec5 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -219,11 +219,11 @@ set_error_handler( $xpath = new DOMXpath($doc); $xpath->registerNamespace('v20', 'http://pear.php.net/dtd/package-2.0'); $xpath->registerNamespace('v21', 'http://pear.php.net/dtd/package-2.1'); -if ($xpath->query('/v20:package/v20:dependencies')->count() === 1) { +if ($xpath->query('/v20:package/v20:dependencies')->length === 1) { $ns = 'v20:'; -} elseif ($xpath->query('/v21:package/v21:dependencies')->count() === 1) { +} elseif ($xpath->query('/v21:package/v21:dependencies')->length === 1) { $ns = 'v21:'; -} elseif ($xpath->query('/package')->count() === 1) { +} elseif ($xpath->query('/package')->length === 1) { $ns = ''; } else { fwrite(STDERR, "Unsupported namespace of the XML of package version details\n");