????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.118.160.215 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/array/ |
Upload File : |
--TEST-- Test array_sum() function : usage variations - array with different integer value --FILE-- <?php /* Prototype : mixed array_sum(array &input) * Description: Returns the sum of the array entries * Source code: ext/standard/array.c */ /* * Testing array_sum() with different types of integer arrays containing data of following type: * integer, octal, hexadecimal, maximum and minimum integer values & mixed of all integers */ echo "*** Testing array_sum() : different integer array ***\n"; // Int array $int_values = array(3, 2, 100, 150, 25, 350, 0, -3, -1200); echo "-- Sum of Integer array --\n"; var_dump( array_sum($int_values) ); // Octal array $octal_values = array(056, 023, 090, 015, -045, 01, -078); echo "-- Sum of Octal array --\n"; var_dump( array_sum($octal_values) ); // Hexadecimal array $hex_values = array(0xAE, 0x2B, 0X10, -0xCF, 0X12, -0XF2); echo "-- Sum of Hex array --\n"; var_dump( array_sum($hex_values) ); // Mixed values int, octal & hex $mixed_int_value = array(2, 5, -1, 054, 0X3E, 0, -014, -0x2A); echo "-- Sum of mixed integer values --\n"; var_dump( array_sum($mixed_int_value) ); echo "Done" ?> --EXPECTF-- *** Testing array_sum() : different integer array *** -- Sum of Integer array -- int(-573) -- Sum of Octal array -- int(35) -- Sum of Hex array -- int(-198) -- Sum of mixed integer values -- int(58) Done