]> granicus.if.org Git - php/commitdiff
Simplify by using __METHOD__
authorMarcus Boerger <helly@php.net>
Sun, 1 Jun 2003 16:41:53 +0000 (16:41 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 1 Jun 2003 16:41:53 +0000 (16:41 +0000)
ext/spl/tests/foreach.phpt
ext/spl/tests/foreach_break.phpt
ext/spl/tests/forward.phpt
ext/spl/tests/sequence.phpt

index fdef242028087a5d670952ced4986fee6515b031..f3c902e74f4cb52998a78ec70004267699874310 100755 (executable)
@@ -13,20 +13,20 @@ class c_iter implements spl::forward_assoc {
                $this->obj = $obj;
        }
        function current() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num;
        }
        function next() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                $this->num++;
        }
        function has_more() {
                $more = $this->num < $this->obj->max;
-               echo __CLASS__ . '::' . __FUNCTION__ . ' = ' .($more ? 'true' : 'false') . "\n";
+               echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
                return $more;
        }
        function key() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                switch($this->num) {
                        case 0: return "1st";
                        case 1: return "2nd";
@@ -41,7 +41,7 @@ class c implements spl::iterator {
        public $max = 3;
 
        function new_iterator() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return new c_iter($this);
        }
 }
index f1c7b272188d2219738d4adab61258021096aa7b..606682d73c0275c5beff6125f652dd87e27933b3 100755 (executable)
@@ -13,20 +13,20 @@ class c_iter implements spl::forward_assoc {
                $this->obj = $obj;
        }
        function current() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num;
        }
        function next() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                $this->num++;
        }
        function has_more() {
                $more = $this->num < $this->obj->max;
-               echo __CLASS__ . '::' . __FUNCTION__ . ' = ' .($more ? 'true' : 'false') . "\n";
+               echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
                return $more;
        }
        function key() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                switch($this->num) {
                        case 0: return "1st";
                        case 1: return "2nd";
@@ -41,7 +41,7 @@ class c implements spl::iterator {
        public $max = 3;
 
        function new_iterator() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return new c_iter($this);
        }
 }
index 37d22519483604b5323cf6c85148bb85c8d5523f..34215932686aea29bac851777d1c4c1c83c6a80e 100755 (executable)
@@ -10,19 +10,19 @@ class c implements spl::forward_assoc {
        public $num = 0;
 
        function current() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num;
        }
        function next() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                $this->num++;
        }
        function has_more() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num < $this->max;
        }
        function key() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                switch($this->num) {
                        case 0: return "1st";
                        case 1: return "2nd";
index 3608e15c411461e9d6e1d092d360450955e498e6..3c6ef2a234c0d9b19ea547b1095d926d6d515608 100755 (executable)
@@ -9,7 +9,7 @@ class c implements spl::iterator {
        public $max = 3;
 
        function new_iterator() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return new c_iter($this);
        }
 }
@@ -23,23 +23,23 @@ class c_iter implements spl::sequence_assoc {
                $this->obj = $obj;
        }
        function rewind() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                $this->num = 0;
        }
        function current() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num;
        }
        function next() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                $this->num++;
        }
        function has_more() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                return $this->num < $this->obj->max;
        }
        function key() {
-               echo __CLASS__ . '::' . __FUNCTION__ . "\n";
+               echo __METHOD__ . "\n";
                switch($this->num) {
                        case 0: return "1st";
                        case 1: return "2nd";