Fix native Exception::setPreviousChain() fatal
Fixes a fatal in native Exception, which is missing parentheses on this method call.
Esse commit está contido em:
@@ -84,7 +84,7 @@ class Exception {
|
||||
$next = $cur->getPrevious();
|
||||
while ($next instanceof Exception) {
|
||||
$cur = $next;
|
||||
$next = $cur->getPrevious;
|
||||
$next = $cur->getPrevious();
|
||||
}
|
||||
$cur->setPrevious($previous);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$e0 = new Exception('0');
|
||||
$e1 = new Exception('1');
|
||||
$e2 = new Exception('2');
|
||||
$e1->setPrevious($e2);
|
||||
$e0->setPrevious($e1);
|
||||
|
||||
$eA = new Exception('A');
|
||||
$eB = new Exception('B');
|
||||
$eC = new Exception('C');
|
||||
$eB->setPrevious($eC);
|
||||
$eA->setPrevious($eB);
|
||||
|
||||
$e0->setPreviousChain($eA);
|
||||
|
||||
$proper_order = '012ABC';
|
||||
$actual_order = $e0->getMessage();
|
||||
|
||||
$cur = $e0;
|
||||
while ($cur->getPrevious() !== null) {
|
||||
$cur = $cur->getPrevious();
|
||||
$actual_order .= $cur->getMessage();
|
||||
}
|
||||
|
||||
$result = $actual_order === $proper_order ? 'pass' : 'fail';
|
||||
|
||||
echo "{$result}\n";
|
||||
@@ -0,0 +1 @@
|
||||
pass
|
||||
Referência em uma Nova Issue
Bloquear um usuário