2021-03-17 01:14:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Wikimedia\DebugInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A class used for replacing large objects in var_dump() output.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.40
|
|
|
|
|
*/
|
|
|
|
|
class Placeholder {
|
|
|
|
|
/** @var string A description of the replaced object */
|
|
|
|
|
public $desc;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param mixed $value
|
|
|
|
|
*/
|
|
|
|
|
public function __construct( $value ) {
|
2023-11-16 12:54:38 +00:00
|
|
|
if ( is_object( $value ) ) {
|
2021-03-17 01:14:49 +00:00
|
|
|
$this->desc = get_class( $value ) . '#' . spl_object_id( $value );
|
|
|
|
|
} else {
|
2024-07-31 16:56:55 +00:00
|
|
|
$this->desc = get_debug_type( $value );
|
2021-03-17 01:14:49 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|