Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit c86d06351561d898dd9f3a95ae603d1b992a6bd6 Scott Nicol committed Apr 9, 2012
Showing with 75 additions and 0 deletions.
  1. +14 −0 index.php
  2. +9 −0 lib/objects/integer.php
  3. +46 −0 lib/objects/string.php
  4. +6 −0 lib/oo.php
@@ -0,0 +1,14 @@
+<?php require("lib/oo.php");
+
+
+ $string = new String("Hey");
+
+ echo $string->value;
+
+ $int = new Integer(1);
+
+ echo $int->value;
+
+
+
+
@@ -0,0 +1,9 @@
+<?php
+
+ class Integer {
+
+ public function __construct($integer){
+ $this->value = $integer;
+ }
+
+ }
@@ -0,0 +1,46 @@
+<?php
+
+ class String {
+
+ public function __construct($string){
+ $this->value = $string;
+ }
+
+ // @public addcslashes
+ // normal syntax: addcslashes($string, $charlist);
+ // oo-syntax: addcslashes($charlist);
+ // @return string
+ public function addcslashes($charlist){
+ return addcslashes($this->value, $charlist);
+ }
+
+ // @public addslashes
+ // normal syntax: addslashes($string);
+ // oo-syntax: addslashes();
+ // @return string
+ public function addslashes(){
+ return addslashes($this->value);
+ }
+
+ // @public bin2hex
+ // normal syntax: bin2hex($string);
+ // oo-syntax: bin2hex();
+ // @return string
+ public function bin2hex(){
+ return bin2hex($this->value);
+ }
+
+ // @public explode
+ // normal syntax: explode($delimiter, $string, $limit);
+ // oo-syntax: explode($delimiter, $limit);
+ // @return array or false
+ public function explode($delimiter, $limit){
@kylef

kylef Apr 10, 2012

Contributor

$limit should be optional like PHP's explode.

+ if($delimiter=""){
+ return false;
+ } else {
+ return explode($delimiter, $this->value, $limit);
+ }
+ }
+
+
+ }
@@ -0,0 +1,6 @@
+<?php
+
+ $scan = glob("objects/*.php");
+ foreach($scan as $file){
+ require($file);
+ }

0 comments on commit c86d063

Please sign in to comment.