[PHP-CVS] svn: /php/phpruntests/trunk/ src/configuration/settings/rtPhpCgiExecutableSetting.php tests/configuration/settings/rtPhpCgiExecutableSettingTest.php tests/testcase/rtGetExecutionTest.php

2012-05-11 Thread Zoe Slattery
zoe  Fri, 11 May 2012 08:04:49 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=325655

Log:
fix to do a better guess at finding the CGI executable

Changed paths:
U   
php/phpruntests/trunk/src/configuration/settings/rtPhpCgiExecutableSetting.php
U   
php/phpruntests/trunk/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php
U   php/phpruntests/trunk/tests/testcase/rtGetExecutionTest.php

Modified: 
php/phpruntests/trunk/src/configuration/settings/rtPhpCgiExecutableSetting.php
===
--- 
php/phpruntests/trunk/src/configuration/settings/rtPhpCgiExecutableSetting.php  
2012-05-11 05:30:34 UTC (rev 325654)
+++ 
php/phpruntests/trunk/src/configuration/settings/rtPhpCgiExecutableSetting.php  
2012-05-11 08:04:49 UTC (rev 325655)
@@ -43,17 +43,24 @@
 }

 /**
- * @todo spriebsch: does this method need to be public, is it only called 
from get()?
- * @todo zoe:This method only works if we are running from a PHP source 
tree, do we need to
- * cope with /usr/local/bin/php for example?
+ * If the path tp the php cli executable is either:
+ * something/cli/php
+ * or, failing that,
+ * something/php
+ * we can make a guess at the path to the cgi executable
  */
-public function guessFromPhpCli($phpCli)
+private function guessFromPhpCli($phpCli)
 {
-if(substr(dirname($phpCli),-3) == 'cli') {
-$pathLength = strlen(dirname($phpCli)) - 3;
-$sapiDir = substr(dirname($phpCli), 0, $pathLength);
-$this-phpCgiExecutable = $sapiDir.cgi/php-cgi;
-}
+
+   if(substr($phpCli, -7) === cli/php) {
+   $cgiGuess = substr($phpCli, 0, -7) . cgi/php-cgi;
+   }elseif( substr($phpCli, -3) === php) {
+   $cgiGuess = substr($phpCli, 0, -3) . php-cgi;
+   }else{
+   $cgiGuess = null;
+   }
+
+   return $cgiGuess;
 }

 /**
@@ -68,9 +75,10 @@

 // We ask rtPhpExecutableSetting for the path to the PHP 
executable.
 $rtPhpExecutableSetting = new 
rtPhpExecutableSetting($this-configuration);
-$this-guessFromPhpCli($rtPhpExecutableSetting-get());
+$phpCli=$rtPhpExecutableSetting-get();
+$this-phpCgiExecutable = $this-guessFromPhpCli($phpCli);
+
 }
-
 return $this-phpCgiExecutable;
 }
 }

Modified: 
php/phpruntests/trunk/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php
===
--- 
php/phpruntests/trunk/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php
2012-05-11 05:30:34 UTC (rev 325654)
+++ 
php/phpruntests/trunk/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php
2012-05-11 08:04:49 UTC (rev 325655)
@@ -27,25 +27,32 @@

 $setPhp = $configuration-getSetting('TEST_PHP_EXECUTABLE');

-if   (preg_match(/sapi/, $setPhp)) {
-// Make no assertion bacuse the CGI executable can be guesed
+if   (substr($setPhp, -3) === php) {
+// Make no assertion because the CGI executable can be guesed
 } else {
 $this-assertEquals(null, $setting-get());
 }
 }

 public function testSetFromCliExecutableName() {
-$configuration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 
'/a/sapi/cli/php', 'test.phpt'));
+$configuration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 
'/some/thing/php', 'test.phpt'));
 $configuration-setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', 
null);
 $setting = new rtPhpCgiExecutableSetting($configuration);

-$this-assertEquals('/a/sapi/cgi/php-cgi', $setting-get());
+$this-assertEquals('/some/thing/php-cgi', $setting-get());
 }
 public function testSetFromCli2() {
-$configuration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 
'/a/sapi/cli/php', 'test.phpt'));
+$configuration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 
'/some/thing/sapi/cli/php', 'test.phpt'));
 $setting = new rtPhpCgiExecutableSetting($configuration);

-$this-assertEquals('/a/sapi/cgi/php-cgi', $setting-get());
+$this-assertEquals('/some/thing/sapi/cgi/php-cgi', $setting-get());
 }
+   public function testSetFromCli3() {
+$configuration = 
rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 
'/some/thing/sapi/cli/phpblah', 'test.phpt'));
+$setting = new rtPhpCgiExecutableSetting($configuration);
+
+$this-assertEquals(null, $setting-get());
+}
+
 }
 ?

Modified: php/phpruntests/trunk/tests/testcase/rtGetExecutionTest.php
===
--- 

[PHP-CVS] svn: /php/phpruntests/trunk/ build.xml phpdefinitions.txt phpdefinitions.txt_sample

2012-05-11 Thread Zoe Slattery
zoe  Fri, 11 May 2012 08:16:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=325656

Log:
Add a temp directory to properties

Changed paths:
U   php/phpruntests/trunk/build.xml
D   php/phpruntests/trunk/phpdefinitions.txt
A   php/phpruntests/trunk/phpdefinitions.txt_sample

Modified: php/phpruntests/trunk/build.xml
===
--- php/phpruntests/trunk/build.xml 2012-05-11 08:04:49 UTC (rev 325655)
+++ php/phpruntests/trunk/build.xml 2012-05-11 08:16:12 UTC (rev 325656)
@@ -59,15 +59,15 @@
 delete dir=_compare /
 mkdir dir=_compare /

-delete dir=/tmp/phpruntests /
-mkdir dir=/tmp/phpruntests /
+delete dir=${temp_directory}/phpruntests /
+mkdir dir=${temp_directory}/phpruntests /

-copy file=${project.basedir}/QA/QATESTS.tgz 
tofile=/tmp/phpruntests/QATESTS.tgz /
+copy file=${project.basedir}/QA/QATESTS.tgz 
tofile=${temp_directory}/phpruntests/QATESTS.tgz /

-exec command=tar xfz QATESTS.tgz dir=/tmp/phpruntests /
+exec command=tar xfz QATESTS.tgz dir=${temp_directory}/phpruntests /

-exec command=${php} -n ${php_source}/run-tests.php -n -p ${php_to_test} 
/tmp/phpruntests/Zend /tmp/phpruntests/ext /tmp/phpruntests/sapi 
/tmp/phpruntests/tests  ${project.basedir}/_compare/old.out 
dir=/tmp/phpruntests passthru=true checkReturn=true/
-exec command=${php} -n ${project.basedir}/src/run-tests.php -n -p 
${php_to_test} -o csv -s ${project.basedir}/_compare/new.out /tmp/phpruntests 
dir=/tmp/phpruntests passthru=true checkReturn=true /
+exec command=${php} -n ${php_source}/run-tests.php -n -p ${php_to_test} 
${temp_directory}/phpruntests/Zend ${temp_directory}/phpruntests/ext 
${temp_directory}/phpruntests/sapi ${temp_directory}/phpruntests/tests  
${project.basedir}/_compare/old.out dir=${temp_directory}/phpruntests 
passthru=true checkReturn=true/
+exec command=${php} -n ${project.basedir}/src/run-tests.php -n -p 
${php_to_test} -o csv -s ${project.basedir}/_compare/new.out 
${temp_directory}/phpruntests dir=${temp_directory}/phpruntests 
passthru=true checkReturn=true /

 exec command=${php} -n QA/compareNewOld.php 
${project.basedir}/_compare/new.out ${project.basedir}/_compare/old.out 
phpruntests  ${project.basedir}/_compare/compare_new_old.out 
dir=${project.basedir} passthru=true checkReturn=true/


Deleted: php/phpruntests/trunk/phpdefinitions.txt
===
--- php/phpruntests/trunk/phpdefinitions.txt2012-05-11 08:04:49 UTC (rev 
325655)
+++ php/phpruntests/trunk/phpdefinitions.txt2012-05-11 08:16:12 UTC (rev 
325656)
@@ -1,9 +0,0 @@
-# This file is used as a phing property file and is also read by 
rtTestBoootstrap.php to determine which
-# PHP exectables to use in running unit tests
-
-#These are example settings, you will need to unomment and change them to the 
right paths on your system
-#
-#php=/usr/bin/php
-#php_to_test=/usr/local/php540/bin/php
-#php_cgi_to_test=/usr/local/php540/bin/php-cgi
-#php_source=/Users/zoe/Applications/PHP/php-5.4.0

Added: php/phpruntests/trunk/phpdefinitions.txt_sample
===
--- php/phpruntests/trunk/phpdefinitions.txt_sample 
(rev 0)
+++ php/phpruntests/trunk/phpdefinitions.txt_sample 2012-05-11 08:16:12 UTC 
(rev 325656)
@@ -0,0 +1,17 @@
+# This file is used as a phing property file and is also read by 
rtTestBoootstrap.php to determine which
+# PHP exectables to use in running unit tests
+
+#These are example settings, you will change them to the right paths on your 
system
+#then copy this to phpdefinitions.txt
+#
+#Your system defualt PHP
+php=/usr/bin/php
+#
+#The version of PHP that you intend to test
+php_to_test=/usr/local/php540/bin/php
+#
+#The location of a copy run-tests.php for running comparison results (qa 
target)
+php_source=/Users/zoe/Applications/PHP/php-5.4.0
+#
+#Temporary (writable) directory - also used buy qa target
+temp_directory=/tmp

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/phpruntests/trunk/ build.xml

2012-05-11 Thread Zoe Slattery
zoe  Fri, 11 May 2012 08:48:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=325657

Log:
add some echos to the build file

Changed paths:
U   php/phpruntests/trunk/build.xml

Modified: php/phpruntests/trunk/build.xml
===
--- php/phpruntests/trunk/build.xml 2012-05-11 08:16:12 UTC (rev 325656)
+++ php/phpruntests/trunk/build.xml 2012-05-11 08:48:17 UTC (rev 325657)
@@ -62,15 +62,28 @@
 delete dir=${temp_directory}/phpruntests /
 mkdir dir=${temp_directory}/phpruntests /

+echo msg=Copying QATESTS tar file to temporary directory /
+
 copy file=${project.basedir}/QA/QATESTS.tgz 
tofile=${temp_directory}/phpruntests/QATESTS.tgz /

+echo msg=Extracting QATESTS.. /
+
 exec command=tar xfz QATESTS.tgz dir=${temp_directory}/phpruntests /

+echo msg=Running the tests using standard (old) run-tests.php.. /
+
 exec command=${php} -n ${php_source}/run-tests.php -n -p ${php_to_test} 
${temp_directory}/phpruntests/Zend ${temp_directory}/phpruntests/ext 
${temp_directory}/phpruntests/sapi ${temp_directory}/phpruntests/tests  
${project.basedir}/_compare/old.out dir=${temp_directory}/phpruntests 
passthru=true checkReturn=true/
+
+echo msg=Running the tests using new run-tests.php.. /
+
 exec command=${php} -n ${project.basedir}/src/run-tests.php -n -p 
${php_to_test} -o csv -s ${project.basedir}/_compare/new.out 
${temp_directory}/phpruntests dir=${temp_directory}/phpruntests 
passthru=true checkReturn=true /

+echo msg=Comparing the results from new and old runs /
+
 exec command=${php} -n QA/compareNewOld.php 
${project.basedir}/_compare/new.out ${project.basedir}/_compare/old.out 
phpruntests  ${project.basedir}/_compare/compare_new_old.out 
dir=${project.basedir} passthru=true checkReturn=true/

+echo msg=Comparing the results from new runs with baseline Linux 
results /
+
 exec command=${php} -n QA/compareNewNew.php 
${project.basedir}/QA/BaselineLinuxResults ${project.basedir}/_compare/new.out 
phpruntests  ${project.basedir}/_compare/compare_baseline_old.out 
dir=${project.basedir} passthru=true checkReturn=true/
   /target


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] com php-src: Cleanup useless function declaration for traits: Zend/zend_compile.h

2012-05-11 Thread Xinchen Hui
Commit:0cb4849e54ee860f44f0f8409a9d5c09f7c9
Author:Reeze Xia reeze@gmail.com Fri, 11 May 2012 16:52:12 
+0800
Parents:   d394c17293df2405b10aaec1804edd65e1d8efe8
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0cb4849e54ee860f44f0f8409a9d5c09f7c9

Log:
Cleanup useless function declaration for traits

Changed paths:
  M  Zend/zend_compile.h


Diff:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 8a81a95..f164122 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -518,10 +518,6 @@ void zend_prepare_trait_precedence(znode *result, znode 
*method_reference, znode
 void zend_prepare_reference(znode *result, znode *class_name, znode 
*method_name TSRMLS_DC);
 void zend_prepare_trait_alias(znode *result, znode *method_reference, znode 
*modifiers, znode *alias TSRMLS_DC);
 
-void init_trait_alias_list(znode* result, const znode* trait_alias TSRMLS_DC);
-void add_trait_alias(znode* result, const znode* trait_alias TSRMLS_DC);
-void init_trait_alias(znode* result, const znode* method_name, const znode* 
alias, const znode* modifiers TSRMLS_DC);
-
 ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry 
*parent_ce TSRMLS_DC);
 void zend_do_early_binding(TSRMLS_D);
 ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array 
TSRMLS_DC);


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fix bug #61990 ext\spl\examples\tests\dualiterator_001.phpt fails: win32/build/mkdist.php

2012-05-11 Thread Anatoliy Belsky
Commit:81ba6b14c7b1b934f4d3e2896f861a42b07aa838
Author:Anatoliy Belsky a...@php.net Fri, 11 May 2012 14:24:12 
+0200
Parents:   266578f58483a08d7af51714636564df36a926d0
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=81ba6b14c7b1b934f4d3e2896f861a42b07aa838

Log:
Fix bug #61990 ext\spl\examples\tests\dualiterator_001.phpt fails

This fixes a general issue. In this ticket and not for the first time
is being seen, that people are trying to use data from examples
in the tests. When extracting a test pack only tests and its siblings
was taken into account. Now examples are copied as well.

Bugs:
https://bugs.php.net/61990

Changed paths:
  M  win32/build/mkdist.php


Diff:
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index 17f7cd0..5ed9bdc 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -401,7 +401,7 @@ function copy_test_dir($directory, $dest)
while (FALSE !== ($file = readdir($directory_list))) {
$full_path = $directory . '/' . $file;
if($file != '.'  $file != '..'  $file != '.svn'  
is_dir($full_path)) {
-   if ($file == 'tests') {
+   if ($file == 'tests' || $file == 'examples') {
if (!is_dir($dest . '/' . $full_path)) {
mkdir($dest . '/' . $full_path , 0775, 
true);
}


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /SVNROOT/ global_avail pre-commit

2012-05-11 Thread David Soria Parra
dsp  Fri, 11 May 2012 14:28:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=325658

Log:
migrate phpruntests

Changed paths:
U   SVNROOT/global_avail
U   SVNROOT/pre-commit

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2012-05-11 08:48:17 UTC (rev 325657)
+++ SVNROOT/global_avail2012-05-11 14:28:44 UTC (rev 325658)
@@ -401,7 +401,7 @@
 avail|nlopess,pbiggar,olafurw,hjalle|php/php-benchmarks

 # phpruntests karma
-avail|zoe,spriebsch,g2|php/phpruntests
+avail|zoe,spriebsch,g2|phpruntests.git

 # cmake karma (GSOC 2008 project)
 avail|gloob,pajoye|php/cmake

Modified: SVNROOT/pre-commit
===
--- SVNROOT/pre-commit  2012-05-11 08:48:17 UTC (rev 325657)
+++ SVNROOT/pre-commit  2012-05-11 14:28:44 UTC (rev 325658)
@@ -1,7 +1,7 @@
 #!/usr/local/bin/php
 ?php

-$migrated_repositories = array('systems/', 'web/', 'phd/', 'php/php-src/', 
'gtk/php-gtk');
+$migrated_repositories = array('systems/', 'web/', 'phd/', 'php/php-src/',  
'php/phpruntests/', 'gtk/php-gtk');
 // 
-
 // Include
 require dirname(__FILE__) . '/hook-common.inc.php';

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] com php-src: fix stack overflow in php_intlog10abs(): ext/standard/math.c

2012-05-11 Thread Nuno Lopes
Commit:5c87ca2d2770e18c385d4b770123b9b21eeaa053
Author:Nuno Lopes nlop...@php.net Fri, 11 May 2012 12:50:29 -0400
Parents:   d0d7340d50f178691c8e436391168cf6cc1fea3e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5c87ca2d2770e18c385d4b770123b9b21eeaa053

Log:
fix stack overflow in php_intlog10abs()

bug uncovered by LLVM/clang's new -fbounds-checking switch
this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

Changed paths:
  M  ext/standard/math.c


Diff:
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 302fbda..65187f6 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
int result;
value = fabs(value);
 
-   if (value  1e-8 || value  1e23) {
+   if (value  1e-8 || value  1e22) {
result = (int)floor(log10(value));
} else {
static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
/* Do a binary search with 5 steps */
-   result = 16;
+   result = 15;
if (value  values[result]) {
result -= 8;
} else {


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: fix stack overflow in php_intlog10abs(): ext/standard/math.c

2012-05-11 Thread Nuno Lopes
Commit:8b4b70df56e14be0f7172b5cc5f8da44b3272ac3
Author:Nuno Lopes nlop...@php.net Fri, 11 May 2012 12:50:29 -0400
Parents:   4458f3bcf65e5826f4cfb8ffd00cd3b8161f37bd
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8b4b70df56e14be0f7172b5cc5f8da44b3272ac3

Log:
fix stack overflow in php_intlog10abs()

bug uncovered by LLVM/clang's new -fbounds-checking switch
this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

Changed paths:
  M  ext/standard/math.c


Diff:
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 302fbda..65187f6 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
int result;
value = fabs(value);
 
-   if (value  1e-8 || value  1e23) {
+   if (value  1e-8 || value  1e22) {
result = (int)floor(log10(value));
} else {
static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
/* Do a binary search with 5 steps */
-   result = 16;
+   result = 15;
if (value  values[result]) {
result -= 8;
} else {


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: fix stack overflow in php_intlog10abs(): ext/standard/math.c

2012-05-11 Thread Nuno Lopes
Commit:950d5ee590214742799836d3d939ee59f641bdf4
Author:Nuno Lopes nlop...@php.net Fri, 11 May 2012 12:50:29 -0400
Parents:   81ba6b14c7b1b934f4d3e2896f861a42b07aa838
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=950d5ee590214742799836d3d939ee59f641bdf4

Log:
fix stack overflow in php_intlog10abs()

bug uncovered by LLVM/clang's new -fbounds-checking switch
this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

Changed paths:
  M  ext/standard/math.c


Diff:
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 21c730c..749c77c 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
int result;
value = fabs(value);
 
-   if (value  1e-8 || value  1e23) {
+   if (value  1e-8 || value  1e22) {
result = (int)floor(log10(value));
} else {
static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
/* Do a binary search with 5 steps */
-   result = 16;
+   result = 15;
if (value  values[result]) {
result -= 8;
} else {


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object): NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c

2012-05-11 Thread Xinchen Hui
Commit:3332943c9d20a8b5e09816b11f38742de0e16085
Author:Xinchen Hui larue...@php.net Sat, 12 May 2012 13:13:44 
+0800
Parents:   950d5ee590214742799836d3d939ee59f641bdf4
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3332943c9d20a8b5e09816b11f38742de0e16085

Log:
Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member 
of a null object)

Bugs:
https://bugs.php.net/62005

Changed paths:
  M  NEWS
  A  Zend/tests/bug62005.phpt
  M  Zend/zend_execute.c


Diff:
diff --git a/NEWS b/NEWS
index e9c1370..1057db7 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP   
 NEWS
 (Laruence)
 
 - Core:
+  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
+member of a null object). (Laruence)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
 reference). (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt
new file mode 100644
index 000..4ff4b2c
--- /dev/null
+++ b/Zend/tests/bug62005.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #62005 (unexpected behavior when incrementally assigning to a member of a 
null object)
+--FILE--
+?php
+function add_points($player, $points) {
+$player-energy += $points;
+print_r($player);
+}
+add_points(NULL, 2);
+--EXPECTF--
+Strict Standards: Creating default object from empty value in %sbug62005.php 
on line %d
+stdClass Object
+(
+[energy] = 2
+)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 705c713..4423921 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -432,11 +432,10 @@ static inline void make_real_object(zval **object_ptr 
TSRMLS_DC)
|| (Z_TYPE_PP(object_ptr) == IS_BOOL  Z_LVAL_PP(object_ptr) 
== 0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING  
Z_STRLEN_PP(object_ptr) == 0)
) {
-   zend_error(E_STRICT, Creating default object from empty 
value);
-
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
object_init(*object_ptr);
+   zend_error(E_STRICT, Creating default object from empty 
value);
}
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c

2012-05-11 Thread Xinchen Hui
Commit:6a5095582a1e3b9a065863c9990e2f001d1cdc10
Author:Xinchen Hui larue...@php.net Sat, 12 May 2012 13:19:27 
+0800
Parents:   8b4b70df56e14be0f7172b5cc5f8da44b3272ac3 
3332943c9d20a8b5e09816b11f38742de0e16085
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=6a5095582a1e3b9a065863c9990e2f001d1cdc10

Log:
Merge branch 'PHP-5.3' into PHP-5.4

* PHP-5.3:
  Fixed Bug #62005 (unexpected behavior when incrementally assigning to a 
member of a null object)
  fix stack overflow in php_intlog10abs()

Conflicts:
Zend/zend_execute.c

Bugs:
https://bugs.php.net/62005

Changed paths:
  MM  NEWS
  AM  Zend/tests/bug62005.phpt
  MM  Zend/zend_execute.c


Diff:
diff --cc NEWS
index 3717537,1057db7..a872112
--- a/NEWS
+++ b/NEWS
@@@ -16,27 -11,19 +16,29 @@@ PH
  (Laruence)
  
  - Core:
+   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
+ member of a null object). (Laruence)
 +  . Fixed bug #61978 (Object recursion not detected for classes that implement
 +JsonSerializable). (Felipe)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
  reference). (Laruence)
 +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
 +(Laruence)
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
 -  . Fixed bug #61764 ('I' unpacks n as signed if n  2^31-1 on LP64). 
