mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Utils: assume explicitly that ob_get_contents() will not return false in getReferenceCount() based on context
This commit is contained in:
parent
ae76e8f08f
commit
099562d582
@ -514,7 +514,9 @@ class Utils{
|
||||
public static function getReferenceCount($value, bool $includeCurrent = true){
|
||||
ob_start();
|
||||
debug_zval_dump($value);
|
||||
$ret = explode("\n", ob_get_contents());
|
||||
$contents = ob_get_contents();
|
||||
if($contents === false) throw new AssumptionFailedError("ob_get_contents() should never return false here");
|
||||
$ret = explode("\n", $contents);
|
||||
ob_end_clean();
|
||||
|
||||
if(count($ret) >= 1 and preg_match('/^.* refcount\\(([0-9]+)\\)\\{$/', trim($ret[0]), $m) > 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user