Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP...
<?php
class string {
protected $_src = null;
public function __construct($src = '') {
$this->_src = $src;
}
public function __toString() {
return $this->_src;
}
}
function foo(string $str) { echo($str); }
$test = new string('dupa');
foo($test);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.