Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3158 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58601 invoked from network); 2 Jul 2003 04:56:47 -0000 Received: from unknown (HELO hasele) (216.179.74.133) by pb1.pair.com with SMTP; 2 Jul 2003 04:56:47 -0000 Received: by hasele (Postfix, from userid 1000) id 3F0384EA56; Wed, 2 Jul 2003 00:34:52 -0400 (EDT) To: internals@lists.php.net Cc: Zeev Suraski , andi@zend.com Content-Type: multipart/mixed; boundary="=-GtNmlTxi20z1YJmsY9xu" Message-ID: <1057120491.17089.3.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 02 Jul 2003 00:34:52 -0400 Subject: Nasty Parser Bug From: sterling@bumblebury.com (Sterling Hughes) --=-GtNmlTxi20z1YJmsY9xu Content-Type: text/plain Content-Transfer-Encoding: 7bit Hey, Bug 24441 (http://bugs.php.net/bug.php?id=24441), displays the following problem: array, array($this, 'filter')); } function filter ($value) { return preg_match("/{$this->filter}/i", $value); } } $t = new test; var_dump($t->filter('hello world')); ?> That script (also attached), will give an error: Fatal error: Using $this when not in object context in /data/home/sterling/work/os/php/php-src/arraybug.php on line 11 If you comment out the test() function declaration, everything will work as expected. -Sterling -- "First they ignore you, then they laugh at you, then they fight you, then you win." - Gandhi --=-GtNmlTxi20z1YJmsY9xu Content-Disposition: attachment; filename=arraybug.php Content-Type: application/x-php; name=arraybug.php Content-Transfer-Encoding: base64 PD9waHAKY2xhc3MgdGVzdCB7Cgl2YXIgJGZpbHRlciA9ICdoZWxsbyc7IAoJdmFyICRhcnJheSA9 IGFycmF5KCdoZWxsbycsICdoZWxsbyB3b3JsZCcsICdoZXkgdGhlcmUnKTsKCQoJZnVuY3Rpb24g dGVzdCgpIHsKCQlhcnJheV9maWx0ZXIoJHRoaXMtPmFycmF5LCBhcnJheSgkdGhpcywgJ2ZpbHRl cicpKTsKCX0KCQoJZnVuY3Rpb24gZmlsdGVyICgkdmFsdWUpIHsKCQlyZXR1cm4gcHJlZ19tYXRj aCgiL3skdGhpcy0+ZmlsdGVyfS9pIiwgJHZhbHVlKTsKCX0KfQokdCA9IG5ldyB0ZXN0Owp2YXJf ZHVtcCgkdC0+ZmlsdGVyKCdoZWxsbyB3b3JsZCcpKTsKPz4K --=-GtNmlTxi20z1YJmsY9xu--