The same thing is done in many places in our codebases. Just these two use string comparisons. Change-Id: Ia543cc5c1ef141cdcd0173855f6e8363dd5e98f3
24 lines
456 B
PHP
24 lines
456 B
PHP
<?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 ) {
|
|
if ( is_object( $value ) ) {
|
|
$this->desc = get_class( $value ) . '#' . spl_object_id( $value );
|
|
} else {
|
|
$this->desc = gettype( $value );
|
|
}
|
|
}
|
|
}
|