forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.4: Fix phpGH-16316: DOMXPath breaks when not initialized properly
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--TEST-- | ||
GH-16316 (DOMXPath breaks when not initialized properly) | ||
--EXTENSIONS-- | ||
dom | ||
--FILE-- | ||
<?php | ||
|
||
class Demo extends DOMXPath { | ||
public function __construct() {} | ||
} | ||
|
||
$demo = new Demo; | ||
try { | ||
var_dump($demo); | ||
} catch (DOMException $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
|
||
try { | ||
var_dump($demo->document); | ||
} catch (DOMException $e) { | ||
echo $e->getMessage(), "\n"; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
object(Demo)#1 (1) { | ||
["registerNodeNamespaces"]=> | ||
bool(true) | ||
} | ||
Invalid State Error | ||
Invalid State Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters