From 9211aed9846ba4e9c33070f3901e961982fc39a4 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 1 Jun 2003 16:41:53 +0000 Subject: [PATCH] Simplify by using __METHOD__ --- ext/spl/tests/foreach.phpt | 10 +++++----- ext/spl/tests/foreach_break.phpt | 10 +++++----- ext/spl/tests/forward.phpt | 8 ++++---- ext/spl/tests/sequence.phpt | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/spl/tests/foreach.phpt b/ext/spl/tests/foreach.phpt index fdef242028..f3c902e74f 100755 --- a/ext/spl/tests/foreach.phpt +++ b/ext/spl/tests/foreach.phpt @@ -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); } } diff --git a/ext/spl/tests/foreach_break.phpt b/ext/spl/tests/foreach_break.phpt index f1c7b27218..606682d73c 100755 --- a/ext/spl/tests/foreach_break.phpt +++ b/ext/spl/tests/foreach_break.phpt @@ -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); } } diff --git a/ext/spl/tests/forward.phpt b/ext/spl/tests/forward.phpt index 37d2251948..3421593268 100755 --- a/ext/spl/tests/forward.phpt +++ b/ext/spl/tests/forward.phpt @@ -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"; diff --git a/ext/spl/tests/sequence.phpt b/ext/spl/tests/sequence.phpt index 3608e15c41..3c6ef2a234 100755 --- a/ext/spl/tests/sequence.phpt +++ b/ext/spl/tests/sequence.phpt @@ -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"; -- 2.50.1