Created
February 8, 2013 21:31
-
-
Save netojoaobatista/4742102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
register_tick_function(function() { | |
foreach ($GLOBALS as $name => $value) { | |
if (is_string($value)) { | |
$GLOBALS[$name] = new String($value); | |
} | |
} | |
}); | |
declare (ticks=1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'João Batista Neto'; | |
var_dump($string->explode(' ')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class String | |
{ | |
private $value; | |
public function __construct($value) | |
{ | |
$this->value = $value; | |
} | |
public function __toString() | |
{ | |
return $this->value; | |
} | |
public function explode($sep) | |
{ | |
return explode($sep, $this->value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HAHAHAHAHA