diff options
Diffstat (limited to 'tests/php/phpt/variables/006-casting-obj2str.phpt')
-rw-r--r-- | tests/php/phpt/variables/006-casting-obj2str.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/php/phpt/variables/006-casting-obj2str.phpt b/tests/php/phpt/variables/006-casting-obj2str.phpt new file mode 100644 index 0000000..53d9707 --- /dev/null +++ b/tests/php/phpt/variables/006-casting-obj2str.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test Php::Value casting operators (object to string) +--DESCRIPTION-- + +Converting a php object to a string + + +--SKIPIF-- +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> +--FILEEOF-- +<?php + + +function native_value_casting($value) { + echo (string)$value, PHP_EOL; +} +class TestClass +{ + public function __toString() {return "I am TestClass";} +} + +TestVariables\value_cast2str(new TestClass()); +//native_value_casting(new TestClass()); + +TestVariables\value_cast2str("some string"); + + + +--EXPECT-- +I am TestClass +some string
\ No newline at end of file |