cvs: pear /PHP_Compat/tests/function is_scalar.phpt

From: Date: Mon, 02 Jan 2006 11:23:38 +0000
Subject: cvs: pear /PHP_Compat/tests/function is_scalar.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-37244@lists.php.net to get a copy of this message
arpad Mon Jan 2 11:23:38 2006 UTC Modified files: /pear/PHP_Compat/tests/function is_scalar.phpt Log: full test http://cvs.php.net/viewcvs.cgi/pear/PHP_Compat/tests/function/is_scalar.phpt?r1=1.2&r2=1.3&diff_format=u Index: pear/PHP_Compat/tests/function/is_scalar.phpt diff -u pear/PHP_Compat/tests/function/is_scalar.phpt:1.2 pear/PHP_Compat/tests/function/is_scalar.phpt:1.3 --- pear/PHP_Compat/tests/function/is_scalar.phpt:1.2 Mon Dec 19 23:50:26 2005 +++ pear/PHP_Compat/tests/function/is_scalar.phpt Mon Jan 2 11:23:38 2006 @@ -4,7 +4,56 @@ <?php require_once 'PHP/Compat/Function/is_scalar.php'; -echo 'test'; +$tests = array( + 13, + 13.37, + 'foo', + '13', + '', + null, + true, + array(), + new stdClass +); + +for ($i = 0, $testc = count($tests); $i < $testc; $i++) { + echo "Testing: ($i) ", print_r($tests[$i], 1), "\n"; + var_dump(is_scalar($tests[$i])); + echo "\n"; +} + ?> --EXPECT-- -test \ No newline at end of file +Testing: (0) 13 +bool(true) + +Testing: (1) 13.37 +bool(true) + +Testing: (2) foo +bool(true) + +Testing: (3) 13 +bool(true) + +Testing: (4) +bool(true) + +Testing: (5) +bool(false) + +Testing: (6) 1 +bool(true) + +Testing: (7) Array +( +) + +bool(false) + +Testing: (8) stdClass Object +( +) + +bool(false) +

« previous php.pear.cvs (#37244) next »