wiki.techinc.nl/includes/libs/DebugInfo/Placeholder.php
thiemowmde 7115e680e7 Avoid string comparisons with gettype() in 2 more places
The same thing is done in many places in our codebases. Just these
two use string comparisons.

Change-Id: Ia543cc5c1ef141cdcd0173855f6e8363dd5e98f3
2023-11-16 13:54:38 +01:00

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 );
}
}
}