To String object

Removes private properties before returning

@return  string
505810
public function toString()
	{
		// Reflect on class to get private or protected props
		$privateProperties = with(new \ReflectionClass($this))->getProperties(\ReflectionProperty::IS_PROTECTED);

		// Remove each private or protected prop
		foreach ($privateProperties as $prop)
		{
			$name = (string) $prop->name;
			unset($this->$name);
		}

		// Output as json
		return json_encode($this);
	}
1068583
public function serialize()
    {
        $data = array();

        $private_properties = array(
            'row_wrapper_class',
            'index_field',
            'objects',
            'objects_by_index',
            'options'
        );

        foreach ($private_properties as $property) {
            $data[$property] = $this->$property;
        }

        return serialize($data);
    }
520149
public function toString()
    {
        $string = '';
        $constants = $this->getIterator();
        foreach ($constants as $constant) {
            $string .= $constant->toString();
        }

        return $string;
    }
881935
public function toString()
    {
        $result = "";
        if ($this->scheme) {
            $result .= $this->scheme.'://';
        }
        if ($this->user) {
            $result .= $this->user;
            if ($this->pass) {
                $result .= $this->user;
            }
            $result .= '@';
        }
        if ($this->host) {
            $result .= $this->host;
        }
        if ($this->port) {
            $result .= ':'.$this->port;
        }
        if ($this->pathSegments) {
            $result .= '/'.implode('/', $this->pathSegments);
        }
        if ($this->parameters) {
            $result .= '?'.http_build_query($this->parameters);
        }
        if ($this->fragment) {
            $result .= '#'.$this->fragment;
        }
        return $result;
    }
413486
public function jsonSerialize()
    {
        $properties = get_object_vars($this);
        $outProperties = array();
        foreach ($properties as $propertie => $value) {
            if ($propertie[0] === '_') {
                $namePropertie = substr($propertie, 1);
                $outProperties[$namePropertie] = $this->$propertie;
            } else {
                $outProperties[$propertie] = $this->$propertie;
            }
        }

        return $outProperties;
    }
750888
public function toString()
    {
        if ($this->isClosure()) {
            throw new LogicException('You cannot serialize a closure.');
        }

        if ($this->isFunction()) {
            return $this->getCallMethod();
        }

        $separator = $this->isStaticMethod() ? '::' : '->';

        return $this->getCallClass() . $separator . $this->getCallMethod();

    }
1089254
function ToString()
    {
        $resultArr = array((string)$this->tables[0]);
        foreach ($this->tables as $key=>$table)
        {
            if ($key == 0)
                 continue;
                
            $part = (string)$this->joins[$key - 1]; 
            $part .= ' ' . (string)$table;
            $part .= ' ON ' . (string)$this->conditions[$key - 1];

            $resultArr[] = $part;
        }
        return join(' ', $resultArr);
    }
88222
function toString()
    {
        $uri = '';

        if ($this->getScheme())
            $uri .= $this->getScheme() . ':'. '//';

        $uri .= $this->getAuthority();
        $uri .= parent::toString();

        if ($this->getHost() && (!$this->getQuery()->isEmpty() || $this->getFragment()))
            $uri .= '/';

        $replace = function ($match) { return rawurlencode($match[0]); };
        if (\Poirot\Std\cast($this->getQuery())->toArray()) {
            $regex   = '/(?:[^' .'a-zA-Z0-9_\-\.~' .'!\$&\'\(\)\*\+,;=' .'%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/';
            $uri .= "?" . preg_replace_callback($regex, $replace, $this->getQuery()->toString());
        }

        if ($this->getFragment()) {
            $regex   = '/(?:[^' .'a-zA-Z0-9_\-\.~' .'!\$&\'\(\)\*\+,;=' .'%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/';
            $uri .= "#" . preg_replace_callback($regex, $replace, $this->getFragment());
        }

        return $uri;
    }
1077886
private String safeToString(Object obj)
	{
		String toString = null;
		if (obj != null)
		{
		    try
		    {
		        toString = obj.toString();
		    }
		    catch (Throwable ex)
		    {
		        toString = "BAD toString() impl for " + obj.getClass().getName();
		    }
		}
		return toString;
	}
1218288
function toString()
    {
        $parts = array();
        if ( ($r = parent::toString()) !== '' )
            ## avoid double slash trail issue
            $parts[] = ($r == $this->getSeparator()) ? '' : $r;
        if ( ($r = $this->getBasename()) !== '')
            $parts[] = $r;

        return implode($this->getSeparator(), $parts);
    }
990016
public function toString(): string
    {
        return implode(
            ' and ',
            array_map(
                function (Constraint $constraint) {
                    return $constraint->toString();
                },
                $this->constraints
            )
        );
    }
197695
public function __tostring()
    {
        ob_start();
        $close = $this->_opened;
        $this->open();
        if (!in_array('start', $this->options)) {
            $this->content();
        }
        if (!$this->hasOption('start') || $close) {
            $this->close();
        }

        return ob_get_clean();
    }
448135
private function getUnsettablePropertiesDeclaration()
    {

        // if unsettable properties are the default we don't need to do anything
        if( $this->unsetableProperties === array('id') ) {
            return array();
        }

        $unsetableProperties = array_map(
            function($property){
                return "'".addslashes($property)."'";
            }
            , $this->unsetableProperties
        );

        $this->class->classComponents[] = new VariableDeclaration(
            'unsetableProperties',
            new Sformatf( <<<'PHP'
                /**
                 * Unsetable properties
                 * @var array
                 */
                protected static $unsetableProperties = [%s];
PHP
                , implode( ', ', $unsetableProperties )
            )
        );

        return $this;

    }
301670
public function toString()
    {
        $parts = [];

        if ($this->operand) {
            $parts[] = (string)$this->operand;
        }

        if ($this->constraint) {
            $parts[] = (string)$this->constraint;
        }

        return implode(' ', $parts);
    }
1111062
public function toString()
    {
        $string = '';
        $methods = $this->getIterator();
        foreach ($methods as $method) {
            $string .= $method->toString();
        }

        return $string;
    }
1254710
public function tostring()
    {

        if (empty($this->value)) {

            return (empty($this->function)) ? "$this->function(`$this->name`)" : " `$this->name`";
        }

        $str = strtoupper($this->condition) . " `$this->name`";

        if (is_array($this->value)) {
            $str .= " IN (" . implode("','", $this->value) . "')";
        } else {
            $str .= " = '$this->value'";
        }

        return $str;
    }
25506
function serialize()
	{
		$propvals = array();
		$ro = new ReflectionObject($this);

		foreach ($ro->getProperties() as $rp )
		{
			$propname = $rp->getName();

			if (!in_array($propname,self::$NoCacheProperties))
			{
				if (method_exists($rp,"setAccessible"))
				{
					$rp->setAccessible(true);
					$propvals[$propname] = $rp->getValue($this);
				}
				elseif (!$rp->isPrivate())
				{
					// if < php 5.3 we can't serialize private vars
					$propvals[$propname] = $rp->getValue($this);
				}

			}
		}

		return serialize($propvals);
	}