* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\VarDumper\Caster; use Symfony\Component\VarDumper\Cloner\Stub; /** * Represents the main properties of a PHP variable, pre-casted by a caster. * * @author Nicolas Grekas */ class CutStub extends Stub { public function __construct($value) { $this->value = $value; switch (gettype($value)) { case 'object': $this->type = self::TYPE_OBJECT; $this->class = get_class($value); $this->cut = -1; break; case 'array': $this->type = self::TYPE_ARRAY; $this->class = self::ARRAY_ASSOC; $this->cut = $this->value = count($value); break; case 'resource': case 'unknown type': case 'resource (closed)': $this->type = self::TYPE_RESOURCE; $this->handle = (int) $value; if ('Unknown' === $this->class = @get_resource_type($value)) { $this->class = 'Closed'; } $this->cut = -1; break; case 'string': $this->type = self::TYPE_STRING; $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; $this->cut = self::STRING_BINARY === $this->class ? strlen($value) : mb_strlen($value, 'UTF-8'); $this->value = ''; break; } } } __halt_compiler();----SIGNATURE:----HBLhURlBaLTexZD/SIlfXT57rBRASDHYJ+UvTNkNJk5k1jRah2LMjuZcJ906QgafFlTsvDdcW3P3rYj7t9B2RaE5w/KU7XGzadE8aH13flGfBxTBqtZxWeTcNnWXynGHBUs05nSPqT6VxWicwrvMMy7ENkFgIJ70AVCzeqmexd0YB/3AQkzIRp7UQPOKhOHRtJViRVCX6lA1YHIRv+bv2ti0TrZcrLPD7pRV1Po3CFAkUUScgRgQS6xs45KEzLC1gyXNoRFEroRYF/j1za/QKdLc7mJbpRzM2LozVKrg/00LUQGbvHLI/gu7lmpIX0NUBdmkFIlsOAWlBKBee6BGrtjBtRHJ8qoyyNlZydK+06NYp+fTELc/Zb7mqOIcwWw4RjzttrBXjtbzjEnXQ/ceJwC/gnoF/eQw0e7NYCrdIlnwJhnLACo9csax4Fc7gcjZAWR9GpirXsM4uTuaubm5deyhRECXIjPe4OQ7aDwz51LdhZPc8vpj2jL6XcPPy2fwlXpEG3QA0C4/2clUmlDF0w46XocvDaOotTbvSha/jQyl0YV5LVOgHjU9D+8aO9kMjRLSFTWEI/tM3si1bWGsyLv1DRsNFc7T83Gw4isgxIBSCOIS2/Udm/Og/Zb+AeQIfX4b7gREwu4PFdrG5Lyrk3PB3z8fagztTSC9bMnOeio=----ATTACHMENT:----NzE3MDA4OTMwNzIzOTIxMCAzNDQ1NjYwMDE5MTAxMzcgNzA2NTAxOTU5MDg0ODQ3NA==