(Gustavo)
 +  . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
 +  . Fixed bug #61761 ('Overriding' a private static method with a different 
 +signature causes crash). (Laruence)
 +  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
 +phase). (Laruence)
 +  . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
 +  . Fixed bug #61650 (ini parser crashes when using ${} ini variables
 +(without apache2)). (Laruence)
 +  . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
  set to null). (Anatoliy)
 -  . Fixed bug #61713 (Logic error in charset detection for htmlentities).
 -(Anatoliy)
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
  
 -- Fileinfo:
 +- FPM
. Fixed bug #61812 (Uninitialised value used in libmagic). 
  (Laruence, Gustavo)
  
diff --cc Zend/tests/bug62005.phpt
index 000,4ff4b2c..c99b287
mode 00,100644..100644
--- a/Zend/tests/bug62005.phpt
+++ b/Zend/tests/bug62005.phpt
@@@ -1,0 -1,15 +1,15 @@@
+ --TEST--
+ Bug #62005 (unexpected behavior when incrementally assigning to a member of a 
null object)
+ --FILE--
+ ?php
+ function add_points($player, $points) {
+ $player-energy += $points;
+ print_r($player);
+ }
+ add_points(NULL, 2);
+ --EXPECTF--
 -Strict Standards: Creating default object from empty value in %sbug62005.php 
