summaryrefslogtreecommitdiff
path: root/tests/php/phpt/variables/005-cast-objects-to-scalars.phpt
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-03-28 00:05:14 +0600
committervalmat <ufabiz@gmail.com>2014-03-28 00:05:14 +0600
commitf56cff9e4f67a949e6f0ae35ca63aaaea16d9a41 (patch)
treef23abcc134dc189d695152057528365f412d9be2 /tests/php/phpt/variables/005-cast-objects-to-scalars.phpt
parentb2e2aa93754a12fac360e8de5196e45cd2f0f2aa (diff)
add test variables/005-cast-objects-to-scalars.phpt
Diffstat (limited to 'tests/php/phpt/variables/005-cast-objects-to-scalars.phpt')
-rw-r--r--tests/php/phpt/variables/005-cast-objects-to-scalars.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/php/phpt/variables/005-cast-objects-to-scalars.phpt b/tests/php/phpt/variables/005-cast-objects-to-scalars.phpt
new file mode 100644
index 0000000..335acb7
--- /dev/null
+++ b/tests/php/phpt/variables/005-cast-objects-to-scalars.phpt
@@ -0,0 +1,22 @@
+--TEST--
+cast objects to scalars
+--DESCRIPTION--
+http://www.phpcpp.com/documentation/special-features#casting-functions
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+
+function bool2str($b) {
+ return $b ? "Yes" : "No";
+}
+$obj = new Obj2Scalar();
+echo " long: ", (int)$obj, "\n string: ", (string)$obj, "\n double: ", (double)$obj, "\n bool: ", bool2str((bool)$obj);
+
+
+--EXPECT--
+ long: 27032014
+ string: Mount Meru, also called Sumeru (Sanskrit)
+ double: 3.14159265359
+ bool: Yes \ No newline at end of file