Hi, Firstly many thanks to Tony, Hannes & Dmrity for providing all the required information which help me analyze various failure on MacOS X.
The analysis is bit lengthier, my apologies for the lengthy note. Appreciate any feedback and comment. I do not have solaris 10 system, but tried to put the analysis, please feel free to correct me if i am wrong. Below analysis contains the following : The failure out difference as generated by run-test.php Analysis of failure, A sample testcode which can be run to verify the failure/behavior & Expected output on RHEL 5. Following testcases are failing and have been analyzed : Test array_keys() function [ext/standard/tests/array/array_keys.phpt] Test fileperms(), chmod() functions: error conditions [ext/standard/tests/file/006_error.phpt] Test fileperms() & chmod() functions: usage variation [ext/standard/tests/file/006_variation.phpt] Test disk_free_space and its alias diskfreespace() functions : basic functionality [ext/standard/tests/file/disk_free_space_basic.phpt] Test filegroup() function: basic functionality [ext/standard/tests/file/filegroup_basic.phpt] Test filesize() function: usage variations [ext/standard/tests/file/filesize_variation.phpt] Test flock() function: Basic functionality [ext/standard/tests/file/flock_basic.phpt] Test flock() function: Variations [ext/standard/tests/file/flock_variation.phpt] Test mkdir() and rmdir() functions: usage variations [ext/standard/tests/file/mkdir_rmdir_variation.phpt] Test popen() and pclose function: error conditions [ext/standard/tests/file/popen_pclose_error.phpt] Test symlink(), linkinfo(), link() and is_link() functions: basic functionality [ext/standard/tests/file/symlink_link_linkinfo_is_link_basic.phpt] Test symlink(), linkinfo(), link() and is_link() functions : error conditions [ext/standard/tests/file/symlink_link_linkinfo_is_link_error.phpt] Test gettype() & settype() functions : usage variations [ext/standard/tests/general_functions/gettype_settype_variation2.phpt] ================================================================================ Failure in array_keys.phpt ================================================================================ Output lines indicating failure : --------------------------------- 312+ int(-2147483647) 313+ [2]=> 313- [2]=> 314- int(-2147483647) Explanation: ------------ The failiure is because of behavior of array_keys() differring on the Solaris when there are multiple keys of same name present in the input array. The resulting array does not have keys placed at the same position as compared to Linux. Code to reproduce: Test: <?php $arr_range = array( 2147483647 => 1, 2147483648 => 2, -2147483647 => 3, -2147483648 => 4, -2147483649 => 5, -0 => 6, 0 => 7 ); var_dump(array_keys($arr_range)); ?> Expected output on RHEL4, RHEL5 & WinXP: ---------------------------------------- array(4) { [0]=> int(2147483647) [1]=> int(-2147483648) [2]=> int(-2147483647) [3]=> int(0) } ================================================================================ Failure in 006_error.phpt ================================================================================ Output lines indicating failure : --------------------------------- 003+ Warning: chmod(): Not owner in /home/adovga63/php/5_2/ext/standard/tests/file/006_error.php on line 14 003- Warning: chmod(): Operation not permitted in %s on line %d 007+ Warning: chmod(): Not owner in /home/adovga63/php/5_2/ext/standard/tests/file/006_error.php on line 19 007- Warning: chmod(): Operation not permitted in %s on line %d Explanation: ------------ Failure is because of Warning message being inconsistent. We need to generalize the expected output with %s. ================================================================================ Failure in 006_variation.phpt ================================================================================ Output lines indicating failure : --------------------------------- 2567+ 106777 2567- 107777 2577+ 100000 2577- 101000 2582+ 100111 2582- 101111 2587+ 106001 2587- 107001 2597+ 100411 2597- 101411 2602+ 106141 2602- 107141 2612+ 102567 2612- 103567 2617+ 102567 2617- 103567 Explanation: ------------ Again another output difference on Solaris, Need to generalize using %d. The output difference is because of the permission of files and directories. ================================================================================ Failure in disk_free_space_basic.phpt ================================================================================ Output lines indicating failure : --------------------------------- *** Testing with existing directory *** float(5002826240) float(5002826240) *** Testing with newly created directory *** Free Space before writing to a file float(5002826240) Free Space after writing to a file float(5002826240) Free Space Value Is Incorrect -- Done -- ================================================================================ 012+ Free Space Value Is Incorrect 012- Free Space Value Is Correct ================================================================================ ================================================================================ Failure in filegroup_basic.phpt ================================================================================ ================================================================================ 007+ string(0) "" 007- string(1) "x" 009+ array(1) { 010+ [0]=> 011+ string(8) "adovga63" 009- array(0) { 021- int(0) 022- int(0) 022+ int(3) 023+ int(3) ================================================================================ Explanation: ------------ Failure indicated in line numbers 7, 9, 10, 11 is to do with number of groups that current user belongs to. We need to fix the expected output keeping in mind that given user might belong to multiple groups. Failure indicated in line number 21, 22 are because of group id for file /etc/passwd being different on Solaris. On Linux the group id is 0 but 3 on solaris. Need to generalise the output using %d. ================================================================================ Failure in filesize_variation.phpt ================================================================================ Output lines indicating failure : --------------------------------- 016+ int(2) 016- int(4096) 018+ int(3) 018- int(4096) 021+ int(3) 022+ int(2) 021- int(4096) 022- int(4096) 024+ int(3) 025+ int(3) 024- int(4096) 025- int(4096) Explanation: ------------ The failure indicates that Initial size of the dir is 2 bytes and changes their after with the addition of subdir/file. We need to generalize the expected outupt using %d as the value differ on different OS. Code to reproduce: <?php $filepath = dirname(__FILE__); // create dir and check size mkdir(dirname(__FILE__)."/temp"); var_dump( filesize($filepath."/temp") ); mkdir($filepath."/temp/subdir"); var_dump( filesize($filepath."/temp/subdir") ); // remove temp dir rmdir( $filepath."/temp/subdir"); rmdir( $filepath."/temp"); ?> Expected result on Linux ( RHEL 5 ): ----------------------------------- int(4096) int(4096) ================================================================================ Failure in flock_basic.phpt ================================================================================ Output lines indicating failure : --------------------------------- 002+ bool(false) 005- bool(true) Explanation: ------------ Not sure if the output is right, it shows 002+ but doesn't show corresponding 002-. But given the output 002+ which is expected as true on Linux, here we see that it returns false. This is the output of code trying to lock the file with LOCK_SH|LOCK_NB operation. May be we need to generailse the output. Here is the code to reproduce the behavior. <?php $file_handle = fopen("$file_path/lock.tmp", "w"); var_dump(flock($file_handle, LOCK_SH|LOCK_NB)); var_dump(flock($file_handle, LOCK_UN)); ?> Expected result on Linux ( RHEL 5 ): ----------------------------------- bool(true) bool(true) ================================================================================ Failure is flock_variation.phpt ================================================================================ Output lines indicating failure : --------------------------------- 004+ bool(false) 004- bool(true) 006+ bool(false) 006- bool(true) 008+ bool(false) 008- bool(true) 010+ bool(false) 010- bool(true) 012+ bool(false) 012- bool(true) 014+ bool(false) 014- bool(true) 016+ bool(false) 016- bool(true) 018+ bool(false) 018- bool(true) 020+ bool(false) 020- bool(true) 022+ bool(false) 022- bool(true) 024+ bool(false) 024- bool(true) 026+ bool(false) 026- bool(true) 028+ bool(false) 028- bool(true) 056+ bool(false) 056- bool(true) 058+ bool(false) 058- bool(true) 060+ bool(false) 060- bool(true) 062+ bool(false) 062- bool(true) 064+ bool(false) 064- bool(true) 066+ bool(false) 066- bool(true) 068+ bool(false) 068- bool(true) 070+ bool(false) 070- bool(true) 072+ bool(false) 072- bool(true) 074+ bool(false) 074- bool(true) 076+ bool(false) 076- bool(true) 078+ bool(false) 078- bool(true) 080+ bool(false) 080- bool(true) 160+ bool(false) 160- bool(true) 162+ bool(false) 162- bool(true) 164+ bool(false) 164- bool(true) 166+ bool(false) 166- bool(true) 168+ bool(false) 168- bool(true) 170+ bool(false) 170- bool(true) 172+ bool(false) 172- bool(true) 174+ bool(false) 174- bool(true) 176+ bool(false) 176- bool(true) 178+ bool(false) 178- bool(true) 180+ bool(false) 180- bool(true) 182+ bool(false) 182- bool(true) 184+ bool(false) 184- bool(true) 238+ bool(false) 238- bool(true) 240+ bool(false) 240- bool(true) 242+ bool(false) 242- bool(true) 244+ bool(false) 244- bool(true) 246+ bool(false) 246- bool(true) 248+ bool(false) 248- bool(true) 250+ bool(false) 250- bool(true) 252+ bool(false) 252- bool(true) 254+ bool(false) 254- bool(true) 256+ bool(false) 256- bool(true) 258+ bool(false) 258- bool(true) 260+ bool(false) 260- bool(true) 262+ bool(false) 262- bool(true) Explanation: ------------ These failure are because of return value from flock() being different as compared to Linux. There are multiple lock tried on the same file and outputs are different. I would consider rewriting the testcase to ease the way the operation is performed in the loop and then generalise the output or a seperate testcase for solaris. ================================================================================ Failure in mkdir_rmdir_variation.phpt ================================================================================ Output lines indicating failure : --------------------------------- 1546+ Warning: rmdir(/home/adovga63/php/5_2/ext/standard/tests/file/mkdir/): File exists in /home/adovga63/php/5_2/ext/standard/tests/file/mkdir_rmdir_variation.php on line 26 1546- Warning: rmdir(%s/mkdir/): Directory not empty in %s on line %d Explanation: ------------ There is difference in warning message deleiverd. Need to generalise the expected output ================================================================================ Failure in popen_pclose_error.phpt ================================================================================ Output lines indicating failure : --------------------------------- 008+ resource(4) of type (stream) 009+ sh: abc.txt: not found 009- Warning: popen(abc.txt,rw): Invalid argument in %s on line %d 010- bool(false) 011- Explanation: ------------ The behavior of popen() is expected to be saying "Invalid argument ...." but message differ on Solaris. We need to generalize the expected output for this using %s. Code for reproducing the error: <?php var_dump( popen("abc", "rw") ); // with invalid mode argument ?> Expected result on Linux ( RHEL 5 ): ----------------------------------- Warning: popen(abc.txt,rw): Invalid argument in %s on line %d bool(false) ================================================================================ Failure in symlink_link_linkinfo_is_link_basic.phpt ================================================================================ Output lines indicating failure : --------------------------------- 032+ Warning: link(): Not owner in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic.php on line 101 032- Warning: link(): Operation not permitted in %s on line %d Explanation: ------------ There is a difference in the output message, more generalization of the expect output is required. ================================================================================ Failure in symlink_link_linkinfo_is_link_error.phpt ================================================================================ Output lines indicating failure : --------------------------------- 008+ bool(true) 009- Warning: symlink(): No such file or directory in %s on line %d 010+ Warning: symlink(): File exists in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_error.php on line 32 012- Warning: symlink(): No such file or directory in %s on line %d 013- bool(false) 014- 015- Warning: symlink(): No such file or directory in %s on line %d 016- bool(false) 017- 018- Warning: symlink(): No such file or directory in %s on line %d 019- bool(false) 013+ Warning: symlink(): File exists in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_error.php on line 33 014+ bool(false) 015+ 016+ Warning: symlink(): No such file or directory in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_error.php on line 34 017+ bool(false) 018+ 019+ Warning: symlink(): No such file or directory in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_error.php on line 35 020+ bool(false) 024- Warning: symlink(): No such file or directory in %s on line %d 025- bool(false) 026- 039+ Warning: linkinfo(): No such file or directory in /home/adovga63/php/5_2/ext/standard/tests/file/symlink_link_linkinfo_is_link_error.php on line 48 040+ int(-1) 041+ Explanation: ------------ Here the failures is because of symlink() is creating a link when NULL, '' & boolean false is passed as source. Failures are very similar to those seen on MacOs X. Code to reproduce the error: <?php $link = "./link.tmp"; var_dump( symlink(NULL, $link) ); var_dump( symlink('', $link) ); var_dump( symlink(false, $link) ); ?> Expected result on Linux ( RHEL 5 ): ----------------------------------- Warning: symlink(): No such file or directory in %s on line %d bool(false) Warning: symlink(): No such file or directory in %s on line %d bool(false) Warning: symlink(): No such file or directory in %s on line %d bool(false) ---------------- ================================================================================ Failure in gettype_settype_variation2.phpt ================================================================================ Output lines indicating failure : --------------------------------- 260+ int(-1) 260- int(-508130303) 270+ int(-1) 270- int(1952002105) 290+ int(-1) 290- int(343000682) 665+ int(-1) 665- int(-508130303) 675+ int(-1) 675- int(1952002105) 695+ int(-1) 695- int(343000682) Explanation: ------------ Here the failure is because of settype() behavior being different on Solaris. Given a big numeric value,trying to set that to type integer fails and resulting integer value is int(-1). I think this needs a fix, if you agree, i would raise a bugzilla. Code to reproduce the error: <?php $big_numeric_value = 1232147483649; var_dump( settype($big_numeric_value, "integer") ); var_dump( $big_numeric_value ); ?> Expected result on Linux ( RHEL 5 ): ----------------------------------- bool(true) int(-508130303) with Regards, Raghubansh, IBM