on line %d
++Warning: Creating default object from empty value in %sbug62005.php on line %d
+ stdClass Object
+ (
+ [energy] = 2
+ )
diff --cc Zend/zend_execute.c
index d72fc73,4423921..205531f
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@@ -557,8 -435,7 +557,7 @@@ static inline void make_real_object(zva
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
object_init(*object_ptr);
 -  zend_error(E_STRICT, Creating default object from empty 
value);
++  zend_error(E_WARNING, Creating default object from empty 
value);
}
  }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object): NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c

2012-05-11 Thread Laruence
Hi:
   this bug is kind of a serious one, since it's behavior wrongly.

   so maybe this one should merged to 5.3 and 5.4 branch..

thanks

On Sat, May 12, 2012 at 1:13 PM, Xinchen Hui larue...@php.net wrote:
 Commit:    3332943c9d20a8b5e09816b11f38742de0e16085
 Author:    Xinchen Hui larue...@php.net         Sat, 12 May 2012 13:13:44 
 +0800
 Parents:   950d5ee590214742799836d3d939ee59f641bdf4
 Branches:  PHP-5.3

 Link:       
 http://git.php.net/?p=php-src.git;a=commitdiff;h=3332943c9d20a8b5e09816b11f38742de0e16085

 Log:
 Fixed Bug #62005 (unexpected behavior when incrementally assigning to a 
 member of a null object)

 Bugs:
 https://bugs.php.net/62005

 Changed paths:
  M  NEWS
  A  Zend/tests/bug62005.phpt
  M  Zend/zend_execute.c


 Diff:
 diff --git a/NEWS b/NEWS
 index e9c1370..1057db7 100644
 --- a/NEWS
 +++ b/NEWS
 @@ -11,6 +11,8 @@ PHP                                                         
                NEWS
     (Laruence)

  - Core:
 +  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a
 +    member of a null object). (Laruence)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
     reference). (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
 diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt
 new file mode 100644
 index 000..4ff4b2c
 --- /dev/null
 +++ b/Zend/tests/bug62005.phpt
 @@ -0,0 +1,15 @@
 +--TEST--
 +Bug #62005 (unexpected behavior when incrementally assigning to a member of 
 a null object)
 +--FILE--
 +?php
 +function add_points($player, $points) {
 +    $player-energy += $points;
 +    print_r($player);
 +}
 +add_points(NULL, 2);
 +--EXPECTF--
 +Strict Standards: Creating default object from empty value in %sbug62005.php 
 on line %d
 +stdClass Object
 +(
 +    [energy] = 2
 +)
 diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
 index 705c713..4423921 100644
 --- a/Zend/zend_execute.c
 +++ b/Zend/zend_execute.c
 @@ -432,11 +432,10 @@ static inline void make_real_object(zval **object_ptr 
 TSRMLS_DC)
                || (Z_TYPE_PP(object_ptr) == IS_BOOL  Z_LVAL_PP(object_ptr) 
 == 0)
                || (Z_TYPE_PP(object_ptr) == IS_STRING  
 Z_STRLEN_PP(object_ptr) == 0)
        ) {
 -               zend_error(E_STRICT, Creating default object from empty 
 value);
 -
                SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
                zval_dtor(*object_ptr);
                object_init(*object_ptr);
 +               zend_error(E_STRICT, Creating default object from empty 
 value);
        }
  }


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object): NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c

