#47254 [Asn]: Wrong Reflection for extends class
ID: 47254 User updated by: ivan1986 at list dot ru Reported By: ivan1986 at list dot ru Status: Assigned Bug Type: Reflection related Operating System: * PHP Version: 5.*, 6CVS (2009-04-25) Assigned To: felipe New Comment: Hello! As i now C and how i understand source fix may by simpled: - ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); + ZVAL_STRINGL(classname, method->common.scope->name, method->common.scope->name_length, 1); - ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); + ZVAL_STRINGL(classname, prop->ce->name, prop->ce->name_length, 1); Previous Comments: [2009-04-27 16:48:11] j...@php.net Of course it's a bug, just commit your fix.. [2009-01-31 19:44:17] fel...@php.net Hi Marcus, is this actually the behavior expected? As we have the 'class' array key in the return, I believe that is really a bug. Anyway here is a simple fix: http://felipe.ath.cx/diff/bug47254.diff ------------ [2009-01-30 23:15:48] ivan1986 at list dot ru Description: I test this in two version: i...@ivan1986:~% /usr/bin/php -v PHP 5.2.6-3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 25 2009 00:51:23) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with XCache v1.2.2, Copyright (c) 2005-2007, by mOo i...@ivan1986:~% php -v PHP 6.0.0-dev (cli) (built: Nov 8 2008 02:31:17) Copyright (c) 1997-2008 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2008 Zend Technologies in CVS error now. Reproduce code: --- getMethods(); print_r($m); ?> Expected result: Array ( [0] => ReflectionMethod Object ( [name] => b [class] => B ) [1] => ReflectionMethod Object ( [name] => a [class] => A ) ) Actual result: -- Array ( [0] => ReflectionMethod Object ( [name] => b [class] => B ) [1] => ReflectionMethod Object ( [name] => a [class] => B ) ) -- Edit this bug report at http://bugs.php.net/?id=47254&edit=1
#48697 [Com]: mb_internal_encoding() value gets reset in process
ID: 48697 Comment by: ivan1986 at list dot ru Reported By: glen at delfi dot ee Status: Open Bug Type: mbstring related Operating System: PLD Linux PHP Version: 5.2.10 New Comment: ISO-8859-1 UTF-8 ISO-8859-1 must by ISO-8859-1 UTF-8 UTF-8 Previous Comments: [2009-06-25 18:06:18] glen at delfi dot ee Description: setting mbstring internal encoding with mb_internal_encoding() function gets reset at some point with 5.2.10, and mb_strtolower() etc that are called without implicit charset will fail. (calling mb_strtolower() with 2 arguments will succeed. in other speak, such code fails: echo mb_internal_encoding(); -> prints ISO-8859-1 mb_internal_encoding('UTF-8'); echo mb_internal_encoding(); -> prints UTF-8 ... /// some code /// echo mb_internal_encoding(); -> prints ISO-8859-1 if i set the internal encoding via php.ini (ini_set() is fine too), then the problem does not occour. ie such code works ok: echo mb_internal_encoding(); -> prints ISO-8859-1 ini_set("mbstring.internal_encoding", 'UTF-8'); echo mb_internal_encoding(); -> prints UTF-8 ... /// that same code /// echo mb_internal_encoding(); -> prints UTF-8 I have not yet able to create exact php code that is exact reproducer, but the same php code, input data to php script, it works with 5.2.9 and when reverting this commit: http://www.mail-archive.com/php-cvs%40lists.php.net/msg40593.html from brief looking i see that there is some inconsistency, that one code sets the internal encoding from php.ini and the mb_internal_encoding() function does not update php.ini setting. -- Edit this bug report at http://bugs.php.net/?id=48697&edit=1
#49016 [NEW]: Pleace no generate Notice on ?:
From: ivan1986 at list dot ru Operating system: Linux PHP version: 5.3.0 PHP Bug Type: Feature/Change Request Bug description: Pleace no generate Notice on ?: Description: When using undefined variable in ?: php generate notice in php 5.2.x very often use this code $inp = isset($_POST['inp']) ? $_POST['inp'] : 'def_inp'; in php 5.3 want use a shorter code $inp = $_POST['inp'] ?: 'def_inp'; Reproduce code: --- Expected result: def_inp Actual result: -- Notice: Undefined index: inp in /path/to/to/index.php on line 3 def_inp -- Edit bug report at http://bugs.php.net/?id=49016&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49016&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49016&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49016&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49016&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49016&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49016&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49016&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49016&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49016&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49016&r=support Expected behavior: http://bugs.php.net/fix.php?id=49016&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49016&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49016&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49016&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49016&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49016&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49016&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49016&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49016&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49016&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49016&r=mysqlcfg
#47254 [NEW]: Wrong Reflection for extends class
From: ivan1986 at list dot ru Operating system: Linux Debian PHP version: 5.2.8 PHP Bug Type: Reflection related Bug description: Wrong Reflection for extends class Description: I test this in two version: i...@ivan1986:~% /usr/bin/php -v PHP 5.2.6-3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 25 2009 00:51:23) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies with XCache v1.2.2, Copyright (c) 2005-2007, by mOo i...@ivan1986:~% php -v PHP 6.0.0-dev (cli) (built: Nov 8 2008 02:31:17) Copyright (c) 1997-2008 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2008 Zend Technologies in CVS error now. Reproduce code: --- getMethods(); print_r($m); ?> Expected result: Array ( [0] => ReflectionMethod Object ( [name] => b [class] => B ) [1] => ReflectionMethod Object ( [name] => a [class] => A ) ) Actual result: -- Array ( [0] => ReflectionMethod Object ( [name] => b [class] => B ) [1] => ReflectionMethod Object ( [name] => a [class] => B ) ) -- Edit bug report at http://bugs.php.net/?id=47254&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47254&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47254&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47254&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47254&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47254&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47254&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47254&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47254&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47254&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47254&r=support Expected behavior: http://bugs.php.net/fix.php?id=47254&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47254&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47254&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47254&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47254&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=47254&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47254&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47254&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47254&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47254&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47254&r=mysqlcfg
Req #53610 [Com]: closure and static private class member
Edit report at http://bugs.php.net/bug.php?id=53610&edit=1 ID: 53610 Comment by: ivan1986 at list dot ru Reported by:sergey dot s dot betke at novgaro dot ru Summary:closure and static private class member Status: Open Type: Feature/Change Request Package:Class/Object related Operating System: Windows PHP Version:5.3.4 Block user comment: N Private report: N New Comment: class Filter { public function filter($value = '') { return function() use ($value) { return $value; }; } } class Test { private $_filter = null; public function test() { $filter = new Filter(); $this->_filter = $filter->filter(); echo 'filter data: ' . $this->_filter('my data'); //error $f = $this->_filter; echo 'filter data: ' . $f('my data'); //work } } $T= new Test(); $T->test(); http://www.askdev.ru/php/5450/ÐамÑканиÑ/ Previous Comments: [2010-12-26 00:28:19] sergey dot s dot betke at novgaro dot ru My article in Russian on this issue http://sergey-s-betke.blogs.novgaro.ru/lyambda-funkcii-zamykaniya-i-klassy-php";>http://sergey-s-betke.blogs.novgaro.ru/lyambda-funkcii-zamykaniya-i-klassy-php. [2010-12-26 00:19:09] sergey dot s dot betke at novgaro dot ru Description: just one example: class test { private static $_domain; static member() { add_settings_section( self::$_namespace . '_location_options', __('Location of your opensearch.xml file', self::$_domain), function () { ?> http://bugs.php.net/bug.php?id=53610&edit=1