Req #47785 [Opn-Csd]: get_included_files resolves symlinks
Edit report at https://bugs.php.net/bug.php?id=47785edit=1 ID: 47785 Updated by: krak...@php.net Reported by:andre at webkr dot de Summary:get_included_files resolves symlinks -Status: Open +Status: Closed Type: Feature/Change Request -Package:Feature/Change Request +Package:*General Issues Operating System: Linux PHP Version:5.2.9 -Assigned To: +Assigned To:krakjoe Block user comment: N Private report: N New Comment: Symlinks are resolved to their full paths because it's the only sensible thing to do. If your application requires the relative path, it should be no problem to discover it, being that if the path of the application is relevant information then you should have it in a variable/constant somewhere. This is a non-issue. Previous Comments: [2009-03-29 02:52:58] andre at webkr dot de It's even worse: When an included file includes another file using a relative path, that is looked up in the target directory of the symlink! It should be relative to the path where the symlink resides. The only access types that should treat the symlink in a special way are unlink (it should remove the symlink, not the target file) and chmod (it should do nothing). All other access types (especially the read involved here) should see the symlink as if it were a file with the content and attributes of the target file. [2009-03-26 04:04:41] andre at webkr dot de Description: When a symlink is included/required, get_included_files shows the target of the symlink. Together with Bug #46260 this makes it completely impossible to determine how the file was really called when it was included. Reproduce code: --- include('path_to/a_symlink.php'); var_dump(get_included_files()); Expected result: An array containing a string [...]/path_to/a_symlink.php. Actual result: -- An array containing a string [...]/some_file.php. -- Edit this bug report at https://bugs.php.net/bug.php?id=47785edit=1
Bug #64269 [Opn-Nab]: Reading conf files takes 30minutes
Edit report at https://bugs.php.net/bug.php?id=64269edit=1 ID: 64269 Updated by: krak...@php.net Reported by:phpfpm1 at gmail dot com Summary:Reading conf files takes 30minutes -Status: Open +Status: Not a bug Type: Bug Package:FPM related Operating System: CentOS 5.8 PHP Version:5.3.21 Block user comment: N Private report: N New Comment: This is expected, normal parsing routine. Previous Comments: [2013-02-21 18:27:29] phpfpm1 at gmail dot com Description: Hello, we have a lot of users on the system and reading php-fpm conf files is a bit weird. Why is it reading every byte? Checking every char looks like a bug. Test script: --- strace /usr/local/php53/sbin/php-fpm53 --fpm-config /usr/local/php53/etc/php-fpm.conf Expected result: Reading whole lines. Actual result: -- open(/usr/local/directadmin/data/users/test83/php/php-fpm53.conf, O_RDONLY) = 4 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, [, 1) = 1 read(4, t, 1) = 1 read(4, e, 1) = 1 read(4, s, 1) = 1 read(4, t, 1) = 1 read(4, 8, 1) = 1 read(4, 3, 1) = 1 read(4, ], 1) = 1 read(4, \n, 1)= 1 read(4, u, 1) = 1 read(4, s, 1) = 1 read(4, e, 1) = 1 read(4, r, 1) = 1 read(4, , 1) = 1 read(4, =, 1) = 1 read(4, , 1) = 1 read(4, $, 1) = 1 read(4, p, 1) = 1 read(4, o, 1) = 1 read(4, o, 1) = 1 read(4, l, 1) = 1 read(4, \n, 1)= 1 read(4, g, 1) = 1 read(4, r, 1) = 1 read(4, o, 1) = 1 read(4, u, 1) = 1 read(4, p, 1) = 1 read(4, , 1) = 1 read(4, =, 1) = 1 read(4, , 1) = 1 read(4, $, 1) = 1 read(4, p, 1) = 1 read(4, o, 1) = 1 read(4, o, 1) = 1 read(4, l, 1) = 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, l, 1) = 1 read(4, i, 1) = 1 read(4, s, 1) = 1 read(4, t, 1) = 1 read(4, e, 1) = 1 read(4, n, 1) = 1 read(4, , 1) = 1 read(4, =, 1) = 1 read(4, , 1) = 1 read(4, /, 1) = 1 read(4, t, 1) = 1 read(4, m, 1) = 1 read(4, p, 1) = 1 read(4, /, 1) = 1 read(4, f, 1) = 1 read(4, p, 1) = 1 read(4, m, 1) = 1 read(4, 5, 1) = 1 read(4, 3, 1) = 1 read(4, /, 1) = 1 read(4, $, 1) = 1 read(4, p, 1) = 1 read(4, o, 1) = 1 read(4, o, 1) = 1 read(4, l, 1) = 1 read(4, ., 1) = 1 read(4, s, 1) = 1 read(4, o, 1) = 1 read(4, c, 1) = 1 read(4, k, 1) = 1 read(4, \n, 1)= 1 read(4, \n, 1)= 1 read(4, p, 1) = 1 read(4, m, 1) = 1 read(4, , 1) = 1 read(4, =, 1) = 1 read(4, , 1) = 1 read(4, d, 1) = 1 read(4, y, 1) = 1 read(4, n, 1) = 1 read(4, a, 1) = 1 read(4, m, 1) = 1 read(4, i, 1) = 1 read(4, c, 1) = 1 read(4, \n, 1)= 1 read(4, p, 1) = 1 read(4, m, 1) = 1 read(4, ., 1) = 1 read(4, m, 1) = 1 read(4, a, 1)
Doc-Bug #65441 [Opn]: configure help not correct (--enable-fastcgi)
Edit report at https://bugs.php.net/bug.php?id=65441edit=1 ID: 65441 Updated by: krak...@php.net Reported by:joe at winett dot com Summary:configure help not correct (--enable-fastcgi) Status: Open -Type: Documentation Problem +Type: Bug -Package:Documentation problem +Package:*Configuration Issues PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Can someone with enough (historical) knowledge of configure please update this information in the manual. While it is a documentation problem, it requires the knowledge of a core contributor that has been around a while. Previous Comments: [2013-08-13 13:47:39] joe at winett dot com Description: --- From manual page: http://www.php.net/configure.about --- --enable-fastcgi description states that as of 5.3.0 you must use --enable-cgi instead, but actually it's --disable-cgi to enable fastcgi -- Edit this bug report at https://bugs.php.net/bug.php?id=65441edit=1
Doc-Req #65503 [Opn]: Timeout when max_children reached
Edit report at https://bugs.php.net/bug.php?id=65503edit=1 ID: 65503 Updated by: krak...@php.net Reported by:admin at 3dr dot org Summary:Timeout when max_children reached Status: Open -Type: Documentation Problem +Type: Feature/Change Request Package:FPM related Operating System: FreeBSD 9.1 PHP Version:5.4.18 Block user comment: N Private report: N New Comment: This should have the attention of developers, it appears to be a feature request. Previous Comments: [2013-08-22 13:48:23] admin at 3dr dot org Description: I couldn't found if there is any param to specify a timeout after which FPM will return some error when there is no children left (reached max_children). There should be some timeout ofert which FPM will deny request and return error to the client. Changing timeout on client side is not an option. -- Edit this bug report at https://bugs.php.net/bug.php?id=65503edit=1
Bug #65665 [Opn]: Exception not properly caught when opcache enabled
Edit report at https://bugs.php.net/bug.php?id=65665edit=1 ID: 65665 Updated by: krak...@php.net Reported by:ryan dot brothers at gmail dot com Summary:Exception not properly caught when opcache enabled Status: Open Type: Bug Package:opcache Operating System: Linux PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Assuming Previous Comments: [2013-09-13 17:16:34] Danack at basereality dot com Running with -d opcache.optimization_level=0xfffd shows the correct behaviour. That flag is the equivalent to turning on all optimizations except: 'ZEND_OPTIMIZER_PASS_2' /* Constant conversion and jumps */ [2013-09-13 15:31:05] jpa...@php.net This is an optimizer bug. If you run with opcache.optimization_level=0 , the bug disappears. I guess the bug is in the optimizer pass that handles ZEND_CATCH. PS : I reproduced with a 5.4 base. [2013-09-13 00:15:06] ryan dot brothers at gmail dot com Description: When running the following script with opcache enabled, the exception is not caught by the correct catch block. The exception should be caught by the 'caught by 1' block, but it is instead caught by the 'caught by 2' block. Disabling opcache causes the exception to be caught in the correct block. Run the script with: php -n -d zend_extension=opcache.so -d opcache.enable_cli=1 script.php Test script: --- ?php try { switch (1) { case 0: try { } catch (Exception $e) { } break; case 1: try { throw new Exception('aaa'); } catch (Exception $e) { echo 'caught by 1'; exit; } break; } } catch (Exception $e) { echo 'caught by 2'; exit; } Expected result: caught by 1 Actual result: -- caught by 2 -- Edit this bug report at https://bugs.php.net/bug.php?id=65665edit=1
Bug #65665 [Opn]: Exception not properly caught when opcache enabled
Edit report at https://bugs.php.net/bug.php?id=65665edit=1 ID: 65665 Updated by: krak...@php.net Reported by:ryan dot brothers at gmail dot com Summary:Exception not properly caught when opcache enabled Status: Open Type: Bug Package:opcache Operating System: Linux PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Assuming we are just going to disable unsafe optimizations, PR #450 should do it ??? Previous Comments: [2013-09-14 06:50:50] krak...@php.net Assuming [2013-09-13 17:16:34] Danack at basereality dot com Running with -d opcache.optimization_level=0xfffd shows the correct behaviour. That flag is the equivalent to turning on all optimizations except: 'ZEND_OPTIMIZER_PASS_2' /* Constant conversion and jumps */ [2013-09-13 15:31:05] jpa...@php.net This is an optimizer bug. If you run with opcache.optimization_level=0 , the bug disappears. I guess the bug is in the optimizer pass that handles ZEND_CATCH. PS : I reproduced with a 5.4 base. [2013-09-13 00:15:06] ryan dot brothers at gmail dot com Description: When running the following script with opcache enabled, the exception is not caught by the correct catch block. The exception should be caught by the 'caught by 1' block, but it is instead caught by the 'caught by 2' block. Disabling opcache causes the exception to be caught in the correct block. Run the script with: php -n -d zend_extension=opcache.so -d opcache.enable_cli=1 script.php Test script: --- ?php try { switch (1) { case 0: try { } catch (Exception $e) { } break; case 1: try { throw new Exception('aaa'); } catch (Exception $e) { echo 'caught by 1'; exit; } break; } } catch (Exception $e) { echo 'caught by 2'; exit; } Expected result: caught by 1 Actual result: -- caught by 2 -- Edit this bug report at https://bugs.php.net/bug.php?id=65665edit=1
Bug #64504 [Opn]: Forward reference of a class with interface
Edit report at https://bugs.php.net/bug.php?id=64504edit=1 ID: 64504 Updated by: krak...@php.net Reported by:rstoll at tutteli dot ch Summary:Forward reference of a class with interface Status: Open Type: Bug Package:Class/Object related PHP Version:5.4.13 Block user comment: N Private report: N New Comment: I concur. Previous Comments: [2013-03-25 06:36:50] larue...@php.net always declare before use(or use autoload mechanism)... this is the current implementation, I don't think it's need to be fixed. [2013-03-24 15:56:15] rstoll at tutteli dot ch Description: My PHP version is 5.4.7 forward references of classes do not work if the class implements an interface. Test script: --- $a = new Ok(); //that's ok class OK{} $a = new Fail(); //fails interface I{} class Fail implements I{} Expected result: I would expect that forward references are also supported for classes which implement an interface -- Edit this bug report at https://bugs.php.net/bug.php?id=64504edit=1
Bug #64504 [Opn-Nab]: Forward reference of a class with interface
Edit report at https://bugs.php.net/bug.php?id=64504edit=1 ID: 64504 Updated by: krak...@php.net Reported by:rstoll at tutteli dot ch Summary:Forward reference of a class with interface -Status: Open +Status: Not a bug Type: Bug Package:Class/Object related PHP Version:5.4.13 Block user comment: N Private report: N New Comment: Closing as not a bug, before it gets lost to time and becomes another number in a stack of non-bugs. Previous Comments: [2013-03-25 08:10:43] krak...@php.net I concur. [2013-03-25 06:36:50] larue...@php.net always declare before use(or use autoload mechanism)... this is the current implementation, I don't think it's need to be fixed. [2013-03-24 15:56:15] rstoll at tutteli dot ch Description: My PHP version is 5.4.7 forward references of classes do not work if the class implements an interface. Test script: --- $a = new Ok(); //that's ok class OK{} $a = new Fail(); //fails interface I{} class Fail implements I{} Expected result: I would expect that forward references are also supported for classes which implement an interface -- Edit this bug report at https://bugs.php.net/bug.php?id=64504edit=1
Bug #64485 [Opn-Fbk]: Issue in Configuring 32bit PHP5.3.22 in RHEL 6.0
Edit report at https://bugs.php.net/bug.php?id=64485edit=1 ID: 64485 Updated by: krak...@php.net Reported by:viswanathan dot saravanan at wipro dot com Summary:Issue in Configuring 32bit PHP5.3.22 in RHEL 6.0 -Status: Open +Status: Feedback Type: Bug Package:*Configuration Issues Operating System: RHEL 6.2 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: We await feedback Previous Comments: [2013-03-22 18:52:39] krak...@php.net Have you tried --with-libdir=lib and or --libdir=/usr/lib ? [2013-03-22 07:57:12] viswanathan dot saravanan at wipro dot com Description: Am trying to Configure 32bit PHP5.3.22 in RHEL 6.0 but its throwing the below error checking libxml2 install dir... no checking for xml2-config path... /usr/bin/xml2-config checking whether libxml build works... no configure: error: build test failed. where we have already installed libxml2.x86_64 2.7.6-4.el6_2.1@tsl-620-rhel-x86_64-server-6 libxml2-devel.x86_642.7.6-4.el6_2.1@tsl-620-rhel-x86_64-server-6 libxml2-python.x86_64 2.7.6-4.el6_2.1@tsl-620-rhel-x86_64-server-6 libxml2.i6862.7.6-4.el6_2.1tsl-620-rhel-x86_64-server-6 libxml2-devel.i686 2.7.6-4.el6_2.1tsl-620-rhel-x86_64-server-6 zlib.i686 1.2.3-27.el6 @tsl-620-rhel-x86_64-server-6 zlib.x86_64 1.2.3-27.el6 @anaconda- RedHatEnterpriseLinux-20171049.x86_64/6.2 zlib-devel.x86_64 1.2.3-27.el6 @tsl-620-rhel-x86_64-server-6 jzlib.x86_641.0.7-7.5.el6 tsl-620-rhel-x86_64-server-6 zlib-devel.i686 1.2.3-27.el6 tsl-620-rhel-x86_64-server-6 we have all the 32 bit files in /usr/lib/ libxml2.so.2 ,libz.so.1 files also but still its showing error in configuring. -- Edit this bug report at https://bugs.php.net/bug.php?id=64485edit=1
Bug #64164 [Opn-Dup]: array_slice function
Edit report at https://bugs.php.net/bug.php?id=64164edit=1 ID: 64164 Updated by: krak...@php.net Reported by:ajaydixxit at gmail dot com Summary:array_slice function -Status: Open +Status: Duplicate Type: Bug Package:Arrays related Operating System: redhat enterprises 6 PHP Version:5.3.21 Block user comment: N Private report: N New Comment: Duplicate #64143 Previous Comments: [2013-02-06 16:53:58] ajaydixxit at gmail dot com Description: --- From manual page: http://www.php.net/function.array-slice#refsect1-function.array-slice-description --- I declared an array my_array with different offset value. In my case its offset value is 1. So my_array[0] is not defined. Now when I After that, i used the predefined function array_slice. In array_slice i entered 1 and 3 as the offset value and required length value. Now as print the sliced array, it should display: shiva hanu bhrama but what i am experiencing is : vishnu shiva hanu. It seems like that the array_slice function is not aware of the offset value change in the array. Test script: --- ?php $my_array = array( 1 = vishnu , shiva , hanu , bhrama ); print_r($my_array); echo $my_array[0]; // this is coming undefined // $slice = array_slice($my_array,1,3); print_r($slice); ? -- Edit this bug report at https://bugs.php.net/bug.php?id=64164edit=1
Bug #64145 [Opn-Nab]: preg_match return false for using (\$)
Edit report at https://bugs.php.net/bug.php?id=64145edit=1 ID: 64145 Updated by: krak...@php.net Reported by:mrsnikivan at gmail dot com Summary:preg_match return false for using (\$) -Status: Open +Status: Not a bug Type: Bug Package:PCRE related Operating System: window PHP Version:5.3.21 Block user comment: N Private report: N New Comment: The pattern you gave is never going to match the token provided, [A-Ia-i] will never match sum; I assume the token has been provided incorrect: ?php $token='$a1:$a1'; var_dump(preg_match(/^(\\$)?[A-Ia-i]?[A-Za-z](\\$)?[0-9]+:(\\$)?[A-Ia-i]?[A-Za- z](\\$)?[0-9]+$/,$token, $matches)); print_r($matches); ? You need to escape $ twice when using double quotes. ?php $token='$a1:$a1'; var_dump(preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z] (\$)?[0-9]+$/',$token, $matches)); print_r($matches); ? Both examples function as expected. Previous Comments: [2013-02-04 19:30:36] mrsnikivan at gmail dot com Description: I using worksheet de pear(library parse.php, found problem for preg_match) $token='=sum($a1:$a1); if (preg_match(/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/,$token)) { ... } no true $token='=sum(a1:a1); if (preg_match(/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/,$token)) { ... } is true Test script: --- $ change another different character and no problem sample @ $token='=sum(@a1:@a1); if (preg_match(/^(\@)?[A-Ia-i]?[A-Za-z](\@)?[0-9]+:(\@)?[A-Ia-i]?[A-Za-z](\@)?[0-9]+$/,$token)) { ... } After trying other caracters I found that the problem is that the $ replace internal a point (.) character 46 $token='=sum($a1:$a1); if (preg_match(/^(.)?[A-Ia-i]?[A-Za-z](.)?[0-9]+:(.)?[A-Ia-i]?[A-Za-z](.)?[0-9]+$/,$token)) { ... } here if there was affirmative result for dollar ($) and point (.) Expected result: true for (\$) for preg_match Actual result: -- false for (\$) for preg_match -- Edit this bug report at https://bugs.php.net/bug.php?id=64145edit=1
Bug #64143 [Opn-Nab]: problem in array_slice function
Edit report at https://bugs.php.net/bug.php?id=64143edit=1 ID: 64143 Updated by: krak...@php.net Reported by:ajaydixit91 at gmail dot com Summary:problem in array_slice function -Status: Open +Status: Not a bug Type: Bug Package:Arrays related Operating System: redhat enterprise linux 6 PHP Version:5.3.21 Block user comment: N Private report: N New Comment: In your example, the fact that you have instructed the array to begin at offset 1 has no bearing on the result of the call to array_slice, observe: ?php $my = array(other, vishnu , shiva , hanu , bhrama ); print_r($my); print_r(array_slice($my, 1, 3)); ? You are explicitly instructing the call to array slice to start at offset 1 (vishnu), and return three elements: vishnu shiva hanu is the only outcome possible regardless of the contents of an offset not referenced. Previous Comments: [2013-02-04 16:43:10] ajaydixit91 at gmail dot com Description: --- From manual page: http://www.php.net/function.array-slice#refsect1-function.array-slice-description --- I encountered this bug in array_slice() function. Here is what i encountered. I declared an array my_array with different offset value. In my case its offset value is 1. So my_array[0] is not defined. Now when I After that, i used the predefined function array_slice. In array_slice i entered 1 and 3 as the offset value and required length value. Now as print the sliced array, it should display: shiva hanu bhrama but what i am experiencing is : vishnu shiva hanu. It seems like that the array_slice function is not aware of the offset value change in the array. Test script: --- ?php $my_array = array( 1 = vishnu , shiva , hanu , bhrama ); print_r($my_array); echo $my_array[0]; // this is coming undefined // $slice = array_slice($my_array,1,3); print_r($slice); ? -- Edit this bug report at https://bugs.php.net/bug.php?id=64143edit=1
Req #63837 [Opn-Nab]: Privater abstract functions
Edit report at https://bugs.php.net/bug.php?id=63837edit=1 ID: 63837 Updated by: krak...@php.net Reported by:larry at ldrutlege dot com Summary:Privater abstract functions -Status: Open +Status: Not a bug Type: Feature/Change Request Package:Class/Object related PHP Version:5.4.10 Block user comment: N Private report: N New Comment: The page referenced concerns migration from 5.0 to 5.1 None of this is relevant. Previous Comments: [2012-12-22 19:51:15] larry at ldrutlege dot com Actually not misspelled per se, but spelled according to British spelling whereas the English site seems to primarily use American spelling. [2012-12-22 19:47:53] larry at ldrutlege dot com Description: From the page http://php.net/manual/en/migration51.oop.php Abstract private methods were supported between PHP 5.0.0 and PHP 5.0.4, but were then disallowed on the grounds that the behaviours of private and abstract are mutually exclusive. This was true in PHP 5.3 and earlier since any method declared abstract private could not be accessed outside the declaring class and so the definition was without function. In PHP 5.4 and later however, traits may have access to private methods of a class and so an abstract private definition may have a purpose. For instance, traits may have need of helper methods which may be needed only by the trait's methods and nowhere else. In those cases, an abstract private method may be the appropriate declaration to place in the trait to ensure the helper method is defined in the using class. Abstract private methods however remain useless except within traits, so within traits is the only place they need to be permitted. And as an aside, the word behaviors is misspelled on that page. -- Edit this bug report at https://bugs.php.net/bug.php?id=63837edit=1
Bug #64067 [Opn-Nab]: to email address messed up
Edit report at https://bugs.php.net/bug.php?id=64067edit=1 ID: 64067 Updated by: krak...@php.net Reported by:erikv3 at gmx dot net Summary:to email address messed up -Status: Open +Status: Not a bug Type: Bug Package:*Mail Related PHP Version:5.3.21 Block user comment: N Private report: N New Comment: This is a result of misuse. Please see section 2.2 of the appropriate RFC: http://www.faqs.org/rfcs/rfc2822.html Previous Comments: [2013-01-25 08:28:35] erikv3 at gmx dot net Description: --- From manual page: http://www.php.net/function.mail#refsect1-function.mail- parameters --- Test script: --- $send_status = mail(test 1:2:3:4:5:6:7:8:9 eri...@gmx.net, strange name test, hi); Expected result: an email with in the to field: test 1:2:3:4:5:6:7:8:9 eri...@gmx.net Actual result: -- this is the actual to: t...@roadrunner.nedlinux.com, 1:2:3:4:5:6:7:8@roadrunner.nedlinux.com:9 eri...@gmx.net -- Edit this bug report at https://bugs.php.net/bug.php?id=64067edit=1
Req #64054 [Opn-Csd]: Alternative syntax to access, replace, count a portion of a string or an array
Edit report at https://bugs.php.net/bug.php?id=64054edit=1 ID: 64054 Updated by: krak...@php.net Reported by:reptilien dot 19831209be1 at gmail dot com Summary:Alternative syntax to access, replace, count a portion of a string or an array -Status: Open +Status: Closed Type: Feature/Change Request Package:Output Control PHP Version:Irrelevant -Assigned To: +Assigned To:krakjoe Block user comment: N Private report: N New Comment: I'm going to close the report, because this isn't a bug but a feature request. It's also a request likely to be shot down by the development community, still all is not lost ... ?php class CleverString implements ArrayAccess { public $string; public function __construct($string) { $this-string = $string; } public function offsetSet($key, $value) { } public function offsetGet($key) { if (($break = strpos($key, :))) { return substr( $this-string, (int) substr($key, 0, $break), (int) substr($key, $break+1) ); } else return substr($this-string, $key); } public function offsetExists($key) { } public function offsetUnset($key) { } } $my = new CleverString(abcdefghi); printf(\$my[0:5]=%s\n, $my[0:5]); printf(\$my[:5]=%s\n, $my[0:5]); printf(\$my[0:-1]=%s\n, $my[0:-1]); printf(\$my[1:2]=%s\n, $my[1:2]); printf(\$my[-2]=%s\n, $my[-2]); printf(\$my[-3:1]=%s\n, $my[-3:1]); ? Not a complete implementation, I got bored, but a proof of concept that all you want to do is achievable in user land without much effort. Previous Comments: [2013-01-23 09:38:35] reptilien dot 19831209be1 at gmail dot com Description: This is a simply and intuitive proposition to access or replace a part of a string or an array. This syntax from partly shell script syntax. We can extend this proposition for a simply way to count the number of characteres of a string or elements of an array. Test script: --- $str = abcdefghi; $arr = array(j, k, l, m, n); $arr1= array(j, k, array(l, m), n, o); Expected result: --- Propositions : --- 1. Alternative to substr $str[0:5] // return 'abcde' $str[:5] // return 'abcde' (the same as above) $str[0:-1] // the same as $str $str[1:2] // return 'bc' $str[-2] // return 'hi' $str[-3:1] // return 'g' 2. Alternative to substr_replace $str[0:5]=jklmn; // $str is now 'jklmnfghi' $str[:5]=jklmn; // $str is now 'jklmnfghi' (the same as above) $str[-5]=j; // $str is now 'abcdjfghi' $str[-5]=jklmn; // $str is now 'abcdjklmn' $str[-5]=jklmnopqr; // $str is now 'abcdjklmn', the rest is ignored 3. Alternative to array_slice() $arr[0:4] // return 'j', 'k', 'l', 'm' $arr[:4] // return 'j', 'k', 'l', 'm' (the same as above) $arr[0:-1] // the same as $arr $arr[-2] // return 'm', 'n' (if key -2 doesn't exist) $arr[-2:2] // force to return 'm', 'n' (without ambiguation) $arr[-3:1] // return 'l' $arr1[2:2] // return ('l', 'm'), 'n' $arr1[2:2][0] // return ('l', 'm') $arr1[2:2][1] // return 'n' 4. Alternative to array_replace() $arr[0:4]=array('a', 'b', 'c', 'd'); // $arr is now 'a', 'b', 'c', 'd', 'n' $arr[-2]=array('a', 'b'); // $arr is now 'j', 'k', 'l', 'a', 'b' (if key -2 doesn't exist) $arr[-2:2]=array('a', 'b'); // $arr is now 'j', 'k', 'l', 'a', 'b' (forced method, without ambiguation) $arr1[-3:2]=array(array('x', 'y'), 'z'); // $arr1 is now 'j', 'k', ('x', 'y'), 'z', 'o' $arr1[-3:2]=array(array('x', 'y'), 'z', 'a'); // $arr1 is now 'j', 'k', ('x', 'y'), 'z', 'o' (the rest is ignored) 5. Alternative to strlen() and count() note: in shell script, # is used to count the number of chararacters in a string; in php # is used for comments (we need an other symbol) $str[#] // musn't be used $str[?] // return 9 $arr[?] // return 5 $arr[1:-1:?] // return 4 (equivalent at count($arr)-1) Actual result: -- --- Actual results : --- $str[0]; // return a $arr[0]; // return j $arr1[2]; // return ('l', 'm') $str[0]=x; // $str is now xbcdefghi $str[3]=xyz; // $str is now 'abcxefghi' // the rest 'yz' is ignored $arr[-1]=x; // $arr is now 'j', 'k', 'l', 'm', 'n', -1='x' --- Actual errors/warnings : --- $str[-1] // PHP Warning: Illegal string offset: -1 (should return 'i') $arr[-1] // PHP Notice: Undefined offset: -1 (should return 'n' if key -1 doesn't exist) $arr[-1:1] // PHP Parse error: syntax error, unexpected ':', expecting ']' (should return 'n', none ambiguation) -- Edit this bug report at https://bugs.php.net/bug.php
Bug #64014 [Opn-Nab]: 10 second delay in returning file_get_contents('php://input')
Edit report at https://bugs.php.net/bug.php?id=64014edit=1 ID: 64014 Updated by: krak...@php.net Reported by:dagan at digitalconversations dot tv Summary:10 second delay in returning file_get_contents('php://input') -Status: Open +Status: Not a bug Type: Bug Package:Apache2 related Operating System: ubuntu 12+ PHP Version:5.3.21 Block user comment: N Private report: N New Comment: This is not a bug in PHP, it's a bug in the client that sent the incorrect Content-Length header. Previous Comments: [2013-01-17 23:29:48] dagan at digitalconversations dot tv Description: If an invalid Content-Length header is sent with a request, attempting to read the request body via file_get_contents('php://input') results in a delay of 10 seconds while, I assume, a timeout is waited on. -- Edit this bug report at https://bugs.php.net/bug.php?id=64014edit=1
Req #64054 [Csd]: Alternative syntax to access, replace, count a portion of a string or an array
Edit report at https://bugs.php.net/bug.php?id=64054edit=1 ID: 64054 Updated by: krak...@php.net Reported by:reptilien dot 19831209be1 at gmail dot com Summary:Alternative syntax to access, replace, count a portion of a string or an array Status: Closed Type: Feature/Change Request Package:Output Control PHP Version:Irrelevant Assigned To:krakjoe Block user comment: N Private report: N New Comment: You done everything right, I didn't see it was marked as a feature request. The reason I said it would be shot down is, look at the errors you have there, there's one in the parser and a few from execution. If this were a supported syntax it could negatively impact the parsing of array manipulation and access instructions globally. Write less and do more is right, but it's not always appropriate for everything cool to be a core feature or normal practice. So write once, and re-use can also be a good way forward :) Previous Comments: [2013-01-24 16:27:51] reptilien dot 19831209be1 at gmail dot com Thanks for the reply ;) It's my first report, I'm not yet familiar with the repport/request system. So excuse me if I posted in the bad place. I've chosen Feature/Change Request in the Bug type section. Wasn't is the good way? About the request/proposition, I believe that it is not more useless than the shorter syntax array recently adopted in version 5.4. Write Less, Do More... Thanks for your part of implementation. [2013-01-24 12:53:40] krak...@php.net I'm going to close the report, because this isn't a bug but a feature request. It's also a request likely to be shot down by the development community, still all is not lost ... ?php class CleverString implements ArrayAccess { public $string; public function __construct($string) { $this-string = $string; } public function offsetSet($key, $value) { } public function offsetGet($key) { if (($break = strpos($key, :))) { return substr( $this-string, (int) substr($key, 0, $break), (int) substr($key, $break+1) ); } else return substr($this-string, $key); } public function offsetExists($key) { } public function offsetUnset($key) { } } $my = new CleverString(abcdefghi); printf(\$my[0:5]=%s\n, $my[0:5]); printf(\$my[:5]=%s\n, $my[0:5]); printf(\$my[0:-1]=%s\n, $my[0:-1]); printf(\$my[1:2]=%s\n, $my[1:2]); printf(\$my[-2]=%s\n, $my[-2]); printf(\$my[-3:1]=%s\n, $my[-3:1]); ? Not a complete implementation, I got bored, but a proof of concept that all you want to do is achievable in user land without much effort. [2013-01-23 09:38:35] reptilien dot 19831209be1 at gmail dot com Description: This is a simply and intuitive proposition to access or replace a part of a string or an array. This syntax from partly shell script syntax. We can extend this proposition for a simply way to count the number of characteres of a string or elements of an array. Test script: --- $str = abcdefghi; $arr = array(j, k, l, m, n); $arr1= array(j, k, array(l, m), n, o); Expected result: --- Propositions : --- 1. Alternative to substr $str[0:5] // return 'abcde' $str[:5] // return 'abcde' (the same as above) $str[0:-1] // the same as $str $str[1:2] // return 'bc' $str[-2] // return 'hi' $str[-3:1] // return 'g' 2. Alternative to substr_replace $str[0:5]=jklmn; // $str is now 'jklmnfghi' $str[:5]=jklmn; // $str is now 'jklmnfghi' (the same as above) $str[-5]=j; // $str is now 'abcdjfghi' $str[-5]=jklmn; // $str is now 'abcdjklmn' $str[-5]=jklmnopqr; // $str is now 'abcdjklmn', the rest is ignored 3. Alternative to array_slice() $arr[0:4] // return 'j', 'k', 'l', 'm' $arr[:4] // return 'j', 'k', 'l', 'm' (the same as above) $arr[0:-1] // the same as $arr $arr[-2] // return 'm', 'n' (if key -2 doesn't exist) $arr[-2:2] // force to return 'm', 'n' (without ambiguation) $arr[-3:1] // return 'l' $arr1[2:2] // return ('l', 'm'), 'n' $arr1[2:2][0] // return ('l', 'm') $arr1[2:2][1] // return 'n' 4. Alternative to array_replace() $arr[0:4]=array('a', 'b', 'c', 'd'); // $arr is now 'a', 'b', 'c', 'd', 'n' $arr[-2]=array('a', 'b'); // $arr is now 'j', 'k', 'l', 'a', 'b' (if key -2 doesn't exist) $arr[-2:2]=array('a', 'b'); // $arr is now 'j', 'k', 'l', 'a', 'b' (forced method, without ambiguation) $arr1[-3:2]=array(array('x', 'y'), 'z'); // $arr1 is now 'j', 'k', ('x', 'y'), 'z
Bug #64057 [Opn]: substr_replace failed charset utf-8
Edit report at https://bugs.php.net/bug.php?id=64057edit=1 ID: 64057 Updated by: krak...@php.net Reported by:ltsujiguchi at gmail dot com Summary:substr_replace failed charset utf-8 Status: Open Type: Bug Package:Strings related Operating System: Ubuntu 12.10 PHP Version:5.4.11 Block user comment: N Private report: N New Comment: [joe@fiji php-5.4.6]$ nano 64057.php [joe@fiji php-5.4.6]$ sapi/cli/php 64057.php noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é% Anyone else ?? Previous Comments: [2013-01-23 17:54:21] ltsujiguchi at gmail dot com Description: I had a problem when i used the substr_replace, using those changes os php.ini: I couldn't find the exact version of my php on the drop, so i put the closest version, but my real version is the 5.4.6. Result expected: noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é% Result returned: noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE%é%? Test script: --- $replacement = '%é%'; $cond = 'noticia.noticia_titulo LIKE ? OR noticia.noticia_conteudo LIKE ?'; $posItem = stripos($cond, '?'); $cond = substr_replace($cond, $replacement, $posItem, 1); $posItem = stripos($cond, '?'); $cond = substr_replace($cond, $replacement, $posItem, 1); echo $cond; -- Edit this bug report at https://bugs.php.net/bug.php?id=64057edit=1
Req #63841 [Nab]: Mind the constructor return value
Edit report at https://bugs.php.net/bug.php?id=63841edit=1 ID: 63841 Updated by: krak...@php.net Reported by:paxcoder+phpnet at gmail dot com Summary:Mind the constructor return value Status: Not a bug Type: Feature/Change Request Package:Class/Object related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: No you're code doesn't have bugs, or unexpected behavior. It is simply wrong. As I said, a constructor's job is not to return a value but to construct an object: To implement a check to ensure it is being used correctly would cost every object that PHP ever constructs and would be detrimental and pointless. Simply revise your code. Previous Comments: [2012-12-31 01:41:46] paxcoder+phpnet at gmail dot com The check is useful to the programmer, and it should be possible to preform it statically. As for the alternative - enabling returning arbitrary values - it could be convenient as well. However, I agree that it is unorthodox. Not a bug. My code doesn't have bugs, it has unexpected features. [2012-12-30 15:45:45] krak...@php.net The job of a constructor is not to return a value but to construct an object, this is implicit in the implementation and associated keywords. For example, one cannot call $var=stdClass::__construct(), because they are not, and cannot be static functions. Making such a check is completely unnecessary and costly. Not a bug. [2012-12-23 16:20:35] paxcoder+phpnet at gmail dot com Description: As-is, returning values in the constructor has no effect, and the class instance is returned instead. Either allow for explicitly returned values to supersede the object, or warn about trying to return a value from a constructor. Test script: --- ?php error_reporting(E_ALL|E_STRICT); class C { function __construct() { return NULL; } } $c = new C; print_r($c); ? Expected result: Either a warning at line 10, or $c set to NULL Actual result: -- No warning, and $c set to a C Object -- Edit this bug report at https://bugs.php.net/bug.php?id=63841edit=1
Req #63834 [Opn]: Add a function to detect a methods calling context
Edit report at https://bugs.php.net/bug.php?id=63834edit=1 ID: 63834 Updated by: krak...@php.net Reported by:tolan333 at gmail dot com Summary:Add a function to detect a methods calling context Status: Open Type: Feature/Change Request Package:Class/Object related Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I think it makes sense to provide the scope which calls a method. Beyond this is application specific, I have suggested a patch that provides the name like the associated methods. Previous Comments: [2012-12-31 11:11:54] krak...@php.net The following patch has been added/updated: Patch Name: 63834.patch Revision: 1356952314 URL: https://bugs.php.net/patch-display.php?bug=63834patch=63834.patchrevision=1356952314 [2012-12-22 15:46:44] tolan333 at gmail dot com Description: Currently it is hard to get to know the exact context from which a method is called from. Sure, there is debug_backtrace and the Reflection API, but these are no ideal nor complete and reliable solutions. I suggest to introduce a new function: get_calling_context (similar to get_calling_class). A possible use-case is shown below Possible return values could be: ?php const PHP_CONTEXT_PRIVATE = ?, // Method was called from the class it is defined in. PHP_CONTEXT_INHERITED = ?, // Method was called from a class inheriting the defining class. PHP_CONTEXT_EXTERN_USER = ?, // Method was called from outside the class, but in userland code PHP_CONTEXT_EXTERN_CORE = ?; // Method was called from outside, but was used as callback (Session handler, error handler, any predefined function awaiting a callback ? Use case: Currently I use virtual properties (via __get and __set) to validate and manipulate properties data while still keeping the ability to iterate over the entire object(implementing IteratorAggregate). This allows me also to have different visibility states for accessors (which will hopefully be supported in 5.5 without having to rely on custom implementations) but not for the properties themself. Simplified __set implementation: ?php public function __set($name, $value) { // called from wrong context if (\property_exists($this, $name)) { if (\method_exists($this, 'set' . \ucfirst($name))) { return $this-{'set' . \ucfirst($name)}($value); } else { throw new WritePropertyFromWrongContextException(virtual property $name can not be accessed from this context); } } elseif (\method_exists($this, 'set' . \ucfirst($name))) { return $this-{'set' . \ucfirst($name)}($value); } elseif ($this-objectConfiguration['accessMapAsProps'] == true $this-offsetExists($name)) { $this[$name] = $this-createPropertyValidator($name)-validate($value,$this-getRuleSet()[$name])-getValidatedValue(); } else { throw new WriteNonExistingPropertyException(Virtual property \$$name does not exist in class . \get_class($this)); } } ? There is no possibility to react on different scenarios as there can be only one __set which is either public,protected or private. There is no option to implement different behaviors for different visibility. Another usecase is the usage of object callbacks in handlers like session.set.save.handler For example the write callback does not (per documentation) output data. However in debug scenarios and in unit-tests it would be ideal to know if the method was called from the core as a usual session handler or in a different scenario in usercode. Additionally this would go inline with already existing functions like get_called_class, get_parent_class and partly get_class. -- Edit this bug report at https://bugs.php.net/bug.php?id=63834edit=1
Req #63834 [Opn]: Add a function to detect a methods calling context
Edit report at https://bugs.php.net/bug.php?id=63834edit=1 ID: 63834 Updated by: krak...@php.net Reported by:tolan333 at gmail dot com Summary:Add a function to detect a methods calling context Status: Open Type: Feature/Change Request Package:Class/Object related Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: -2 will provide get_calling_method and get_calling_class, I think that's everything you should need Previous Comments: [2012-12-31 11:36:48] krak...@php.net The following patch has been added/updated: Patch Name: 63834-2.patch Revision: 1356953808 URL: https://bugs.php.net/patch-display.php?bug=63834patch=63834-2.patchrevision=1356953808 [2012-12-31 11:19:32] krak...@php.net I think it makes sense to provide the scope which calls a method. Beyond this is application specific, I have suggested a patch that provides the name like the associated methods. [2012-12-31 11:11:54] krak...@php.net The following patch has been added/updated: Patch Name: 63834.patch Revision: 1356952314 URL: https://bugs.php.net/patch-display.php?bug=63834patch=63834.patchrevision=1356952314 [2012-12-22 15:46:44] tolan333 at gmail dot com Description: Currently it is hard to get to know the exact context from which a method is called from. Sure, there is debug_backtrace and the Reflection API, but these are no ideal nor complete and reliable solutions. I suggest to introduce a new function: get_calling_context (similar to get_calling_class). A possible use-case is shown below Possible return values could be: ?php const PHP_CONTEXT_PRIVATE = ?, // Method was called from the class it is defined in. PHP_CONTEXT_INHERITED = ?, // Method was called from a class inheriting the defining class. PHP_CONTEXT_EXTERN_USER = ?, // Method was called from outside the class, but in userland code PHP_CONTEXT_EXTERN_CORE = ?; // Method was called from outside, but was used as callback (Session handler, error handler, any predefined function awaiting a callback ? Use case: Currently I use virtual properties (via __get and __set) to validate and manipulate properties data while still keeping the ability to iterate over the entire object(implementing IteratorAggregate). This allows me also to have different visibility states for accessors (which will hopefully be supported in 5.5 without having to rely on custom implementations) but not for the properties themself. Simplified __set implementation: ?php public function __set($name, $value) { // called from wrong context if (\property_exists($this, $name)) { if (\method_exists($this, 'set' . \ucfirst($name))) { return $this-{'set' . \ucfirst($name)}($value); } else { throw new WritePropertyFromWrongContextException(virtual property $name can not be accessed from this context); } } elseif (\method_exists($this, 'set' . \ucfirst($name))) { return $this-{'set' . \ucfirst($name)}($value); } elseif ($this-objectConfiguration['accessMapAsProps'] == true $this-offsetExists($name)) { $this[$name] = $this-createPropertyValidator($name)-validate($value,$this-getRuleSet()[$name])-getValidatedValue(); } else { throw new WriteNonExistingPropertyException(Virtual property \$$name does not exist in class . \get_class($this)); } } ? There is no possibility to react on different scenarios as there can be only one __set which is either public,protected or private. There is no option to implement different behaviors for different visibility. Another usecase is the usage of object callbacks in handlers like session.set.save.handler For example the write callback does not (per documentation) output data. However in debug scenarios and in unit-tests it would be ideal to know if the method was called from the core as a usual session handler or in a different scenario in usercode. Additionally this would go inline with already existing functions like get_called_class, get_parent_class and partly get_class. -- Edit this bug report at https://bugs.php.net/bug.php?id=63834edit=1
Req #63834 [Opn]: Add a function to detect a methods calling context
Edit report at https://bugs.php.net/bug.php?id=63834edit=1 ID: 63834 Updated by: krak...@php.net Reported by:tolan333 at gmail dot com Summary:Add a function to detect a methods calling context Status: Open Type: Feature/Change Request Package:Class/Object related Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: acquiring a backtrace is an inefficient means of obtaining this information ... Previous Comments: [2012-12-31 11:55:17] ni...@php.net I still fail to use just what exactly this asks for and how it would be beneficial. @krakjoe: The get_calling_method and get_calling_class functions you added should already be fully covered by debug_backtrace, so I see little value in adding them (as the use case is rather limited). @op: Regarding the last two PHP_CONTEXT_EXTERN constants, what do you mean by user and core? E.g. if you invoke a callback using call_user_func, is that an internal or a userland call? It's the internal function doing the call, but it's really the user who triggers it. I don't see how these constants would carry any meaning. The other two again can be covered by debug_backtrace, can't they? Just get the class of the call and check whether it equals __CLASS__ (= private) or is a subclass of __CLASS__ (= protected) or is none (= public). Seems simple enough to me. [2012-12-31 11:49:59] krak...@php.net The following patch has been added/updated: Patch Name: 63834-2.patch Revision: 1356954599 URL: https://bugs.php.net/patch-display.php?bug=63834patch=63834-2.patchrevision=1356954599 [2012-12-31 11:37:55] krak...@php.net -2 will provide get_calling_method and get_calling_class, I think that's everything you should need [2012-12-31 11:36:48] krak...@php.net The following patch has been added/updated: Patch Name: 63834-2.patch Revision: 1356953808 URL: https://bugs.php.net/patch-display.php?bug=63834patch=63834-2.patchrevision=1356953808 [2012-12-31 11:19:32] krak...@php.net I think it makes sense to provide the scope which calls a method. Beyond this is application specific, I have suggested a patch that provides the name like the associated methods. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=63834 -- Edit this bug report at https://bugs.php.net/bug.php?id=63834edit=1
Bug #63866 [Opn]: Segmentation fault (11) Xml related
Edit report at https://bugs.php.net/bug.php?id=63866edit=1 ID: 63866 Updated by: krak...@php.net Reported by:netbirdir at yahoo dot com Summary:Segmentation fault (11) Xml related Status: Open Type: Bug Package:XML related Operating System: centos 6.3 PHP Version:5.4.10 Block user comment: N Private report: N New Comment: Please provide additional information such that the bug can be investigated. I managed to load the document with SimpleXML on the command line and there was no errors, or leaks. We need to know the method that you use to load the document, we need to know what version of PHP you are using, we need to know what server software and setup you are using, and any other information that might help us to conduct investigation. Ta Previous Comments: [2012-12-28 04:58:21] netbirdir at yahoo dot com Description: Hello, Sorry my english. I am not expert. But this bug is %100 correct. I have a wordpress site and it has more 100+ rss, xml feed. My all rss feeds works is good and no problem only a feed has problem. I have always error in logs from this feed.(only this feed) error [notice] child pid 8052 exit signal Segmentation fault (11) I don't get backtrace. Please test this rss in php xml. http://astroloji.tr.msn.com/rss_dailyhoroscopes.aspx -- Edit this bug report at https://bugs.php.net/bug.php?id=63866edit=1
Bug #63865 [Opn-Csd]: php unset local reference affecting global scope
Edit report at https://bugs.php.net/bug.php?id=63865edit=1 ID: 63865 Updated by: krak...@php.net Reported by:petermiller1986 at gmail dot com Summary:php unset local reference affecting global scope -Status: Open +Status: Closed Type: Bug Package:*General Issues Operating System: ubuntu 10.04 PHP Version:5.3.20 -Assigned To: +Assigned To:krakjoe Block user comment: N Private report: N New Comment: You set the data in the global scope with the return of the function. Your unset function does not receive the array by reference. See the code below, commenting out the reference makes no difference. ?php function should_not_alter($in) { $in_ref = $in['level1']; //try commenting out this line to see the output change should_only_unset_locally($in); return $in; } function should_only_unset_locally($in) { unset($in['level1']['level2_0']); } $data[0] = array( 'level1' = array( 'level2_0' = 'first value', 'level2_1' = 'second value' ) ); $data[1]=should_not_alter($data[0]); print_r($data); ? Previous Comments: [2012-12-28 04:53:56] petermiller1986 at gmail dot com Description: i have come across some very strange php behaviour. an unset which should occur within local scope is affecting the scope of the caller function. if you run the test script you will see that the value 'first value' has been unset from the $data array in the global scope. however if you comment out the $in_ref = $in['level1']; line then the result changes (and it shouldn't i think). is this intended behaviour of php or a bug? Test script: --- ?php function should_not_alter($in) { $in_ref = $in['level1']; //try commenting out this line to see the output change should_only_unset_locally($in); return $in; } function should_only_unset_locally($in) { unset($in['level1']['level2_0']); } $data = array('level1' = array('level2_0' = 'first value', 'level2_1' = 'second value')); $data = should_not_alter($data); print_r($data); ? Expected result: Array ( [level1] = Array ( [level2_0] = first value [level2_1] = second value ) ) Actual result: -- Array ( [level1] = Array ( [level2_1] = second value ) ) -- Edit this bug report at https://bugs.php.net/bug.php?id=63865edit=1
Bug #63848 [Opn-Nab]: Unable to execute batch file in php
Edit report at https://bugs.php.net/bug.php?id=63848edit=1 ID: 63848 Updated by: krak...@php.net Reported by:ajeenaa dot shanmugan at gmail dot com Summary:Unable to execute batch file in php -Status: Open +Status: Not a bug Type: Bug Package:Program Execution Operating System: windows PHP Version:5.3.20 Block user comment: N Private report: N New Comment: You cannot change this behavior from within PHP. Previous Comments: [2012-12-24 11:14:20] ajeenaa dot shanmugan at gmail dot com Description: I have one batch file with start command , if i execute that batch file from php it is not ending it is showing loading. But when i try with command promt it is working. @echo off echo start first start parallel.bat start parallel_x.bat echo end of first But if i replace the start command with call it is working, but ibn command promt both are working. -- Edit this bug report at https://bugs.php.net/bug.php?id=63848edit=1
Req #63841 [Opn-Nab]: Mind the constructor return value
Edit report at https://bugs.php.net/bug.php?id=63841edit=1 ID: 63841 Updated by: krak...@php.net Reported by:paxcoder+phpnet at gmail dot com Summary:Mind the constructor return value -Status: Open +Status: Not a bug Type: Feature/Change Request Package:Class/Object related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: The job of a constructor is not to return a value but to construct an object, this is implicit in the implementation and associated keywords. For example, one cannot call $var=stdClass::__construct(), because they are not, and cannot be static functions. Making such a check is completely unnecessary and costly. Not a bug. Previous Comments: [2012-12-23 16:20:35] paxcoder+phpnet at gmail dot com Description: As-is, returning values in the constructor has no effect, and the class instance is returned instead. Either allow for explicitly returned values to supersede the object, or warn about trying to return a value from a constructor. Test script: --- ?php error_reporting(E_ALL|E_STRICT); class C { function __construct() { return NULL; } } $c = new C; print_r($c); ? Expected result: Either a warning at line 10, or $c set to NULL Actual result: -- No warning, and $c set to a C Object -- Edit this bug report at https://bugs.php.net/bug.php?id=63841edit=1