2012-05-11 Thread Laruence
On Sat, May 12, 2012 at 1:23 PM, Laruence larue...@php.net wrote:
 Hi:
   this bug is kind of a serious one, since it's behavior wrongly.
RMS:

 I think I should note that the reason why I said it is a serious one,
following script:

?php
function add_points($player, $points) {
$player-energy += $points;
var_dump($player);
}

add_points(NULL, 2);
?

will ouput:

NULL

in 5.3 and 5.4


thanks

   so maybe this one should merged to 5.3 and 5.4 branch..

 thanks

 On Sat, May 12, 2012 at 1:13 PM, Xinchen Hui larue...@php.net wrote:
 Commit:    3332943c9d20a8b5e09816b11f38742de0e16085
 Author:    Xinchen Hui larue...@php.net         Sat, 12 May 2012 13:13:44 
 +0800
 Parents:   950d5ee590214742799836d3d939ee59f641bdf4
 Branches:  PHP-5.3

 Link:       
 http://git.php.net/?p=php-src.git;a=commitdiff;h=3332943c9d20a8b5e09816b11f38742de0e16085

 Log:
 Fixed Bug #62005 (unexpected behavior when incrementally assigning to a 
 member of a null object)

 Bugs:
 https://bugs.php.net/62005

 Changed paths:
  M  NEWS
  A  Zend/tests/bug62005.phpt
  M  Zend/zend_execute.c


 Diff:
 diff --git a/NEWS b/NEWS
 index e9c1370..1057db7 100644
 --- a/NEWS
 +++ b/NEWS
 @@ -11,6 +11,8 @@ PHP                                                        
                 NEWS
     (Laruence)

  - Core:
 +  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a
 +    member of a null object). (Laruence)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
     reference). (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
 diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt
 new file mode 100644
 index 000..4ff4b2c
 --- /dev/null
 +++ b/Zend/tests/bug62005.phpt
 @@ -0,0 +1,15 @@
 +--TEST--
 +Bug #62005 (unexpected behavior when incrementally assigning to a member of 
 a null object)
 +--FILE--
 +?php
 +function add_points($player, $points) {
 +    $player-energy += $points;
 +    print_r($player);
 +}
 +add_points(NULL, 2);
 +--EXPECTF--
 +Strict Standards: Creating default object from empty value in 
 %sbug62005.php on line %d
 +stdClass Object
 +(
 +    [energy] = 2
 +)
 diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
 index 705c713..4423921 100644
 --- a/Zend/zend_execute.c
 +++ b/Zend/zend_execute.c
 @@ -432,11 +432,10 @@ static inline void make_real_object(zval **object_ptr 
 TSRMLS_DC)
                || (Z_TYPE_PP(object_ptr) == IS_BOOL  Z_LVAL_PP(object_ptr) 
 == 0)
                || (Z_TYPE_PP(object_ptr) == IS_STRING  
 Z_STRLEN_PP(object_ptr) == 0)
        ) {
 -               zend_error(E_STRICT, Creating default object from empty 
 value);
 -
                SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
                zval_dtor(*object_ptr);
                object_init(*object_ptr);
 +               zend_error(E_STRICT, Creating default object from empty 
 value);
        }
  }


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




 --
 Laruence  Xinchen Hui
 http://www.laruence.com/



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php