diff --git a/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php b/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php new file mode 100644 index 000000000..d76714714 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php @@ -0,0 +1,31 @@ + +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php.expectf b/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php.expectf new file mode 100644 index 000000000..b79a586b7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl-examples/dualiterator_001.php.expectf @@ -0,0 +1,11 @@ +bool(true) +bool(false) +bool(true) +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php b/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php new file mode 100644 index 000000000..34c8b262c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php @@ -0,0 +1,4 @@ +unserialize(""); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php.expectf b/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php.expectf new file mode 100644 index 000000000..249cadfa6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/ArrayObject_unserialize_empty_string.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s(%d): ArrayObject->unserialize('') +#1 {main} + thrown in %s.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php new file mode 100644 index 000000000..3550ad56a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php @@ -0,0 +1,39 @@ +getMessage() . "\n"; +} + +try { + new CallbackFilterIterator(null); +} catch(InvalidArgumentException $e) { + echo $e->getMessage() . "\n"; +} + +try { + new CallbackFilterIterator(new ArrayIterator(array()), null); +} catch(InvalidArgumentException $e) { + echo $e->getMessage() . "\n"; +} + +try { + new CallbackFilterIterator(new ArrayIterator(array()), array()); +} catch(InvalidArgumentException $e) { + echo $e->getMessage() . "\n"; +} + +$it = new CallbackFilterIterator(new ArrayIterator(array(1)), function() { + throw new Exception("some message"); +}); +try { + foreach($it as $e); +} catch(Exception $e) { + echo $e->getMessage() . "\n"; +} diff --git a/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php.expectf b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php.expectf new file mode 100644 index 000000000..864933bb4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest-002.php.expectf @@ -0,0 +1,6 @@ +CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given +Argument 1 passed to CallbackFilterIterator::__construct() must implement interface Iterator, null given +CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given +CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, no array or string given +CallbackFilterIterator::__construct() expects parameter 2 to be a valid callback, array must have exactly two members +some message \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php new file mode 100644 index 000000000..59260d510 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php @@ -0,0 +1,54 @@ +current() + , $key == $inner->key() + ); + return $value === 1 || $value === 4; +} + +$tests = array( + 'instance method' => function() { return array(new A, 'test'); }, + 'static method' => function() { return array('B', 'test'); }, + 'static method (2)' => function() { return 'B::test'; }, + 'function' => function() { return 'test'; }, + 'anonymous function' => function() { return function($value, $key, $inner) { return test($value, $key, $inner); }; }, +); + +foreach($tests as $name => $test) { + + $callback = $test(); + $it = new ArrayIterator(range(1, 5)); + $it = new CallbackFilterIterator($it, $callback); + + echo " = $name =\n"; + + foreach($it as $value) { + echo "=> $value\n"; + } + + // same test, with no reference to callback + + $it = new ArrayIterator(range(1, 5)); + $it = new CallbackFilterIterator($it, $test()); + unset($callback); + + foreach($it as $value) { + echo "=> $value\n"; + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php.expectf b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php.expectf new file mode 100644 index 000000000..d023fcdd9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/CallbackFilterIteratorTest.php.expectf @@ -0,0 +1,75 @@ += instance method = +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 + = static method = +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 + = static method (2) = +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 + = function = +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 + = anonymous function = +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 1 / 1 / 1 +3 / 2 / 1 / 1 +4 / 3 / 1 / 1 +=> 4 +5 / 4 / 1 / 1 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php b/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php new file mode 100644 index 000000000..c12931415 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php.expectf b/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php.expectf new file mode 100644 index 000000000..9fb77cab7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s(%d): DirectoryIterator->__construct('') +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/DirectoryIterator_empty_constructor.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php new file mode 100644 index 000000000..5335fe3dd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php @@ -0,0 +1,14 @@ +isFile()) { + $dir->next(); + } + echo $dir->getBasename(array()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php.expectf b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getBasename_pass_array.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php new file mode 100644 index 000000000..c54139def --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php @@ -0,0 +1,31 @@ +getFilename(), $skip)) { + continue; + } + $dit_exts[] = $file->getExtension(); + $nfo_exts[] = pathinfo($file->getFilename(), PATHINFO_EXTENSION); +} +var_dump($dit_exts === $nfo_exts); +sort($dit_exts); +var_dump($dit_exts); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php.expectf b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php.expectf new file mode 100644 index 000000000..fe75f6b85 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getExtension_basic.php.expectf @@ -0,0 +1,13 @@ +bool(true) +array(5) { + [0]=> + string(0) "" + [1]=> + string(0) "" + [2]=> + string(0) "" + [3]=> + string(9) "extension" + [4]=> + string(3) "txt" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php new file mode 100644 index 000000000..0f26a7f4a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php @@ -0,0 +1,6 @@ +getInode()); +?> diff --git a/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php.expectf b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php.expectf new file mode 100644 index 000000000..685ea20ea --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/DirectoryIterator_getInode_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplFileInfo->getInode() +#1 {main} + thrown in %s \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php b/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php new file mode 100644 index 000000000..1079ac161 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php @@ -0,0 +1,59 @@ +hasChildren()) { + return true; + } + printf("%s / %s / %d / %d\n" + , print_r($value, true) + , $key + , $value == $inner->current() + , $key == $inner->key() + ); + return $value === 1 || $value === 4; +} + +$tests = array( + 'instance method' => function() { return array(new A, 'test'); }, + 'static method' => function() { return array('B', 'test'); }, + 'static method (2)' => function() { return 'B::test'; }, + 'function' => function() { return 'test'; }, + 'anonymous function' => function() { return function($value, $key, $inner) { return test($value, $key, $inner); }; }, +); + +foreach($tests as $name => $test) { + + $callback = $test(); + $it = new RecursiveArrayIterator(array(1, array(2, 3), array(4, 5))); + $it = new RecursiveCallbackFilterIterator($it, $callback); + $it = new RecursiveIteratorIterator($it); + + echo " = $name =\n"; + + foreach($it as $value) { + echo "=> $value\n"; + } + + // same test, with no reference to callback + + $it = new RecursiveArrayIterator(array(1, array(2, 3), array(4, 5))); + $it = new RecursiveCallbackFilterIterator($it, $test()); + $it = new RecursiveIteratorIterator($it); + unset($callback); + + foreach($it as $value) { + echo "=> $value\n"; + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php.expectf b/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php.expectf new file mode 100644 index 000000000..3ca0cc00d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveCallbackFilterIteratorTest.php.expectf @@ -0,0 +1,75 @@ += instance method = +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 + = static method = +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 + = static method (2) = +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 + = function = +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 + = anonymous function = +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 +1 / 0 / 1 / 1 +=> 1 +2 / 0 / 1 / 1 +3 / 1 / 1 / 1 +4 / 0 / 1 / 1 +=> 4 +5 / 1 / 1 / 1 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php new file mode 100644 index 000000000..62e22b463 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php @@ -0,0 +1,35 @@ +valid()) { + $list[] = $it->getSubPath(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> diff --git a/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php.expectf b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php.expectf new file mode 100644 index 000000000..1d1e6b105 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPath_basic.php.expectf @@ -0,0 +1,5 @@ +depth1 +depth1 +depth1%cdepth2 +depth1%cdepth2 +depth1%cdepth2 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php new file mode 100644 index 000000000..f0649cca5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php @@ -0,0 +1,38 @@ +rewind(); //see https://bugs.php.net/bug.php?id=62914 +while($it->valid()) { + $list[] = $it->getSubPathname(); + $it->next(); +} +asort($list); +foreach ($list as $item) { + echo $item . "\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php.expectf b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php.expectf new file mode 100644 index 000000000..a1ed964e0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/RecursiveDirectoryIterator_getSubPathname_basic.php.expectf @@ -0,0 +1,9 @@ +. +.. +depth1%c. +depth1%c.. +depth1%cdepth2%c. +depth1%cdepth2%c.. +depth1%cdepth2%cgetSubPathname_test_2.tmp +depth1%cgetSubPathname_test_3.tmp +getSubPathname_test_1.tmp \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php b/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php new file mode 100644 index 000000000..3f6312996 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php @@ -0,0 +1,10 @@ + 'foo'); +$splArray = new SplFixedArray(); + +try { + $splArray->fromArray($array); +} catch (Exception $e) { + echo $e->getMessage(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php.expectf b/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php.expectf new file mode 100644 index 000000000..c288b93a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplArray_fromArray.php.expectf @@ -0,0 +1 @@ +integer overflow detected \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php new file mode 100644 index 000000000..72d95d311 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php @@ -0,0 +1,7 @@ +push("top"); +$list->bottom(array()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_array.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php new file mode 100644 index 000000000..304403730 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php @@ -0,0 +1,7 @@ +push("top"); +$list->bottom(3.14159); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_float.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php new file mode 100644 index 000000000..d41b99dd1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php @@ -0,0 +1,7 @@ +push("top"); +$list->bottom(45); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_integer.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php new file mode 100644 index 000000000..606118968 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php @@ -0,0 +1,7 @@ +push("top"); +$list->bottom(null); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_bottom_pass_null.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php new file mode 100644 index 000000000..41026a1ca --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php @@ -0,0 +1,5 @@ +count('foo'); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php new file mode 100644 index 000000000..3a488ce15 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php @@ -0,0 +1,4 @@ +count(new SplDoublyLinkedList(2)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_count_param_SplDoublyLinkedList.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php new file mode 100644 index 000000000..c2fb53dcf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php @@ -0,0 +1,4 @@ +current()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php new file mode 100644 index 000000000..0b29d378f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php @@ -0,0 +1,6 @@ +current()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_current_empty.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php new file mode 100644 index 000000000..baf747a81 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php @@ -0,0 +1,12 @@ +push(1); + $dll->push(2); + $dll->push(3); + + // Check the debug info + print_r($dll); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php.expectf new file mode 100644 index 000000000..468956ddc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_debug-info.php.expectf @@ -0,0 +1,11 @@ +SplDoublyLinkedList Object +( + [flags:SplDoublyLinkedList:private] => 0 + [dllist:SplDoublyLinkedList:private] => Array + ( + [0] => 1 + [1] => 2 + [2] => 3 + ) + +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php new file mode 100644 index 000000000..7c748ae1d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php @@ -0,0 +1,5 @@ +setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_KEEP); +echo $list->getIteratorMode(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php.expectf new file mode 100644 index 000000000..c22708346 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode.php.expectf @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php new file mode 100644 index 000000000..3353a4bea --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php @@ -0,0 +1,4 @@ +getIteratorMode(24); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_getIteratorMode_error.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php new file mode 100644 index 000000000..76e97790b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php @@ -0,0 +1,6 @@ +isEmpty("test")); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty-with-parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php new file mode 100644 index 000000000..1ce7cef49 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php @@ -0,0 +1,6 @@ +isEmpty()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php.expectf new file mode 100644 index 000000000..254d25151 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_empty.php.expectf @@ -0,0 +1 @@ +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php new file mode 100644 index 000000000..6355a967f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php @@ -0,0 +1,12 @@ +push(1); + $dll->push(2); + $dll->push(3); + //var_dump($dll); + + var_dump($dll->isEmpty("test")); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty-with-parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php new file mode 100644 index 000000000..241ffa5c2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php @@ -0,0 +1,12 @@ +push(1); + $dll->push(2); + $dll->push(3); + //var_dump($dll); + + var_dump($dll->isEmpty()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php.expectf new file mode 100644 index 000000000..eb28e0c67 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_isEmpty_not-empty.php.expectf @@ -0,0 +1 @@ +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php new file mode 100644 index 000000000..36c42615f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php @@ -0,0 +1,16 @@ +push('o'); +$list->push('o'); +$list->push('f'); + +$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); + +$list->rewind(); + +while ($tmp = $list->current()) { + echo $tmp; + $list->next(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php.expectf new file mode 100644 index 000000000..191028156 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_lifoMode.php.expectf @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php new file mode 100644 index 000000000..960eb43a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetExists(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php new file mode 100644 index 000000000..88b8f1155 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php @@ -0,0 +1,22 @@ +push('abc'); +$list->push('def'); + +// Validate that we can see the first value +if($list->offsetExists(0) === true) { + echo "PASS\n"; +} + +// Validate that we can see the second value +if($list->offsetExists(1) === true) { + echo "PASS\n"; +} + +// Check that there is no third value +if($list->offsetExists(2) === false) { + echo "PASS\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php.expectf new file mode 100644 index 000000000..50616673f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetExists_success.php.expectf @@ -0,0 +1,3 @@ +PASS +PASS +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php new file mode 100644 index 000000000..f8f105a97 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php @@ -0,0 +1,7 @@ +offsetGet(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_empty.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php new file mode 100644 index 000000000..f01ba0720 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php @@ -0,0 +1,7 @@ +push(1); +$dll->push(2); + +var_dump($dll->offsetGet()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_missing_param.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php new file mode 100644 index 000000000..67f2f7d56 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php @@ -0,0 +1,7 @@ +offsetGet( array( 'fail' ) ); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php.expectf new file mode 100644 index 000000000..709214567 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_array.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php new file mode 100644 index 000000000..9b2da7736 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php @@ -0,0 +1,7 @@ +offsetGet( 'fail' ); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php.expectf new file mode 100644 index 000000000..f5ef49674 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetGet_param_string.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php new file mode 100644 index 000000000..7ef05da77 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetSet(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php new file mode 100644 index 000000000..0c731d44f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetSet(2); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetSet_one_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php new file mode 100644 index 000000000..2a3df2d7e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php @@ -0,0 +1,18 @@ +push('1'); +$ll->push('2'); +$ll->push('3'); + +try { + +$ll->offsetUnset($ll->count() + 1); + +var_dump($ll); + +} catch(Exception $e) { +echo $e->getMessage(); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php.expectf new file mode 100644 index 000000000..bbf10ec8a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_greater_than_elements.php.expectf @@ -0,0 +1 @@ +Offset out of range \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php new file mode 100644 index 000000000..1e89ac29c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php @@ -0,0 +1,16 @@ +push(1); + $dll->push(2); + $dll->push(3); + + try { + $dll->offsetUnset(-1); + } + catch (Exception $e) { + echo $e->getMessage() . "\n"; + } +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php.expectf new file mode 100644 index 000000000..bbf10ec8a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_negative-parameter.php.expectf @@ -0,0 +1 @@ +Offset out of range \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php new file mode 100644 index 000000000..2f2430204 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php @@ -0,0 +1,16 @@ +push(1); + $dll->push(2); + $dll->push(3); + + try { + $dll->offsetUnset(3); + } + catch (Exception $e) { + echo $e->getMessage() . "\n"; + } +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php.expectf new file mode 100644 index 000000000..bbf10ec8a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.php.expectf @@ -0,0 +1 @@ +Offset out of range \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php new file mode 100644 index 000000000..6f5bee00f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php @@ -0,0 +1,7 @@ +push(1); +$ll->push(2); + +var_dump($ll->pop(1)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_noParams.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php new file mode 100644 index 000000000..ea7a80cad --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php @@ -0,0 +1,7 @@ +pop( 'param' ); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_pop_params.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php new file mode 100644 index 000000000..19e6e0126 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php @@ -0,0 +1,4 @@ +push()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_push_missing_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php new file mode 100644 index 000000000..ea0845bec --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php @@ -0,0 +1,16 @@ +enqueue("a"); +$q->enqueue("b"); + +var_dump($q, $ss = serialize($q), unserialize($ss)); + +$s = new SplStack(); + +$s->push("a"); +$s->push("b"); + +var_dump($s, $ss = serialize($s), unserialize($ss)); +?> +==END== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php.expectf new file mode 100644 index 000000000..4779fef62 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_serialization.php.expectf @@ -0,0 +1,47 @@ +object(SplQueue)#%d (2) { + ["flags":"SplDoublyLinkedList":private]=> + int(4) + ["dllist":"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + } +} +string(42) "C:8:"SplQueue":22:{i:4;:s:1:"a";:s:1:"b";}" +object(SplQueue)#%d (2) { + ["flags":"SplDoublyLinkedList":private]=> + int(4) + ["dllist":"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + } +} +object(SplStack)#%d (2) { + ["flags":"SplDoublyLinkedList":private]=> + int(6) + ["dllist":"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + } +} +string(42) "C:8:"SplStack":22:{i:6;:s:1:"a";:s:1:"b";}" +object(SplStack)#%d (2) { + ["flags":"SplDoublyLinkedList":private]=> + int(6) + ["dllist":"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + } +} +==END== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php new file mode 100644 index 000000000..e679dd49e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php @@ -0,0 +1,4 @@ +setIteratorMode(new SplDoublyLinkedList(2)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_setIteratorMode_param_SplDoublyLinkedList.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php new file mode 100644 index 000000000..729ca44ff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php @@ -0,0 +1,7 @@ +push("top"); +$list->top(array()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_array.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php new file mode 100644 index 000000000..acd3b4e91 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php @@ -0,0 +1,7 @@ +push("top"); +$list->top(3.14159); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_float.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php new file mode 100644 index 000000000..2b47fa887 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php @@ -0,0 +1,7 @@ +push("top"); +$list->top(45); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_integer.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php new file mode 100644 index 000000000..7ab92fce2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php @@ -0,0 +1,7 @@ +push("top"); +$list->top(null); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_top_pass_null.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php new file mode 100644 index 000000000..f8c718120 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php @@ -0,0 +1,4 @@ +unshift()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublyLinkedList_unshift_missing_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php new file mode 100644 index 000000000..1fa185136 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php @@ -0,0 +1,8 @@ +push('oh'); +$list->push('hai'); +$list->push('thar'); +$list->offsetUnset(0); +var_dump($list); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php.expectf new file mode 100644 index 000000000..074e11559 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first.php.expectf @@ -0,0 +1,11 @@ +object(SplDoublyLinkedList)#1 (2) { + [%u|b%"flags":%u|b%"SplDoublyLinkedList":private]=> + int(0) + [%u|b%"dllist":%u|b%"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + %string|unicode%(3) "hai" + [1]=> + %string|unicode%(4) "thar" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php new file mode 100644 index 000000000..1648f12b4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php @@ -0,0 +1,9 @@ +push('oh'); +$list->push('hai'); +$list->push('thar'); +echo $list->bottom() . "\n"; +$list->offsetUnset(0); +echo $list->bottom() . "\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php.expectf new file mode 100644 index 000000000..736a23cc4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_first002.php.expectf @@ -0,0 +1,2 @@ +oh +hai \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php new file mode 100644 index 000000000..81f986571 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php @@ -0,0 +1,8 @@ +push('oh'); +$list->push('hai'); +$list->push('thar'); +$list->offsetUnset(2); +var_dump($list); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php.expectf b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php.expectf new file mode 100644 index 000000000..9b435ff49 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplDoublylinkedlist_offsetunset_last.php.expectf @@ -0,0 +1,11 @@ +object(SplDoublyLinkedList)#1 (2) { + [%u|b%"flags":%u|b%"SplDoublyLinkedList":private]=> + int(0) + [%u|b%"dllist":%u|b%"SplDoublyLinkedList":private]=> + array(2) { + [0]=> + %string|unicode%(2) "oh" + [1]=> + %string|unicode%(3) "hai" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php b/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php new file mode 100644 index 000000000..79accf2d6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php @@ -0,0 +1,6 @@ +getGroup()); +?> diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php.expectf new file mode 100644 index 000000000..42dd7af86 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplFileInfo->getGroup() +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/SplFileInfo_getGroup_error.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php b/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php new file mode 100644 index 000000000..0f26a7f4a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php @@ -0,0 +1,6 @@ +getInode()); +?> diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php.expectf new file mode 100644 index 000000000..a0c03935c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplFileInfo->getInode() +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/SplFileInfo_getInode_error.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php b/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php new file mode 100644 index 000000000..df3881ad7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php @@ -0,0 +1,6 @@ +getOwner()); +?> diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php.expectf new file mode 100644 index 000000000..d251a1d72 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplFileInfo->getOwner() +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/SplFileInfo_getOwner_error.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php b/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php new file mode 100644 index 000000000..b3d81d627 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php @@ -0,0 +1,6 @@ +getPerms() == 0100557); +?> diff --git a/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php.expectf new file mode 100644 index 000000000..68cafee19 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileInfo_getPerms_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplFileInfo->getPerms() +#1 {main} + thrown in %s \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php new file mode 100644 index 000000000..e9d08ceeb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php @@ -0,0 +1,9 @@ +current(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php.expectf new file mode 100644 index 000000000..a81436628 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_current_basic.php.expectf @@ -0,0 +1 @@ +seek(2); + +echo $s->current('foo'); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_current_error001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_current_error001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_current_error001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php new file mode 100644 index 000000000..567ebe907 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php @@ -0,0 +1,11 @@ +seek(2); + +echo $s->current(); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php.expectf new file mode 100644 index 000000000..ad4ea7344 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_current_variation001.php.expectf @@ -0,0 +1,2 @@ +//line 3 +//line 3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php new file mode 100644 index 000000000..2cb7a5d5b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php @@ -0,0 +1,32 @@ +fflush()); + +/* + * test a unsuccessful flush +*/ +//create a basic stream class +class VariableStream { + var $position; + var $varname; + + function stream_open($path, $mode, $options, &$opened_path) + { + return true; + } + + function url_stat() { + } +} +stream_wrapper_register("SPLtest", "VariableStream"); +$ftruncate_test = ""; +//end creating stream + +//open an SplFileObject using the above test stream +$obj = New SplFileObject("SPLtest://ftruncate_test"); +var_dump($obj->fflush()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php.expectf new file mode 100644 index 000000000..98b68cefa --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fflush_basic_001.php.expectf @@ -0,0 +1,2 @@ +bool(true) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php new file mode 100644 index 000000000..b262b4595 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php @@ -0,0 +1,4 @@ +fpassthru(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php.expectf new file mode 100644 index 000000000..c08d198ac --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fpassthru_basic.php.expectf @@ -0,0 +1,5 @@ +first,second,third +1,2,3 +4,5,6 +7,8,9 +0,0,0 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php new file mode 100644 index 000000000..e53a00baf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php @@ -0,0 +1,55 @@ + 'aaa,bbb', + 1 => 'aaa,"bbb"', + 2 => '"aaa","bbb"', + 3 => 'aaa,bbb', + 4 => '"aaa",bbb', + 5 => '"aaa", "bbb"', + 6 => ',', + 7 => 'aaa,', + 8 => ',"aaa"', + 9 => '"",""', + 10 => '"""""",', + 11 => '""""",aaa', + 12 => 'aaa,bbb ', + 13 => 'aaa,"bbb "', + 14 => 'aaa"aaa","bbb"bbb', + 15 => 'aaa"aaa""",bbb', + 16 => 'aaa,"\\"bbb,ccc', + 17 => 'aaa"\\"a","bbb"', + 18 => '"\\"","aaa"', + 19 => '"\\""",aaa', +); + +foreach ($list as $v) { + $fo->fputcsv(explode(',', $v)); +} +unset($fo); + +$res = file($file); +foreach($res as &$val) +{ + $val = substr($val, 0, -1); +} +echo '$list = ';var_export($res);echo ";\n"; + +$fp = fopen($file, "r"); +$res = array(); +while($l=fgetcsv($fp)) +{ + $res[] = join(',',$l); +} +fclose($fp); + +echo '$list = ';var_export($res);echo ";\n"; + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php.expectf new file mode 100644 index 000000000..298729fb3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv.php.expectf @@ -0,0 +1,45 @@ +$list = array ( + 0 => 'aaa,bbb', + 1 => 'aaa,"""bbb"""', + 2 => '"""aaa""","""bbb"""', + 3 => 'aaa,bbb', + 4 => '"""aaa""",bbb', + 5 => '"""aaa"""," ""bbb"""', + 6 => ',', + 7 => 'aaa,', + 8 => ',"""aaa"""', + 9 => '"""""",""""""', + 10 => '"""""""""""""",', + 11 => '"""""""""""",aaa', + 12 => 'aaa,"bbb "', + 13 => 'aaa,"""bbb """', + 14 => '"aaa""aaa""","""bbb""bbb"', + 15 => '"aaa""aaa""""""",bbb', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', +); +$list = array ( + 0 => 'aaa,bbb', + 1 => 'aaa,"bbb"', + 2 => '"aaa","bbb"', + 3 => 'aaa,bbb', + 4 => '"aaa",bbb', + 5 => '"aaa", "bbb"', + 6 => ',', + 7 => 'aaa,', + 8 => ',"aaa"', + 9 => '"",""', + 10 => '"""""",', + 11 => '""""",aaa', + 12 => 'aaa,bbb ', + 13 => 'aaa,"bbb "', + 14 => 'aaa"aaa","bbb"bbb', + 15 => 'aaa"aaa""",bbb', + 16 => 'aaa,"\\"bbb,ccc', + 17 => 'aaa"\\"a","bbb"', + 18 => '"\\"","aaa"', + 19 => '"\\""",aaa', +); +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php new file mode 100644 index 000000000..6a1810dad --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php @@ -0,0 +1,12 @@ +fputcsv($data); + +var_dump($data); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php.expectf new file mode 100644 index 000000000..7121a2b7d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_002.php.expectf @@ -0,0 +1,24 @@ +HipHop Notice: %a +array(7) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + string(3) "foo" + [3]=> + string(4) "haha" + [4]=> + array(3) { + [0]=> + int(4) + [1]=> + int(5) + [2]=> + int(6) + } + [5]=> + float(1.3) + [6]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php new file mode 100644 index 000000000..6422122f0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php @@ -0,0 +1,19 @@ +fputcsv() ); + +// more than expected no. of args +echo "-- Testing fputcsv() with more than expected number of arguments --\n"; +$fields = array("fld1", "fld2"); +$delim = ";"; +$enclosure ="\""; +var_dump( $fo->fputcsv($fields, $delim, $enclosure, $fo) ); + +echo "Done\n"; \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php.expectf new file mode 100644 index 000000000..e6c951d78 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_error.php.expectf @@ -0,0 +1,8 @@ +*** Testing error conditions *** +-- Testing fputcsv() with zero argument -- +HipHop Warning: %a +NULL +-- Testing fputcsv() with more than expected number of arguments -- +HipHop Warning: %a +NULL +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php new file mode 100644 index 000000000..a60383309 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php @@ -0,0 +1,63 @@ +fputcsv($csv_field, $delimiter, $enclosure) ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php.expectf new file mode 100644 index 000000000..acf40cdfe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation1.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with all parameters specified *** + +-- file opened in r+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in a+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in w+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in x+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in r+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in r+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in r+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in a+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in a+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in a+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in w+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in w+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in w+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in x+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in x+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in x+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in r+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in r+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in r+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in a+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in a+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in a+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in w+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in w+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in w+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in x+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in x+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in x+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php new file mode 100644 index 000000000..cc47bc815 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php @@ -0,0 +1,56 @@ +fputcsv($csv_field) ); + + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php.expectf new file mode 100644 index 000000000..1f922db13 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation10.php.expectf @@ -0,0 +1,266 @@ +*** Testing fputcsv() : with no CSV format in the field *** + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) ""water_fruit\n" +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) ""water_fruit\n" +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) ""water_fruit\n" +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) ""water_fruit\n" +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) ""water_fruit\n" +" + +-- file opened in r+ -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in r+b -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in r+t -- +int(15) +int(15) +bool(false) +string(%d) ""water_fruit +" +" + +-- file opened in a+ -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in a+b -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in a+t -- +int(15) +int(15) +bool(false) +string(%d) ""water_fruit +" +" + +-- file opened in w+ -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in w+b -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in w+t -- +int(15) +int(15) +bool(false) +string(%d) ""water_fruit +" +" + +-- file opened in x+ -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in x+b -- +int(15) +int(15) +bool(false) +string(15) ""water_fruit +" +" + +-- file opened in x+t -- +int(15) +int(15) +bool(false) +string(%d) ""water_fruit +" +" + +-- file opened in r+ -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in r+b -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in r+t -- +int(1) +int(1) +bool(false) +string(%d) " +" + +-- file opened in a+ -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in a+b -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in a+t -- +int(1) +int(1) +bool(false) +string(%d) " +" + +-- file opened in w+ -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in w+b -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in w+t -- +int(1) +int(1) +bool(false) +string(%d) " +" + +-- file opened in x+ -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in x+b -- +int(1) +int(1) +bool(false) +string(1) " +" + +-- file opened in x+t -- +int(1) +int(1) +bool(false) +string(%d) " +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php new file mode 100644 index 000000000..60cbbbd8b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php @@ -0,0 +1,63 @@ +fputcsv($csv_field, $delimiter) ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php.expectf new file mode 100644 index 000000000..27d60bda1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation11.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with default enclosure value *** + +-- file opened in r+ -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in r+b -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in r+t -- +int(14) +int(14) +bool(false) +string(%d) ""water,fruit" +" + +-- file opened in a+ -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in a+b -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in a+t -- +int(14) +int(14) +bool(false) +string(%d) ""water,fruit" +" + +-- file opened in w+ -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in w+b -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in w+t -- +int(14) +int(14) +bool(false) +string(%d) ""water,fruit" +" + +-- file opened in x+ -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in x+b -- +int(14) +int(14) +bool(false) +string(14) ""water,fruit" +" + +-- file opened in x+t -- +int(14) +int(14) +bool(false) +string(%d) ""water,fruit" +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) ""&water&:&fruit&" +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) ""&water&:&fruit&" +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) ""&water&:&fruit&" +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) ""&water&:&fruit&" +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) ""&water&:&fruit&" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) ""=water===fruit=" +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) ""=water===fruit=" +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) ""=water===fruit=" +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) ""=water===fruit=" +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) ""=water===fruit=" +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) ""-water--fruit-air" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) ""-water--fruit-air" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) ""-water--fruit-air" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) ""-water--fruit-air" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) ""-water--fruit-air" +" + +-- file opened in r+ -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in r+b -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in r+t -- +int(24) +int(24) +bool(false) +string(%d) ""-water---fruit---air-" +" + +-- file opened in a+ -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in a+b -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in a+t -- +int(24) +int(24) +bool(false) +string(%d) ""-water---fruit---air-" +" + +-- file opened in w+ -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in w+b -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in w+t -- +int(24) +int(24) +bool(false) +string(%d) ""-water---fruit---air-" +" + +-- file opened in x+ -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in x+b -- +int(24) +int(24) +bool(false) +string(24) ""-water---fruit---air-" +" + +-- file opened in x+t -- +int(24) +int(24) +bool(false) +string(%d) ""-water---fruit---air-" +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php new file mode 100644 index 000000000..3ebdf2f74 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php @@ -0,0 +1,64 @@ +fputcsv($csv_field, '+') ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php.expectf new file mode 100644 index 000000000..afb55a6e2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation12.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with default enclosure and different delimiter value *** + +-- file opened in r+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in a+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in w+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in x+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php new file mode 100644 index 000000000..dcf7f3c4f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php @@ -0,0 +1,18 @@ +fputcsv(array('water', 'fruit'), ',,', '"')); + +unset($fo); + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php.expectf new file mode 100644 index 000000000..f32f0379c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation13.php.expectf @@ -0,0 +1,4 @@ +*** Testing fputcsv() : with default enclosure & delimiter of two chars *** +HipHop Warning: %a +bool(false) +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php new file mode 100644 index 000000000..7b01ce245 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php @@ -0,0 +1,18 @@ +fputcsv(array('water', 'fruit'), ',,', '""')); + +unset($fo); + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php.expectf new file mode 100644 index 000000000..59c2e3af9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation14.php.expectf @@ -0,0 +1,4 @@ +*** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode *** +HipHop Warning: %a +bool(false) +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php new file mode 100644 index 000000000..a780eef0f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php @@ -0,0 +1,63 @@ +fputcsv($csv_field) ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php.expectf new file mode 100644 index 000000000..b8b4d906e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation5.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with default arguments value *** + +-- file opened in r+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in a+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in w+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in x+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) ""^water^ ^fruit^" +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) ""^water^ ^fruit^" +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) ""&""""""""&:&""&:,:"":&,&:,,,," +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php new file mode 100644 index 000000000..66b675854 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php @@ -0,0 +1,66 @@ +fputcsv($csv_field, '+', '%') ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php.expectf new file mode 100644 index 000000000..289f41037 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation6.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with different delimiter and enclosure *** + +-- file opened in r+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in r+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in a+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in a+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in w+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in w+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in x+ -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+b -- +int(12) +int(12) +bool(false) +string(12) "water,fruit +" + +-- file opened in x+t -- +int(12) +int(12) +bool(false) +string(%d) "water,fruit +" + +-- file opened in r+ -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in r+b -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in r+t -- +int(15) +int(15) +bool(false) +string(%d) ""water","fruit +" + +-- file opened in a+ -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in a+b -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in a+t -- +int(15) +int(15) +bool(false) +string(%d) ""water","fruit +" + +-- file opened in w+ -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in w+b -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in w+t -- +int(15) +int(15) +bool(false) +string(%d) ""water","fruit +" + +-- file opened in x+ -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in x+b -- +int(15) +int(15) +bool(false) +string(15) ""water","fruit +" + +-- file opened in x+t -- +int(15) +int(15) +bool(false) +string(%d) ""water","fruit +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) ""water","fruit" +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) ""water","fruit" +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) ""water","fruit" +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) ""water","fruit" +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) ""water","fruit" +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "%^water^ ^fruit^% +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "%^water^ ^fruit^% +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "%^water^ ^fruit^% +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "%^water^ ^fruit^% +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "%^water^ ^fruit^% +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "&water&:&fruit& +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "&water&:&fruit& +" + +-- file opened in r+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in r+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in a+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in a+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in w+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in w+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in x+ -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+b -- +int(16) +int(16) +bool(false) +string(16) "=water===fruit= +" + +-- file opened in x+t -- +int(16) +int(16) +bool(false) +string(%d) "=water===fruit= +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "-water--fruit-air +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "-water--fruit-air +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "-water---fruit---air- +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "-water---fruit---air- +" + +-- file opened in r+ -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in r+b -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in r+t -- +int(24) +int(24) +bool(false) +string(%d) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in a+ -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in a+b -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in a+t -- +int(24) +int(24) +bool(false) +string(%d) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in w+ -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in w+b -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in w+t -- +int(24) +int(24) +bool(false) +string(%d) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in x+ -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in x+b -- +int(24) +int(24) +bool(false) +string(24) "&""""&:&"&:,:":&,&:,,,, +" + +-- file opened in x+t -- +int(24) +int(24) +bool(false) +string(%d) "&""""&:&"&:,:":&,&:,,,, +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php new file mode 100644 index 000000000..0f68eac47 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php @@ -0,0 +1,66 @@ +fputcsv($csv_field, '+', $enclosure) ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php.expectf new file mode 100644 index 000000000..ff83e4224 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation7.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with different delimiter and same enclosure *** + +-- file opened in r+ -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in r+b -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in r+t -- +int(12) +int(12) +bool(false) +string(%d) "water+fruit +" + +-- file opened in a+ -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in a+b -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in a+t -- +int(12) +int(12) +bool(false) +string(%d) "water+fruit +" + +-- file opened in w+ -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in w+b -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in w+t -- +int(12) +int(12) +bool(false) +string(%d) "water+fruit +" + +-- file opened in x+ -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in x+b -- +int(12) +int(12) +bool(false) +string(12) "water+fruit +" + +-- file opened in x+t -- +int(12) +int(12) +bool(false) +string(%d) "water+fruit +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) """"water"",""fruit" +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) """"water"",""fruit" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) """"water"",""fruit""" +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) """"water"",""fruit""" +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "^^^water^^ ^^fruit^^^ +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "^^^water^^ ^^fruit^^^ +" + +-- file opened in r+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in r+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in r+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in a+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in a+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in a+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in w+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in w+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in w+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in x+ -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in x+b -- +int(22) +int(22) +bool(false) +string(22) "&&&water&&:&&fruit&&& +" + +-- file opened in x+t -- +int(22) +int(22) +bool(false) +string(%d) "&&&water&&:&&fruit&&& +" + +-- file opened in r+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in r+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in r+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in a+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in a+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in a+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in w+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in w+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in w+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in x+ -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in x+b -- +int(23) +int(23) +bool(false) +string(23) "===water======fruit=== +" + +-- file opened in x+t -- +int(23) +int(23) +bool(false) +string(%d) "===water======fruit=== +" + +-- file opened in r+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in r+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in r+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in a+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in a+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in a+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in w+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in w+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in w+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in x+ -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in x+b -- +int(24) +int(24) +bool(false) +string(24) "---water----fruit--air- +" + +-- file opened in x+t -- +int(24) +int(24) +bool(false) +string(%d) "---water----fruit--air- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) "---water------fruit------air--- +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) "---water------fruit------air--- +" + +-- file opened in r+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in r+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in r+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in a+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in w+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+ -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+b -- +int(32) +int(32) +bool(false) +string(32) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" + +-- file opened in x+t -- +int(32) +int(32) +bool(false) +string(%d) "&&&""""&&:&&"&&:,:":&&,&&:,,,,& +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php new file mode 100644 index 000000000..e76dc852b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php @@ -0,0 +1,66 @@ +fputcsv($csv_field, $delimiter, '+') ); + // check the file pointer position and eof + var_dump( $fo->ftell() ); + var_dump( $fo->eof() ); + //close the file + unset($fo); + + // print the file contents + var_dump( file_get_contents($file) ); + + //delete file + unlink($file); + } //end of mode loop +} // end of foreach + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php.expectf new file mode 100644 index 000000000..5fda91e80 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fputcsv_variation8.php.expectf @@ -0,0 +1,758 @@ +*** Testing fputcsv() : with same delimiter and different enclosure *** + +-- file opened in r+ -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in r+b -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in r+t -- +int(14) +int(14) +bool(false) +string(%d) "+water,fruit+ +" + +-- file opened in a+ -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in a+b -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in a+t -- +int(14) +int(14) +bool(false) +string(%d) "+water,fruit+ +" + +-- file opened in w+ -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in w+b -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in w+t -- +int(14) +int(14) +bool(false) +string(%d) "+water,fruit+ +" + +-- file opened in x+ -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in x+b -- +int(14) +int(14) +bool(false) +string(14) "+water,fruit+ +" + +-- file opened in x+t -- +int(14) +int(14) +bool(false) +string(%d) "+water,fruit+ +" + +-- file opened in r+ -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in r+b -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in r+t -- +int(17) +int(17) +bool(false) +string(%d) "+"water","fruit+ +" + +-- file opened in a+ -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in a+b -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in a+t -- +int(17) +int(17) +bool(false) +string(%d) "+"water","fruit+ +" + +-- file opened in w+ -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in w+b -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in w+t -- +int(17) +int(17) +bool(false) +string(%d) "+"water","fruit+ +" + +-- file opened in x+ -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in x+b -- +int(17) +int(17) +bool(false) +string(17) "+"water","fruit+ +" + +-- file opened in x+t -- +int(17) +int(17) +bool(false) +string(%d) "+"water","fruit+ +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "+"water","fruit"+ +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "+"water","fruit"+ +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "+"water","fruit"+ +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "+"water","fruit"+ +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "+"water","fruit"+ +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "+^water^ ^fruit^+ +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "+^water^ ^fruit^+ +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "+^water^ ^fruit^+ +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "+^water^ ^fruit^+ +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "+^water^ ^fruit^+ +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "+&water&:&fruit&+ +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "+&water&:&fruit&+ +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "+&water&:&fruit&+ +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "+&water&:&fruit&+ +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "+&water&:&fruit&+ +" + +-- file opened in r+ -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in r+b -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in r+t -- +int(18) +int(18) +bool(false) +string(%d) "+=water===fruit=+ +" + +-- file opened in a+ -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in a+b -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in a+t -- +int(18) +int(18) +bool(false) +string(%d) "+=water===fruit=+ +" + +-- file opened in w+ -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in w+b -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in w+t -- +int(18) +int(18) +bool(false) +string(%d) "+=water===fruit=+ +" + +-- file opened in x+ -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in x+b -- +int(18) +int(18) +bool(false) +string(18) "+=water===fruit=+ +" + +-- file opened in x+t -- +int(18) +int(18) +bool(false) +string(%d) "+=water===fruit=+ +" + +-- file opened in r+ -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in r+b -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in r+t -- +int(20) +int(20) +bool(false) +string(%d) "+-water--fruit-air+ +" + +-- file opened in a+ -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in a+b -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in a+t -- +int(20) +int(20) +bool(false) +string(%d) "+-water--fruit-air+ +" + +-- file opened in w+ -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in w+b -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in w+t -- +int(20) +int(20) +bool(false) +string(%d) "+-water--fruit-air+ +" + +-- file opened in x+ -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in x+b -- +int(20) +int(20) +bool(false) +string(20) "+-water--fruit-air+ +" + +-- file opened in x+t -- +int(20) +int(20) +bool(false) +string(%d) "+-water--fruit-air+ +" + +-- file opened in r+ -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in r+b -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in r+t -- +int(24) +int(24) +bool(false) +string(%d) "+-water---fruit---air-+ +" + +-- file opened in a+ -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in a+b -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in a+t -- +int(24) +int(24) +bool(false) +string(%d) "+-water---fruit---air-+ +" + +-- file opened in w+ -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in w+b -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in w+t -- +int(24) +int(24) +bool(false) +string(%d) "+-water---fruit---air-+ +" + +-- file opened in x+ -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in x+b -- +int(24) +int(24) +bool(false) +string(24) "+-water---fruit---air-+ +" + +-- file opened in x+t -- +int(24) +int(24) +bool(false) +string(%d) "+-water---fruit---air-+ +" + +-- file opened in r+ -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in r+b -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in r+t -- +int(26) +int(26) +bool(false) +string(%d) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in a+ -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in a+b -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in a+t -- +int(26) +int(26) +bool(false) +string(%d) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in w+ -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in w+b -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in w+t -- +int(26) +int(26) +bool(false) +string(%d) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in x+ -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in x+b -- +int(26) +int(26) +bool(false) +string(26) "+&""""&:&"&:,:":&,&:,,,,+ +" + +-- file opened in x+t -- +int(26) +int(26) +bool(false) +string(%d) "+&""""&:&"&:,:":&,&:,,,,+ +" +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php new file mode 100644 index 000000000..cc8680c51 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php @@ -0,0 +1,4 @@ +fscanf('%s')); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php.expectf new file mode 100644 index 000000000..4265af51f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fscanf_basic.php.expectf @@ -0,0 +1,4 @@ +array(1) { + [0]=> + string(18) "first,second,third" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php new file mode 100644 index 000000000..c8af88f63 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php @@ -0,0 +1,5 @@ +fseek(1,2,3); +$obj->fseek(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php.expectf new file mode 100644 index 000000000..55529a618 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fseek_error_001.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php new file mode 100644 index 000000000..d17b19c2c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php @@ -0,0 +1,27 @@ +ftruncate(1); +} catch (LogicException $e) { + echo($e->getMessage()); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php.expectf new file mode 100644 index 000000000..3284078ee --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_ftruncate_error_001.php.expectf @@ -0,0 +1 @@ +Can't truncate file %s \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php new file mode 100644 index 000000000..2038443c9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php @@ -0,0 +1,5 @@ +fwrite(); +$obj->fwrite('6,6,6',25,null); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php.expectf new file mode 100644 index 000000000..55529a618 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_fwrite_error_001.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php new file mode 100644 index 000000000..71a160e02 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php @@ -0,0 +1,5 @@ +getCsvControl()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php.expectf new file mode 100644 index 000000000..1863f3ee8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getCsvControl_basic_001.php.expectf @@ -0,0 +1,6 @@ +array(2) { + [0]=> + %unicode|string%(1) "," + [1]=> + %unicode|string%(1) """ +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php new file mode 100644 index 000000000..f4f702632 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php @@ -0,0 +1,5 @@ +getChildren('string'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getchildren_error001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php new file mode 100644 index 000000000..10f3c5a26 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php @@ -0,0 +1,17 @@ +setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_AHEAD); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::SKIP_EMPTY); +var_dump($fo->getFlags()); + +$fo->setFlags(SplFileObject::READ_CSV); +var_dump($fo->getFlags()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php.expectf new file mode 100644 index 000000000..c26cd0241 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_getflags_variation001.php.expectf @@ -0,0 +1,4 @@ +int(1) +int(2) +int(4) +int(8) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php new file mode 100644 index 000000000..f75a016bd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php @@ -0,0 +1,5 @@ +hasChildren('string'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_haschildren_error001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php new file mode 100644 index 000000000..eef54f08f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php @@ -0,0 +1,10 @@ +seek(3); +echo $s->key(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php.expectf new file mode 100644 index 000000000..e440e5c84 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_basic.php.expectf @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php new file mode 100644 index 000000000..45f2353e6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php @@ -0,0 +1,12 @@ +seek(12); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php.expectf new file mode 100644 index 000000000..d11b81214 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error001.php.expectf @@ -0,0 +1,2 @@ +int(13) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php new file mode 100644 index 000000000..e7c8f7aff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php @@ -0,0 +1,12 @@ +seek(120); +$s->next(); +var_dump($s->key()); +var_dump($s->valid()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php.expectf new file mode 100644 index 000000000..d11b81214 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error002.php.expectf @@ -0,0 +1,2 @@ +int(13) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php new file mode 100644 index 000000000..de7054a15 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php @@ -0,0 +1,8 @@ +key(3); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_key_error003.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php new file mode 100644 index 000000000..a1e6e81c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php @@ -0,0 +1,12 @@ +current(); +$s->next(); + +echo $s->current(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php.expectf new file mode 100644 index 000000000..02335890d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_next_basic.php.expectf @@ -0,0 +1,2 @@ +seek(13); +echo $s->current(); + +$s->next(); +echo $s->current(); +var_dump($s->valid()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation001.php.expectf new file mode 100644 index 000000000..4c849dc76 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation001.php.expectf @@ -0,0 +1,2 @@ +?> +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php new file mode 100644 index 000000000..e5ef5b195 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php @@ -0,0 +1,18 @@ +seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); + +$s->setFlags(SplFileObject::READ_AHEAD); + +$s->seek(2); +echo $s->current(); +$s->next(); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php.expectf new file mode 100644 index 000000000..d19788e08 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_next_variation002.php.expectf @@ -0,0 +1,4 @@ +//line 3 +//line 4 +//line 3 +//line 4 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php new file mode 100644 index 000000000..9bf76db2f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php @@ -0,0 +1,12 @@ +seek(3); + +$s->rewind(); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php.expectf new file mode 100644 index 000000000..a81436628 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_basic.php.expectf @@ -0,0 +1 @@ +seek(15); +echo $s->current(); +$s->next(); +echo $s->current(); +var_dump($s->valid()); +$s->rewind(); +var_dump($s->valid()); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_variation001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_variation001.php.expectf new file mode 100644 index 000000000..e8a7e007c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_rewind_variation001.php.expectf @@ -0,0 +1,4 @@ +?> +bool(false) +bool(true) +seek(2); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_seek_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_basic.php.expectf new file mode 100644 index 000000000..7d0eb95a8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_basic.php.expectf @@ -0,0 +1 @@ +//line 3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error002.php b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error002.php new file mode 100644 index 000000000..cc00fa6b9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error002.php @@ -0,0 +1,10 @@ +seek(20); +echo $s->current(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error002.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error002.php.expectf new file mode 100644 index 000000000..e69de29bb diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php new file mode 100644 index 000000000..c32daf58a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php @@ -0,0 +1,10 @@ +seek(1,2); +$obj->seek(); +try { + $obj->seek(-1); +} catch (LogicException $e) { + echo($e->getMessage()); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php.expectf new file mode 100644 index 000000000..b023d0e7e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFileObject_seek_error_001.php.expectf @@ -0,0 +1,3 @@ +HipHop Warning: %a +HipHop Warning: %a +Can't seek file %s to negative line %s \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php new file mode 100644 index 000000000..ae4a0c4b4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_array.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php new file mode 100644 index 000000000..f5fa94a84 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php @@ -0,0 +1,7 @@ +getSize(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php.expectf new file mode 100644 index 000000000..e440e5c84 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_float.php.expectf @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php new file mode 100644 index 000000000..6d643f6a4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php.expectf new file mode 100644 index 000000000..f0ac41c0b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_null.php.expectf @@ -0,0 +1,3 @@ +SplFixedArray Object +( +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php new file mode 100644 index 000000000..374f925e6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray__construct_param_string.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php new file mode 100644 index 000000000..71fe1a2d3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php.expectf new file mode 100644 index 000000000..e7cb54af2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_construct_param_SplFixedArray.php.expectf @@ -0,0 +1,3 @@ +HipHop Warning: %a +object(SplFixedArray)#1 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php new file mode 100644 index 000000000..af53457f3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php @@ -0,0 +1,8 @@ +count(3); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_checkParams.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php new file mode 100644 index 000000000..24027d361 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php @@ -0,0 +1,4 @@ +count(3); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_count_param_int.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php new file mode 100644 index 000000000..5929bb22e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php @@ -0,0 +1,13 @@ +current( array("this","should","not","execute") ); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php.expectf new file mode 100644 index 000000000..771ac268e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_current_param.php.expectf @@ -0,0 +1,3 @@ +HipHop Warning: %a +HipHop Warning: %a +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php new file mode 100644 index 000000000..7415460d4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php new file mode 100644 index 000000000..1b564f47c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromArray_invalid_parameter_002.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php new file mode 100644 index 000000000..25861e720 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php @@ -0,0 +1,6 @@ + 1, + 2 => '2', + 3 => false)); +var_dump($array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php.expectf new file mode 100644 index 000000000..921f1a31a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_indexes.php.expectf @@ -0,0 +1,10 @@ +object(SplFixedArray)#1 (4) { + [0]=> + NULL + [1]=> + int(1) + [2]=> + %string|unicode%(1) "2" + [3]=> + bool(false) +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php new file mode 100644 index 000000000..c14c1a2ba --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php @@ -0,0 +1,7 @@ + 1, + 2 => '2', + 3 => false), + false); +var_dump($array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php.expectf new file mode 100644 index 000000000..dca2412c6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_non_indexes.php.expectf @@ -0,0 +1,8 @@ +object(SplFixedArray)#1 (3) { + [0]=> + int(1) + [1]=> + %string|unicode%(1) "2" + [2]=> + bool(false) +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php new file mode 100644 index 000000000..4b1490418 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_boolean.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php new file mode 100644 index 000000000..fe73cfbe8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php.expectf new file mode 100644 index 000000000..cf3d6e44e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_fromarray_param_multiarray.php.expectf @@ -0,0 +1,7 @@ +object(SplFixedArray)#1 (1) { + [0]=> + array(1) { + [0]=> + %string|unicode%(1) "1" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php new file mode 100644 index 000000000..10e37d77e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php @@ -0,0 +1,4 @@ +getSize(3); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php.expectf new file mode 100644 index 000000000..96ec1da1d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_getSize_pass_param.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +*test* \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php new file mode 100644 index 000000000..e1505ab7b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php @@ -0,0 +1,13 @@ +key( array("this","should","not","execute") ); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php.expectf new file mode 100644 index 000000000..771ac268e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_param.php.expectf @@ -0,0 +1,3 @@ +HipHop Warning: %a +HipHop Warning: %a +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php new file mode 100644 index 000000000..10aaea70e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php @@ -0,0 +1,13 @@ +key( ); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php.expectf new file mode 100644 index 000000000..6da806d7a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_key_setsize.php.expectf @@ -0,0 +1 @@ +0123 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php new file mode 100644 index 000000000..63b945d77 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php @@ -0,0 +1,11 @@ +next( "invalid" ); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_next_param.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php new file mode 100644 index 000000000..7a7b9c10d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetExists(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php new file mode 100644 index 000000000..e822c98ef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php @@ -0,0 +1,6 @@ +offsetExists(-10) === false) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php.expectf new file mode 100644 index 000000000..465701e34 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetExists_less_than_zero.php.expectf @@ -0,0 +1 @@ +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php new file mode 100644 index 000000000..39bf64c6f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php @@ -0,0 +1,8 @@ +offsetGet(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetGet_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php new file mode 100644 index 000000000..eaf504a70 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetSet(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php new file mode 100644 index 000000000..b96c54ff8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetSet(2); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetSet_one_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php new file mode 100644 index 000000000..3f9feab47 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php @@ -0,0 +1,7 @@ +offsetUnset(); +if(is_null($a)) { + echo 'PASS'; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php.expectf new file mode 100644 index 000000000..5fa2682c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +PASS \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php new file mode 100644 index 000000000..08f665085 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php @@ -0,0 +1,15 @@ +offsetUnset("4"); + + var_dump($fixedArray); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php.expectf new file mode 100644 index 000000000..5288b5d22 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_offsetUnset_string.php.expectf @@ -0,0 +1,12 @@ +object(SplFixedArray)#1 (5) { + [0]=> + %string|unicode%(14) "PHPNW Testfest" + [1]=> + %string|unicode%(14) "PHPNW Testfest" + [2]=> + %string|unicode%(14) "PHPNW Testfest" + [3]=> + %string|unicode%(14) "PHPNW Testfest" + [4]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php new file mode 100644 index 000000000..23ba79cbf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php @@ -0,0 +1,11 @@ +rewind( "invalid" ); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_rewind_param.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php new file mode 100644 index 000000000..346a3c493 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php @@ -0,0 +1,10 @@ +setSize(2); +var_dump($array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php.expectf new file mode 100644 index 000000000..8d1869b28 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_filled_to_smaller.php.expectf @@ -0,0 +1,6 @@ +object(SplFixedArray)#1 (2) { + [0]=> + int(1) + [1]=> + int(1) +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php new file mode 100644 index 000000000..c173e8f62 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php @@ -0,0 +1,5 @@ +setSize(array()); +var_dump($fixed_array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php.expectf new file mode 100644 index 000000000..c5c56b747 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_array.php.expectf @@ -0,0 +1,7 @@ +HipHop Warning: %a +object(SplFixedArray)#1 (2) { + [0]=> + NULL + [1]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php new file mode 100644 index 000000000..1c755776d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php @@ -0,0 +1,5 @@ +setSize(3.14159); +var_dump($fixed_array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php.expectf new file mode 100644 index 000000000..2930c89b4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_float.php.expectf @@ -0,0 +1,8 @@ +object(SplFixedArray)#1 (3) { + [0]=> + NULL + [1]=> + NULL + [2]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php new file mode 100644 index 000000000..a1f755b34 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php @@ -0,0 +1,5 @@ +setSize(null); +var_dump($fixed_array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php.expectf new file mode 100644 index 000000000..ec1e3d312 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_param_null.php.expectf @@ -0,0 +1,2 @@ +object(SplFixedArray)#1 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php new file mode 100644 index 000000000..6231ea1cf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php @@ -0,0 +1,10 @@ +setSize(3); +print_r($array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php.expectf new file mode 100644 index 000000000..3ff182c41 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setSize_reduce.php.expectf @@ -0,0 +1,6 @@ +SplFixedArray Object +( + [0] => a + [1] => b + [2] => c +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php new file mode 100644 index 000000000..5e97759a0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php @@ -0,0 +1,10 @@ +setSize(2); +var_dump($array); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php.expectf new file mode 100644 index 000000000..79de6945a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_001.php.expectf @@ -0,0 +1,6 @@ +object(SplFixedArray)#1 (2) { + [0]=> + %string|unicode%(3) "one" + [1]=> + %string|unicode%(3) "two" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php new file mode 100644 index 000000000..e3042f1c2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php @@ -0,0 +1,17 @@ +setSize(4); + +$array[2] = "Value 3"; +$array[3] = "Value 4"; + +print_r($array); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php.expectf new file mode 100644 index 000000000..90df7cddf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_grow.php.expectf @@ -0,0 +1,7 @@ +SplFixedArray Object +( + [0] => Value 1 + [1] => Value 2 + [2] => Value 3 + [3] => Value 4 +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php new file mode 100644 index 000000000..cf683dcca --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php @@ -0,0 +1,12 @@ +setSize(4); +var_dump($array); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php.expectf new file mode 100644 index 000000000..4fd3e8ab2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_setsize_shrink.php.expectf @@ -0,0 +1,10 @@ +object(SplFixedArray)#1 (4) { + [0]=> + int(1) + [1]=> + int(1) + [2]=> + int(1) + [3]=> + int(1) +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php b/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php new file mode 100644 index 000000000..dbbd803df --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php @@ -0,0 +1,12 @@ +count(1); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php.expectf b/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplFixedArray_toArray_with-params.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php new file mode 100644 index 000000000..6f7c43c66 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php @@ -0,0 +1,20 @@ +count($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php.expectf new file mode 100644 index 000000000..6e7628d38 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_count_invalid_parameter.php.expectf @@ -0,0 +1,14 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php new file mode 100644 index 000000000..e25b42ed7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php @@ -0,0 +1,20 @@ +extract($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php.expectf new file mode 100644 index 000000000..6e7628d38 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_extract_invalid_parameter.php.expectf @@ -0,0 +1,14 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php new file mode 100644 index 000000000..c2cb1a493 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php @@ -0,0 +1,7 @@ +insert()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_insert_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php new file mode 100644 index 000000000..191317d2d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php @@ -0,0 +1,7 @@ +isEmpty()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php.expectf b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php.expectf new file mode 100644 index 000000000..254d25151 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty.php.expectf @@ -0,0 +1 @@ +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php new file mode 100644 index 000000000..048cf72a3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php @@ -0,0 +1,20 @@ +isEmpty($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php.expectf new file mode 100644 index 000000000..6e7628d38 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplHeap_isEmpty_invalid_parameter.php.expectf @@ -0,0 +1,14 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php new file mode 100644 index 000000000..db5d70496 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php @@ -0,0 +1,19 @@ +addAll($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_addAll_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php new file mode 100644 index 000000000..4f23734ef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php @@ -0,0 +1,8 @@ +attach(true)); +var_dump($s->attach(new stdClass, true, true)); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php.expectf new file mode 100644 index 000000000..b9d470d59 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_attach_invalid_parameter.php.expectf @@ -0,0 +1,4 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php new file mode 100644 index 000000000..2635d079c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php @@ -0,0 +1,19 @@ +contains($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_contains_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php new file mode 100644 index 000000000..112ec5f29 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php @@ -0,0 +1,7 @@ +current()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_current_empty_storage.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php new file mode 100644 index 000000000..0333590ca --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php @@ -0,0 +1,19 @@ +detach($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_detach_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php new file mode 100644 index 000000000..fdb646fd6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php @@ -0,0 +1,49 @@ +offsetGet($o1); + +class MySplObjectStorage extends SplObjectStorage { + public function getHash($obj) { + return 2; + } +} + +try { + $s1 = new MySplObjectStorage; + $s1[$o1] = "foo"; +} catch(Exception $e) { + echo "caught\n"; +} + +class MySplObjectStorage2 extends SplObjectStorage { + public function getHash($obj) { + throw new Exception("foo"); + return "asd"; + } +} + +try { + $s2 = new MySplObjectStorage2; + $s2[$o2] = "foo"; +} catch(Exception $e) { + echo "caught\n"; +} + +class MySplObjectStorage3 extends SplObjectStorage { + public function getHash($obj) { + return "asd"; + } +} + +$s3 = new MySplObjectStorage3; +$s3[$o1] = $o1; +var_dump($s3[$o1]); +$s3[$o2] = $o2; + +var_dump($s3[$o1] === $s3[$o2]); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php.expectf new file mode 100644 index 000000000..6048f2ac5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getHash.php.expectf @@ -0,0 +1,7 @@ +some_value +caught +caught +object(stdClass)#2 (0) { +} +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php new file mode 100644 index 000000000..d63c546df --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php @@ -0,0 +1,7 @@ +getInfo()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_getInfo_empty_storage.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php new file mode 100644 index 000000000..e1c362c9a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php @@ -0,0 +1,9 @@ +offsetGet($o1); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php.expectf new file mode 100644 index 000000000..f18d5a04d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet.php.expectf @@ -0,0 +1 @@ +some_value \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php new file mode 100644 index 000000000..cfec71d40 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php @@ -0,0 +1,21 @@ +offsetGet($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php new file mode 100644 index 000000000..12341a8f5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php @@ -0,0 +1,12 @@ +offsetGet($o1); +} catch (UnexpectedValueException $e) { + echo $e->getMessage(); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php.expectf new file mode 100644 index 000000000..07917ecbd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_offsetGet_missing_object.php.expectf @@ -0,0 +1 @@ +Object not found \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php new file mode 100644 index 000000000..070683f02 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php @@ -0,0 +1,19 @@ +attach($a); + $foo->attach($b); + + $bar = new SplObjectStorage; + $bar->attach($b); + $bar->attach($c); + + $foo->removeAllExcept($bar); + var_dump($foo->contains($a)); + var_dump($foo->contains($b)); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php.expectf new file mode 100644 index 000000000..9afc88e48 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_basic.php.expectf @@ -0,0 +1,2 @@ +bool(false) +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php new file mode 100644 index 000000000..ca9f8ddbf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php @@ -0,0 +1,19 @@ +removeAllExcept($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAllExcept_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php new file mode 100644 index 000000000..29ffcb6cc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php @@ -0,0 +1,19 @@ +removeAll($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php.expectf new file mode 100644 index 000000000..2b40cd758 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_removeAll_invalid_parameter.php.expectf @@ -0,0 +1,12 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php new file mode 100644 index 000000000..ee0448aad --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php @@ -0,0 +1,7 @@ +setInfo('some_value')); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_empty_storage.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php new file mode 100644 index 000000000..dcc03c2ff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php @@ -0,0 +1,7 @@ +setInfo()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_setInfo_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php new file mode 100644 index 000000000..69277d116 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php @@ -0,0 +1,16 @@ +unserialize($blob); + var_dump($so); +} catch(UnexpectedValueException $e) { + echo $e->getMessage()."\n"; +} +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php.expectf new file mode 100644 index 000000000..60848065d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_bad.php.expectf @@ -0,0 +1,24 @@ +Error at offset 6 of 34 bytes +Error at offset 46 of 89 bytes +object(SplObjectStorage)#2 (1) { + ["storage":"SplObjectStorage":private]=> + array(2) { + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#3 (0) { + } + ["inf"]=> + int(1) + } + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#1 (0) { + } + ["inf"]=> + object(stdClass)#3 (0) { + } + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php new file mode 100644 index 000000000..03b68da25 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php @@ -0,0 +1,15 @@ +unserialize($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php.expectf new file mode 100644 index 000000000..b9d470d59 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter1.php.expectf @@ -0,0 +1,4 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php new file mode 100644 index 000000000..ee89eab4e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php @@ -0,0 +1,22 @@ +unserialize($input); + } catch(UnexpectedValueException $e) { + echo $e->getMessage() . PHP_EOL; + } +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php.expectf new file mode 100644 index 000000000..ed11bb5a3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter2.php.expectf @@ -0,0 +1,5 @@ +Error at offset %d of %d bytes +Error at offset %d of %d bytes +Error at offset %d of %d bytes +Error at offset %d of %d bytes +Error at offset %d of %d bytes \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php new file mode 100644 index 000000000..b44df4ee9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php @@ -0,0 +1,11 @@ +unserialize(NULL); +} catch(UnexpectedValueException $e) { + echo $e->getMessage(); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php.expectf new file mode 100644 index 000000000..5a2d02e63 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_invalid_parameter3.php.expectf @@ -0,0 +1 @@ +Empty serialized string cannot be empty \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php new file mode 100644 index 000000000..c39db87bc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php @@ -0,0 +1,16 @@ +a = $a; + +$so = new SplObjectStorage(); + +$so[$o] = 1; +$so[$a] = 2; + +$s = serialize($so); +echo $s."\n"; + +$so1 = unserialize($s); +var_dump($so1); diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php.expectf b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php.expectf new file mode 100644 index 000000000..a4ec30892 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_unserialize_nested.php.expectf @@ -0,0 +1,25 @@ +C:16:"SplObjectStorage":76:{x:i:2;O:8:"stdClass":1:{s:1:"a";O:8:"stdClass":0:{}},i:1;;r:4;,i:2;;m:a:0:{}} +object(SplObjectStorage)#4 (1) { + ["storage":"SplObjectStorage":private]=> + array(2) { + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#5 (1) { + ["a"]=> + object(stdClass)#6 (0) { + } + } + ["inf"]=> + int(1) + } + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#6 (0) { + } + ["inf"]=> + int(2) + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplObjectStorage_var_dump.php b/hphp/test/zend/bad/ext-spl/SplObjectStorage_var_dump.php new file mode 100644 index 000000000..8a03c8f26 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplObjectStorage_var_dump.php @@ -0,0 +1,6 @@ + + array(1) { + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#%d (0) { + } + ["inf"]=> + *RECURSION* + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php new file mode 100644 index 000000000..87eb653b7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php @@ -0,0 +1,20 @@ +extract($input)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php.expectf new file mode 100644 index 000000000..6e7628d38 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_extract_invalid_parameter.php.expectf @@ -0,0 +1,14 @@ +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php new file mode 100644 index 000000000..c7e22728d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php @@ -0,0 +1,7 @@ +insert(NULL)); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php.expectf b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php.expectf new file mode 100644 index 000000000..e0d8c719d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplPriorityQueue_insert_invalid_parameter.php.expectf @@ -0,0 +1,2 @@ +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php new file mode 100644 index 000000000..669ed4487 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php @@ -0,0 +1,8 @@ +setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); +} catch (Exception $e) { + echo $e->getMessage(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php.expectf b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php.expectf new file mode 100644 index 000000000..69ef320c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode.php.expectf @@ -0,0 +1 @@ +Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php new file mode 100644 index 000000000..37ec3eeee --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php @@ -0,0 +1,12 @@ +setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); + +} catch (Exception $e) { + echo $e->getMessage(); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php.expectf b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php.expectf new file mode 100644 index 000000000..69ef320c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplQueue_setIteratorMode_param_lifo.php.expectf @@ -0,0 +1 @@ +Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php b/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php new file mode 100644 index 000000000..a54fd3e03 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php @@ -0,0 +1,8 @@ +setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); +} catch (Exception $e) { + echo $e->getMessage(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php.expectf b/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php.expectf new file mode 100644 index 000000000..69ef320c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplStack_setIteratorMode.php.expectf @@ -0,0 +1 @@ +Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php new file mode 100644 index 000000000..aa712d7fe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php.expectf new file mode 100644 index 000000000..cb2d9ea53 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_basic.php.expectf @@ -0,0 +1,12 @@ +object(SplTempFileObject)#1 (5) { + ["pathName":"SplFileInfo":private]=> + string(10) "php://temp" + ["fileName":"SplFileInfo":private]=> + string(10) "php://temp" + ["openMode":"SplFileObject":private]=> + string(1) "w" + ["delimiter":"SplFileObject":private]=> + string(1) "," + ["enclosure":"SplFileObject":private]=> + string(1) """ +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php new file mode 100644 index 000000000..194cf19d8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php.expectf b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php.expectf new file mode 100644 index 000000000..719057283 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_error.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: SplTempFileObject->__construct('invalid') +#1 {main} + thrown in %s \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php new file mode 100644 index 000000000..e5bf7822f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php.expectf b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php.expectf new file mode 100644 index 000000000..e11e11860 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_maxmemory_basic.php.expectf @@ -0,0 +1,12 @@ +object(SplTempFileObject)#1 (5) { + ["pathName":"SplFileInfo":private]=> + string(25) "php://temp/maxmemory:1024" + ["fileName":"SplFileInfo":private]=> + string(25) "php://temp/maxmemory:1024" + ["openMode":"SplFileObject":private]=> + string(1) "w" + ["delimiter":"SplFileObject":private]=> + string(1) "," + ["enclosure":"SplFileObject":private]=> + string(1) """ +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php new file mode 100644 index 000000000..d10f20a78 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php.expectf b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php.expectf new file mode 100644 index 000000000..ae6e07c4d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/SplTempFileObject_constructor_memory_lt1_variation.php.expectf @@ -0,0 +1,12 @@ +object(SplTempFileObject)#1 (5) { + ["pathName":"SplFileInfo":private]=> + string(12) "php://memory" + ["fileName":"SplFileInfo":private]=> + string(12) "php://memory" + ["openMode":"SplFileObject":private]=> + string(1) "w" + ["delimiter":"SplFileObject":private]=> + string(1) "," + ["enclosure":"SplFileObject":private]=> + string(1) """ +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php new file mode 100644 index 000000000..2006ff5c2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php @@ -0,0 +1,15 @@ + No arguments:\n"; +var_dump(new ArrayObject()); + +echo "--> Object argument:\n"; +$a = new stdClass; +$a->p = 'hello'; +var_dump(new ArrayObject($a)); + +echo "--> Array argument:\n"; +var_dump(new ArrayObject(array('key1' => 'val1'))); + +echo "--> Nested ArrayObject argument:\n"; +var_dump(new ArrayObject(new ArrayObject($a))); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php.expectf new file mode 100644 index 000000000..00b2f8b0d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic1.php.expectf @@ -0,0 +1,33 @@ +--> No arguments: +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(0) { + } +} +--> Object argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(stdClass)#1 (1) { + ["p"]=> + string(5) "hello" + } +} +--> Array argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["key1"]=> + string(4) "val1" + } +} +--> Nested ArrayObject argument: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(stdClass)#1 (1) { + ["p"]=> + string(5) "hello" + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php new file mode 100644 index 000000000..16966fced --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php @@ -0,0 +1,45 @@ + Access prop on instance of ArrayObject:\n"; +$c = new C; +$ao = new ArrayObject($c); +testAccess($c, $ao); + +echo "\n--> Access prop on instance of MyArrayObject:\n"; +$c = new C; +$ao = new MyArrayObject($c); +testAccess($c, $ao); + +function testAccess($c, $ao) { + echo " - Iteration:\n"; + foreach ($ao as $key=>$value) { + echo " $key=>$value\n"; + } + + echo " - Read:\n"; + @var_dump($ao->prop, $ao['prop']); + + echo " - Write:\n"; + $ao->prop = 'changed1'; + $ao['prop'] = 'changed2'; + var_dump($ao->prop, $ao['prop']); + + echo " - Isset:\n"; + var_dump(isset($ao->prop), isset($ao['prop'])); + + echo " - Unset:\n"; + unset($ao->prop); + unset($ao['prop']); + var_dump($ao->prop, $ao['prop']); + + echo " - After:\n"; + var_dump($ao, $c); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php.expectf new file mode 100644 index 000000000..8d5ed9372 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic2.php.expectf @@ -0,0 +1,51 @@ +--> Access prop on instance of ArrayObject: + - Iteration: + prop=>C::prop.orig + - Read: +NULL +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (0) { + } +} +object(C)#1 (0) { +} + +--> Access prop on instance of MyArrayObject: + - Iteration: + prop=>C::prop.orig + - Read: +string(24) "MyArrayObject::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(MyArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(C)#4 (0) { + } +} +object(C)#4 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php new file mode 100644 index 000000000..f3f89cfd8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php @@ -0,0 +1,45 @@ + Access prop on instance of ArrayObject with ArrayObject::STD_PROP_LIST:\n"; +$c = new C; +$ao = new ArrayObject($c, ArrayObject::STD_PROP_LIST); +testAccess($c, $ao); + +echo "\n--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST:\n"; +$c = new C; +$ao = new MyArrayObject($c, ArrayObject::STD_PROP_LIST); +testAccess($c, $ao); + +function testAccess($c, $ao) { + echo " - Iteration:\n"; + foreach ($ao as $key=>$value) { + echo " $key=>$value\n"; + } + + echo " - Read:\n"; + @var_dump($ao->prop, $ao['prop']); + + echo " - Write:\n"; + $ao->prop = 'changed1'; + $ao['prop'] = 'changed2'; + var_dump($ao->prop, $ao['prop']); + + echo " - Isset:\n"; + var_dump(isset($ao->prop), isset($ao['prop'])); + + echo " - Unset:\n"; + unset($ao->prop); + unset($ao['prop']); + var_dump($ao->prop, $ao['prop']); + + echo " - After:\n"; + var_dump($ao, $c); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php.expectf new file mode 100644 index 000000000..77c756562 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic3.php.expectf @@ -0,0 +1,51 @@ +--> Access prop on instance of ArrayObject with ArrayObject::STD_PROP_LIST: + - Iteration: + prop=>C::prop.orig + - Read: +NULL +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (0) { + } +} +object(C)#1 (0) { +} + +--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST: + - Iteration: + prop=>C::prop.orig + - Read: +string(24) "MyArrayObject::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(MyArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(C)#4 (0) { + } +} +object(C)#4 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php new file mode 100644 index 000000000..7ab775143 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php @@ -0,0 +1,45 @@ + Access prop on instance of ArrayObject with ArrayObject::ARRAY_AS_PROPS:\n"; +$c = new C; +$ao = new ArrayObject($c, ArrayObject::ARRAY_AS_PROPS); +testAccess($c, $ao); + +echo "\n--> Access prop on instance of MyArrayObject with ArrayObject::ARRAY_AS_PROPS:\n"; +$c = new C; +$ao = new MyArrayObject($c, ArrayObject::ARRAY_AS_PROPS); +testAccess($c, $ao); + +function testAccess($c, $ao) { + echo " - Iteration:\n"; + foreach ($ao as $key=>$value) { + echo " $key=>$value\n"; + } + + echo " - Read:\n"; + @var_dump($ao->prop, $ao['prop']); + + echo " - Write:\n"; + $ao->prop = 'changed1'; + $ao['prop'] = 'changed2'; + var_dump($ao->prop, $ao['prop']); + + echo " - Isset:\n"; + var_dump(isset($ao->prop), isset($ao['prop'])); + + echo " - Unset:\n"; + unset($ao->prop); + unset($ao['prop']); + var_dump($ao->prop, $ao['prop']); + + echo " - After:\n"; + var_dump($ao, $c); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php.expectf new file mode 100644 index 000000000..9392ebcda --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic4.php.expectf @@ -0,0 +1,52 @@ +--> Access prop on instance of ArrayObject with ArrayObject::ARRAY_AS_PROPS: + - Iteration: + prop=>C::prop.orig + - Read: +string(12) "C::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed2" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (0) { + } +} +object(C)#1 (0) { +} + +--> Access prop on instance of MyArrayObject with ArrayObject::ARRAY_AS_PROPS: + - Iteration: + prop=>C::prop.orig + - Read: +string(24) "MyArrayObject::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(MyArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(C)#4 (0) { + } +} +object(C)#4 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php new file mode 100644 index 000000000..2a968a22d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php @@ -0,0 +1,45 @@ + Access prop on instance of ArrayObject with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS:\n"; +$c = new C; +$ao = new ArrayObject($c, ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS); +testAccess($c, $ao); + +echo "\n--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS:\n"; +$c = new C; +$ao = new MyArrayObject($c, ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS); +testAccess($c, $ao); + +function testAccess($c, $ao) { + echo " - Iteration:\n"; + foreach ($ao as $key=>$value) { + echo " $key=>$value\n"; + } + + echo " - Read:\n"; + @var_dump($ao->prop, $ao['prop']); + + echo " - Write:\n"; + $ao->prop = 'changed1'; + $ao['prop'] = 'changed2'; + var_dump($ao->prop, $ao['prop']); + + echo " - Isset:\n"; + var_dump(isset($ao->prop), isset($ao['prop'])); + + echo " - Unset:\n"; + unset($ao->prop); + unset($ao['prop']); + var_dump($ao->prop, $ao['prop']); + + echo " - After:\n"; + var_dump($ao, $c); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php.expectf new file mode 100644 index 000000000..e4906a154 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic5.php.expectf @@ -0,0 +1,52 @@ +--> Access prop on instance of ArrayObject with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS: + - Iteration: + prop=>C::prop.orig + - Read: +string(12) "C::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed2" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (0) { + } +} +object(C)#1 (0) { +} + +--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS: + - Iteration: + prop=>C::prop.orig + - Read: +string(24) "MyArrayObject::prop.orig" +string(12) "C::prop.orig" + - Write: +string(8) "changed1" +string(8) "changed2" + - Isset: +bool(true) +bool(true) + - Unset: +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL + - After: +object(MyArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(C)#4 (0) { + } +} +object(C)#4 (0) { +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php new file mode 100644 index 000000000..5f0ce7796 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php @@ -0,0 +1,20 @@ +p = 1; +var_dump($ao); + +$ao = new ArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST); +$ao->p = 1; +var_dump($ao); + +$ao = new MyArrayObject(array(1,2,3)); +var_dump($ao); + +$ao = new MyArrayObject(array(1,2,3), ArrayObject::STD_PROP_LIST); +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php.expectf new file mode 100644 index 000000000..663289738 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_basic6.php.expectf @@ -0,0 +1,56 @@ +object(ArrayObject)#1 (2) { + ["p"]=> + int(1) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} +object(ArrayObject)#2 (2) { + ["p"]=> + int(1) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} +object(MyArrayObject)#1 (3) { + ["priv1":"MyArrayObject":private]=> + string(7) "secret1" + ["pub1"]=> + string(7) "public1" + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} +object(MyArrayObject)#2 (3) { + ["priv1":"MyArrayObject":private]=> + string(7) "secret1" + ["pub1"]=> + string(7) "public1" + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php new file mode 100644 index 000000000..12e3bb944 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php @@ -0,0 +1,17 @@ +p = 1; +try { + var_dump(new ArrayObject($a, 0, "Exception")); +} catch (InvalidArgumentException $e) { + echo $e->getMessage() . "(" . $e->getLine() . ")\n"; +} + +echo "Non-existent class:\n"; +try { + var_dump(new ArrayObject(new stdClass, 0, "nonExistentClassName")); +} catch (InvalidArgumentException $e) { + echo $e->getMessage() . "(" . $e->getLine() . ")\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php.expectf new file mode 100644 index 000000000..02a617969 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error1.php.expectf @@ -0,0 +1,4 @@ +Bad iterator type: +ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'Exception' given(6) +Non-existent class: +ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClassName' given(13) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php new file mode 100644 index 000000000..890a822fe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php @@ -0,0 +1,16 @@ +getMessage() . "(" . $e->getLine() . ")\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php.expectf new file mode 100644 index 000000000..ce3599b8e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject___construct_error2.php.expectf @@ -0,0 +1,2 @@ +Too many arguments: +ArrayObject::__construct() expects at most 3 parameters, 4 given(12) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php new file mode 100644 index 000000000..d87593ac2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php @@ -0,0 +1,20 @@ +4,'b'=>2,'c'=>3)); +var_dump($ao1->asort()); +var_dump($ao1); +var_dump($ao2->asort('blah')); +var_dump($ao2); +var_dump($ao2->asort(SORT_NUMERIC)); +var_dump($ao2); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php.expectf new file mode 100644 index 000000000..065247558 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic1.php.expectf @@ -0,0 +1,39 @@ +*** Testing ArrayObject::asort() : basic functionality *** +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + [1]=> + int(2) + [2]=> + int(3) + [0]=> + int(4) + } +} +HipHop Warning: %a +bool(false) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["a"]=> + int(4) + ["b"]=> + int(2) + ["c"]=> + int(3) + } +} +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["a"]=> + int(4) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php new file mode 100644 index 000000000..55937fdb9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php @@ -0,0 +1,22 @@ +asort()); +var_dump($ao1, $c); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php.expectf new file mode 100644 index 000000000..c4ddccf43 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_asort_basic2.php.expectf @@ -0,0 +1,26 @@ +*** Testing ArrayObject::asort() : basic functionality *** +bool(true) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["prop3":"C":private]=> + string(1) "a" + ["prop1"]=> + string(1) "x" + ["prop4"]=> + string(1) "x" + ["prop2"]=> + string(1) "z" + } +} +object(C)#1 (4) { + ["prop3":"C":private]=> + string(1) "a" + ["prop1"]=> + string(1) "x" + ["prop4"]=> + string(1) "x" + ["prop2"]=> + string(1) "z" +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php new file mode 100644 index 000000000..24551d118 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php.expectf new file mode 100644 index 000000000..95de42865 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic1.php.expectf @@ -0,0 +1,32 @@ +array(4) { + [0]=> + int(1) + [1]=> + int(2) + ["p1"]=> + string(35) "new element added to a before clone" + ["p2"]=> + string(34) "new element added to a after clone" +} +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + ["new.aa1"]=> + string(24) "new element added to aa1" + } +} +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + ["new.aa2"]=> + string(24) "new element added to aa2" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php new file mode 100644 index 000000000..fcd3e6477 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php @@ -0,0 +1,14 @@ +p1 = 'new prop added to c before clone'; + +$ao2 = clone $ao1; + +$c->p2 = 'new prop added to c after clone'; +$ao1['new.ao1'] = 'new element added to ao1'; +$ao2['new.ao2'] = 'new element added to ao2'; +var_dump($c, $ao1, $ao2); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php.expectf new file mode 100644 index 000000000..d6f82cbaf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic2.php.expectf @@ -0,0 +1,28 @@ +object(C)#1 (3) { + ["p1"]=> + string(32) "new prop added to c before clone" + ["p2"]=> + string(31) "new prop added to c after clone" + ["new.ao1"]=> + string(24) "new element added to ao1" +} +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (3) { + ["p1"]=> + string(32) "new prop added to c before clone" + ["p2"]=> + string(31) "new prop added to c after clone" + ["new.ao1"]=> + string(24) "new element added to ao1" + } +} +object(ArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["p1"]=> + string(32) "new prop added to c before clone" + ["new.ao2"]=> + string(24) "new element added to ao2" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php new file mode 100644 index 000000000..36da9d468 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php @@ -0,0 +1,20 @@ +dynamic1 = 'new prop added to $wrappedObject before clone'; +$clonedOuterArrayObject = clone $outerArrayObject; +$wrappedObject->dynamic2 = 'new prop added to $wrappedObject after clone'; + +$innerArrayObject['new.iAO'] = 'new element added $innerArrayObject'; +$outerArrayObject['new.oAO'] = 'new element added to $outerArrayObject'; +$clonedOuterArrayObject['new.coAO'] = 'new element added to $clonedOuterArrayObject'; + +var_dump($wrappedObject, $innerArrayObject, $outerArrayObject, $clonedOuterArrayObject); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php.expectf new file mode 100644 index 000000000..beb276ed6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_clone_basic3.php.expectf @@ -0,0 +1,56 @@ +object(C)#1 (5) { + ["p"]=> + string(9) "C::p.orig" + ["dynamic1"]=> + string(45) "new prop added to $wrappedObject before clone" + ["dynamic2"]=> + string(44) "new prop added to $wrappedObject after clone" + ["new.iAO"]=> + string(35) "new element added $innerArrayObject" + ["new.oAO"]=> + string(38) "new element added to $outerArrayObject" +} +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["p"]=> + string(9) "C::p.orig" + ["dynamic1"]=> + string(45) "new prop added to $wrappedObject before clone" + ["dynamic2"]=> + string(44) "new prop added to $wrappedObject after clone" + ["new.iAO"]=> + string(35) "new element added $innerArrayObject" + ["new.oAO"]=> + string(38) "new element added to $outerArrayObject" + } +} +object(ArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["p"]=> + string(9) "C::p.orig" + ["dynamic1"]=> + string(45) "new prop added to $wrappedObject before clone" + ["dynamic2"]=> + string(44) "new prop added to $wrappedObject after clone" + ["new.iAO"]=> + string(35) "new element added $innerArrayObject" + ["new.oAO"]=> + string(38) "new element added to $outerArrayObject" + } + } +} +object(ArrayObject)#4 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["p"]=> + string(9) "C::p.orig" + ["dynamic1"]=> + string(45) "new prop added to $wrappedObject before clone" + ["new.coAO"]=> + string(44) "new element added to $clonedOuterArrayObject" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php new file mode 100644 index 000000000..60f40c0a9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php @@ -0,0 +1,56 @@ +==ArrayObject== +count(), $ao->count()); + +//Extra args are ignored. +var_dump($ao->count('blah')); +?> +==ArrayIterator== +count(), $ao->count()); + +//Extra args are ignored. +var_dump($ao->count('blah')); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php.expectf new file mode 100644 index 000000000..f1b0ba516 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_count_basic1.php.expectf @@ -0,0 +1,22 @@ +==ArrayObject== +int(99) +int(0) +int(99) +int(1) +int(99) +int(2) +int(99) +int(1) +HipHop Warning: %a +NULL +==ArrayIterator== +int(99) +int(0) +int(99) +int(1) +int(99) +int(2) +int(99) +int(1) +HipHop Warning: %a +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php new file mode 100644 index 000000000..b8673b0af --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php @@ -0,0 +1,19 @@ +exchangeArray($swapIn); + +$ao['a'] = 'adding element to $ao'; +$swapIn['b'] = 'adding element to $swapIn'; +$ao['c'] = 'adding another element to $ao'; + +echo "\n--> swapIn: "; +var_dump($swapIn); + +echo "\n--> cowRef: "; +var_dump($cowRef); + +echo "\n--> ao: "; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php.expectf new file mode 100644 index 000000000..724fdb3b2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic1.php.expectf @@ -0,0 +1,17 @@ +--> swapIn: array(1) { + ["b"]=> + string(25) "adding element to $swapIn" +} + +--> cowRef: array(0) { +} + +--> ao: object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["a"]=> + string(21) "adding element to $ao" + ["c"]=> + string(29) "adding another element to $ao" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php new file mode 100644 index 000000000..e48e39f33 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php @@ -0,0 +1,32 @@ + exchangeArray(array):\n"; +$ao = new ArrayObject(); +$ao->exchangeArray(array('key'=>'original')); +var_dump($ao['key']); +var_dump($ao); + +echo "\n--> exchangeArray(normal object):\n"; +$obj = new stdClass; +$obj->key = 'normal object prop'; +$ao->exchangeArray($obj); +var_dump($ao['key']); +var_dump($ao); + +echo "\n--> exchangeArray(ArrayObject):\n"; +$obj = new ArrayObject(array('key'=>'ArrayObject element')); +$ao->exchangeArray($obj); +var_dump($ao['key']); +var_dump($ao); + +echo "\n--> exchangeArray(ArrayIterator):\n"; +$obj = new ArrayIterator(array('key'=>'ArrayIterator element')); +$ao->exchangeArray($obj); +var_dump($ao['key']); +var_dump($ao); + +echo "\n--> exchangeArray(nested ArrayObject):\n"; +$obj = new ArrayObject(new ArrayObject(array('key'=>'nested ArrayObject element'))); +$ao->exchangeArray($obj); +var_dump($ao['key']); +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php.expectf new file mode 100644 index 000000000..81415d0c8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic2.php.expectf @@ -0,0 +1,61 @@ +--> exchangeArray(array): +string(8) "original" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["key"]=> + string(8) "original" + } +} + +--> exchangeArray(normal object): +string(18) "normal object prop" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(stdClass)#%d (1) { + ["key"]=> + string(18) "normal object prop" + } +} + +--> exchangeArray(ArrayObject): +string(19) "ArrayObject element" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["key"]=> + string(19) "ArrayObject element" + } + } +} + +--> exchangeArray(ArrayIterator): +string(21) "ArrayIterator element" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(1) { + ["key"]=> + string(21) "ArrayIterator element" + } + } +} + +--> exchangeArray(nested ArrayObject): +string(26) "nested ArrayObject element" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["key"]=> + string(26) "nested ArrayObject element" + } + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php new file mode 100644 index 000000000..f37d31d97 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php @@ -0,0 +1,48 @@ + exchangeArray() with objects:\n"; +$original = new C; +$ao = new ArrayObject($original); +$swapIn = new C; +try { + $copy = $ao->exchangeArray($swapIn); + $copy['addedToCopy'] = 'added To Copy'; +} catch (Exception $e) { + echo "Exception:" . $e->getMessage() . "\n"; +} +$swapIn->addedToSwapIn = 'added To Swap-In'; +$original->addedToOriginal = 'added To Original'; +var_dump($ao, $original, $swapIn, $copy); + + +echo "\n\n--> exchangeArray() with no arg:\n"; +unset($original, $ao, $swapIn, $copy); +$original = new C; +$ao = new ArrayObject($original); +try { + $copy = $ao->exchangeArray(); + $copy['addedToCopy'] = 'added To Copy'; +} catch (Exception $e) { + echo "Exception:" . $e->getMessage() . "\n"; +} +$original->addedToOriginal = 'added To Original'; +var_dump($ao, $original, $copy); + +echo "\n\n--> exchangeArray() with bad arg type:\n"; +unset($original, $ao, $swapIn, $copy); +$original = new C; +$ao = new ArrayObject($original); +try { + $copy = $ao->exchangeArray(null); + $copy['addedToCopy'] = 'added To Copy'; +} catch (Exception $e) { + echo "Exception:" . $e->getMessage() . "\n"; +} +$original->addedToOriginal = 'added To Original'; +var_dump($ao, $original, $copy); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php.expectf new file mode 100644 index 000000000..c90fabb95 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_exchangeArray_basic3.php.expectf @@ -0,0 +1,74 @@ +--> exchangeArray() with objects: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#3 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToSwapIn"]=> + string(16) "added To Swap-In" + } +} +object(C)#1 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToOriginal"]=> + string(17) "added To Original" +} +object(C)#3 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToSwapIn"]=> + string(16) "added To Swap-In" +} +array(2) { + ["pub1"]=> + string(7) "public1" + ["addedToCopy"]=> + string(13) "added To Copy" +} + + +--> exchangeArray() with no arg: +HipHop Warning: %a +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#3 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToOriginal"]=> + string(17) "added To Original" + } +} +object(C)#3 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToOriginal"]=> + string(17) "added To Original" +} +array(2) { + ["pub1"]=> + string(7) "public1" + ["addedToCopy"]=> + string(13) "added To Copy" +} + + +--> exchangeArray() with bad arg type: +Exception:Passed variable is not an array or object, using empty array instead +HipHop Notice: %a +object(ArrayObject)#3 (1) { + ["storage":"ArrayObject":private]=> + object(C)#2 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToOriginal"]=> + string(17) "added To Original" + } +} +object(C)#2 (2) { + ["pub1"]=> + string(7) "public1" + ["addedToOriginal"]=> + string(17) "added To Original" +} +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php new file mode 100644 index 000000000..41444474e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php @@ -0,0 +1,16 @@ +getFlags()); + +$ao = new ArrayObject(new ArrayObject(array(1,2,3)), ArrayObject::STD_PROP_LIST); +var_dump($ao->getFlags()); + +$ao = new ArrayObject(new ArrayIterator(new ArrayObject()), ArrayObject::ARRAY_AS_PROPS); +var_dump($ao->getFlags()); + +$ao = new ArrayObject(new ArrayObject(), ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS); +var_dump($ao->getFlags()); + +$cao = clone $ao; +var_dump($cao->getFlags()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php.expectf new file mode 100644 index 000000000..994cae5f8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic1.php.expectf @@ -0,0 +1,5 @@ +int(0) +int(1) +int(2) +int(3) +int(3) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php new file mode 100644 index 000000000..8cb48827d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php @@ -0,0 +1,15 @@ +getFlags()); + +$ao2 = new ArrayObject($ao); +var_dump($ao2->getFlags()); +var_dump($ao2->getIterator()->getFlags()); + +$ai = new ArrayIterator($ao); +var_dump($ai->getFlags()); + +$ao2 = new ArrayObject($ao, 0); +var_dump($ao2->getFlags()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php.expectf new file mode 100644 index 000000000..fac55ab73 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getFlags_basic2.php.expectf @@ -0,0 +1,5 @@ +int(3) +int(3) +int(3) +int(3) +int(0) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php new file mode 100644 index 000000000..9d4c809d4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php @@ -0,0 +1,57 @@ +1,'b'=>2,'c'=>3), 0, "MyIterator"); + +echo "--> Access using MyIterator:\n"; +var_dump($ao->getIteratorClass()); +var_dump($ao->getIterator()); +foreach($ao as $key=>$value) { + echo " $key=>$value\n"; +} + +echo "\n\n--> Access using ArrayIterator:\n"; +var_dump($ao->setIteratorClass("ArrayIterator")); +var_dump($ao->getIteratorClass()); +var_dump($ao->getIterator()); +foreach($ao as $key=>$value) { + echo "$key=>$value\n"; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php.expectf new file mode 100644 index 000000000..5e81b6ad1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_getIteratorClass_basic1.php.expectf @@ -0,0 +1,55 @@ +--> Access using MyIterator: +string(10) "MyIterator" +object(MyIterator)#2 (1) { + ["storage":"ArrayIterator":private]=> + object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + } + } +} + In MyIterator::rewind() + In MyIterator::valid() + In MyIterator::current() + In MyIterator::key() + a=>1 + In MyIterator::next() + In MyIterator::valid() + In MyIterator::current() + In MyIterator::key() + b=>2 + In MyIterator::next() + In MyIterator::valid() + In MyIterator::current() + In MyIterator::key() + c=>3 + In MyIterator::next() + In MyIterator::valid() + + +--> Access using ArrayIterator: +NULL +string(13) "ArrayIterator" +object(ArrayIterator)#3 (1) { + ["storage":"ArrayIterator":private]=> + object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + } + } +} +a=>1 +b=>2 +c=>3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php new file mode 100644 index 000000000..abced1e5f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php @@ -0,0 +1,19 @@ +4,'a'=>2,'q'=>3, 99=>'x')); +var_dump($ao1->ksort()); +var_dump($ao1); +var_dump($ao2->ksort('blah')); +var_dump($ao2); +var_dump($ao2->ksort(SORT_STRING)); +var_dump($ao2); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php.expectf new file mode 100644 index 000000000..f2ee73862 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic1.php.expectf @@ -0,0 +1,43 @@ +*** Testing ArrayObject::ksort() : basic functionality *** +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(4) + [1]=> + int(2) + [2]=> + int(3) + } +} +HipHop Warning: %a +bool(false) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(4) { + ["b"]=> + int(4) + ["a"]=> + int(2) + ["q"]=> + int(3) + [99]=> + string(1) "x" + } +} +bool(true) +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(4) { + [99]=> + string(1) "x" + ["a"]=> + int(2) + ["b"]=> + int(4) + ["q"]=> + int(3) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php new file mode 100644 index 000000000..8bf281bf6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php @@ -0,0 +1,22 @@ +ksort()); +var_dump($ao1, $c); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php.expectf new file mode 100644 index 000000000..5e0ebda57 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_ksort_basic2.php.expectf @@ -0,0 +1,26 @@ +*** Testing ArrayObject::ksort() : basic functionality *** +bool(true) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["b":"C":private]=> + string(5) "prop4" + ["a"]=> + string(5) "prop3" + ["x"]=> + string(5) "prop1" + ["z"]=> + string(5) "prop2" + } +} +object(C)#1 (4) { + ["b":"C":private]=> + string(5) "prop4" + ["a"]=> + string(5) "prop3" + ["x"]=> + string(5) "prop1" + ["z"]=> + string(5) "prop2" +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php new file mode 100644 index 000000000..93a79452b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php @@ -0,0 +1,66 @@ + Write existent, non-existent and dynamic:\n"; +$ao['a'] = 'changed'; +$ao['dynamic'] = 'new'; +$ao['dynamic'] = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao['a']); +var_dump($ao['nonexistent']); +var_dump($ao['dynamic']); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao['a'])); +var_dump(isset($ao['nonexistent'])); +var_dump(isset($ao['dynamic'])); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao['a']); +unset($ao['nonexistent']); +unset($ao['dynamic']); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php.expectf new file mode 100644 index 000000000..97d7e9a85 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods1.php.expectf @@ -0,0 +1,123 @@ +--> Write existent, non-existent and dynamic: + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Read existent, non-existent and dynamic: +string(7) "changed" +HipHop Notice: %a +NULL +string(11) "new.changed" + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> isset existent, non-existent and dynamic: +bool(true) +bool(false) +bool(true) + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Unset existent, non-existent and dynamic: +HipHop Notice: %a + Original wrapped object: +object(UsesMagic)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php new file mode 100644 index 000000000..c034fb779 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php @@ -0,0 +1,66 @@ + Write existent, non-existent and dynamic:\n"; +$ao->a = 'changed'; +$ao->dynamic = 'new'; +$ao->dynamic = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao->a); +var_dump($ao->nonexistent); +var_dump($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao->a)); +var_dump(isset($ao->nonexistent)); +var_dump(isset($ao->dynamic)); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao->a); +unset($ao->nonexistent); +unset($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php.expectf new file mode 100644 index 000000000..6adc8eda9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods2.php.expectf @@ -0,0 +1,126 @@ +--> Write existent, non-existent and dynamic: + Original wrapped object: +object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (3) { + ["a"]=> + string(7) "changed" + ["dynamic"]=> + string(11) "new.changed" + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} + +--> Read existent, non-existent and dynamic: +string(7) "changed" +HipHop Notice: %a +NULL +string(11) "new.changed" + Original wrapped object: +object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (3) { + ["a"]=> + string(7) "changed" + ["dynamic"]=> + string(11) "new.changed" + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} + +--> isset existent, non-existent and dynamic: +bool(true) +bool(false) +bool(true) + Original wrapped object: +object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (3) { + ["a"]=> + string(7) "changed" + ["dynamic"]=> + string(11) "new.changed" + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} + +--> Unset existent, non-existent and dynamic: + Original wrapped object: +object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php new file mode 100644 index 000000000..151cdd4d4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php @@ -0,0 +1,66 @@ + Write existent, non-existent and dynamic:\n"; +$ao->a = 'changed'; +$ao->dynamic = 'new'; +$ao->dynamic = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao->a); +var_dump($ao->nonexistent); +var_dump($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao->a)); +var_dump(isset($ao->nonexistent)); +var_dump(isset($ao->dynamic)); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao->a); +unset($ao->nonexistent); +unset($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php.expectf new file mode 100644 index 000000000..97d7e9a85 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods3.php.expectf @@ -0,0 +1,123 @@ +--> Write existent, non-existent and dynamic: + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Read existent, non-existent and dynamic: +string(7) "changed" +HipHop Notice: %a +NULL +string(11) "new.changed" + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> isset existent, non-existent and dynamic: +bool(true) +bool(false) +bool(true) + Original wrapped object: +object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Unset existent, non-existent and dynamic: +HipHop Notice: %a + Original wrapped object: +object(UsesMagic)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + object(UsesMagic)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"UsesMagic":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php new file mode 100644 index 000000000..f27cf5c4e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php @@ -0,0 +1,69 @@ + Write existent, non-existent and dynamic:\n"; +$ao['a'] = 'changed'; +$ao['dynamic'] = 'new'; +$ao['dynamic'] = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao['a']); +var_dump($ao['nonexistent']); +var_dump($ao['dynamic']); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao['a'])); +var_dump(isset($ao['nonexistent'])); +var_dump(isset($ao['dynamic'])); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao['a']); +unset($ao['nonexistent']); +unset($ao['dynamic']); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php.expectf new file mode 100644 index 000000000..6f8018720 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods4.php.expectf @@ -0,0 +1,131 @@ +--> Write existent, non-existent and dynamic: + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(33) "This should not be in the storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Read existent, non-existent and dynamic: +string(7) "changed" +HipHop Notice: %a +NULL +string(11) "new.changed" + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(33) "This should not be in the storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> isset existent, non-existent and dynamic: +bool(true) +bool(false) +bool(true) + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(33) "This should not be in the storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Unset existent, non-existent and dynamic: +HipHop Notice: %a + Original wrapped object: +object(C)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(33) "This should not be in the storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php new file mode 100644 index 000000000..bd407a5c0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php @@ -0,0 +1,69 @@ + Write existent, non-existent and dynamic:\n"; +$ao->a = 'changed'; +$ao->dynamic = 'new'; +$ao->dynamic = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao->a); +var_dump($ao->nonexistent); +var_dump($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao->a)); +var_dump(isset($ao->nonexistent)); +var_dump(isset($ao->dynamic)); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao->a); +unset($ao->nonexistent); +unset($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php.expectf new file mode 100644 index 000000000..1d359ce9e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods5.php.expectf @@ -0,0 +1,133 @@ +--> Write existent, non-existent and dynamic: +In UsesMagic::__set(a,changed) +In UsesMagic::__set(dynamic,new) +In UsesMagic::__set(dynamic,new.changed) + Original wrapped object: +object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(29) "This should appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} + +--> Read existent, non-existent and dynamic: +In UsesMagic::__get(a) +NULL +In UsesMagic::__get(nonexistent) +NULL +In UsesMagic::__get(dynamic) +NULL + Original wrapped object: +object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(29) "This should appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} + +--> isset existent, non-existent and dynamic: +In UsesMagic::__isset(a) +bool(false) +In UsesMagic::__isset(nonexistent) +bool(false) +In UsesMagic::__isset(dynamic) +bool(false) + Original wrapped object: +object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(29) "This should appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} + +--> Unset existent, non-existent and dynamic: +In UsesMagic::__unset(a) +In UsesMagic::__unset(nonexistent) +In UsesMagic::__unset(dynamic) + Original wrapped object: +object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(29) "This should appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (4) { + ["a"]=> + int(1) + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php new file mode 100644 index 000000000..4b0375df6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php @@ -0,0 +1,69 @@ + Write existent, non-existent and dynamic:\n"; +$ao->a = 'changed'; +$ao->dynamic = 'new'; +$ao->dynamic = 'new.changed'; +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Read existent, non-existent and dynamic:\n"; +var_dump($ao->a); +var_dump($ao->nonexistent); +var_dump($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> isset existent, non-existent and dynamic:\n"; +var_dump(isset($ao->a)); +var_dump(isset($ao->nonexistent)); +var_dump(isset($ao->dynamic)); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); + +echo "\n--> Unset existent, non-existent and dynamic:\n"; +unset($ao->a); +unset($ao->nonexistent); +unset($ao->dynamic); +echo " Original wrapped object:\n"; +var_dump($obj); +echo " Wrapping ArrayObject:\n"; +var_dump($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php.expectf new file mode 100644 index 000000000..fb25258ba --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_magicMethods6.php.expectf @@ -0,0 +1,131 @@ +--> Write existent, non-existent and dynamic: + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(35) "This should never appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Read existent, non-existent and dynamic: +string(7) "changed" +HipHop Notice: %a +NULL +string(11) "new.changed" + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(35) "This should never appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> isset existent, non-existent and dynamic: +bool(true) +bool(false) +bool(true) + Original wrapped object: +object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(35) "This should never appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (5) { + ["a"]=> + string(7) "changed" + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + ["dynamic"]=> + string(11) "new.changed" + } +} + +--> Unset existent, non-existent and dynamic: +HipHop Notice: %a + Original wrapped object: +object(C)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" +} + Wrapping ArrayObject: +object(UsesMagic)#2 (2) { + ["b"]=> + string(35) "This should never appear in storage" + ["storage":"ArrayObject":private]=> + object(C)#1 (3) { + ["b"]=> + int(2) + ["c"]=> + int(3) + ["priv":"C":private]=> + string(6) "secret" + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php new file mode 100644 index 000000000..774f24666 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php @@ -0,0 +1,18 @@ +'boo10','b'=>'boo1','c'=>'boo2','d'=>'boo22','e'=>'BOO5')); +var_dump($ao1->natcasesort()); +var_dump($ao1); +var_dump($ao2->natcasesort('blah')); +var_dump($ao2); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php.expectf new file mode 100644 index 000000000..70d69d94c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_natcasesort_basic1.php.expectf @@ -0,0 +1,34 @@ +*** Testing ArrayObject::natcasesort() : basic functionality *** +bool(true) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [1]=> + string(4) "boo1" + [2]=> + string(4) "boo2" + [4]=> + string(4) "BOO5" + [0]=> + string(5) "boo10" + [3]=> + string(5) "boo22" + } +} +bool(true) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + ["b"]=> + string(4) "boo1" + ["c"]=> + string(4) "boo2" + ["e"]=> + string(4) "BOO5" + ["a"]=> + string(5) "boo10" + ["d"]=> + string(5) "boo22" + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php new file mode 100644 index 000000000..2cd981af6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php @@ -0,0 +1,18 @@ +'boo10','b'=>'boo1','c'=>'boo2','d'=>'boo22','e'=>'BOO5')); +var_dump($ao1->natsort()); +var_dump($ao1); +var_dump($ao2->natsort('blah')); +var_dump($ao2); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php.expectf new file mode 100644 index 000000000..6c6a15212 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_natsort_basic1.php.expectf @@ -0,0 +1,34 @@ +*** Testing ArrayObject::natsort() : basic functionality *** +bool(true) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [4]=> + string(4) "BOO5" + [1]=> + string(4) "boo1" + [2]=> + string(4) "boo2" + [0]=> + string(5) "boo10" + [3]=> + string(5) "boo22" + } +} +bool(true) +object(ArrayObject)#2 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + ["e"]=> + string(4) "BOO5" + ["b"]=> + string(4) "boo1" + ["c"]=> + string(4) "boo2" + ["a"]=> + string(5) "boo10" + ["d"]=> + string(5) "boo22" + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php b/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php new file mode 100644 index 000000000..ff15dfdef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php @@ -0,0 +1,5 @@ + null)); +var_dump($ao->offsetExists('foo')); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php.expectf new file mode 100644 index 000000000..254d25151 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_offsetExists_nullcheck.php.expectf @@ -0,0 +1 @@ +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php new file mode 100644 index 000000000..77718b2f6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php @@ -0,0 +1,29 @@ +p)); + // read + var_dump($ao->p); + // write + $ao->p = $ao->p . '.changed'; + var_dump($ao->p); +} + +$ao = new C(array('p'=>'array element')); +$ao->setFlags(ArrayObject::ARRAY_AS_PROPS); + +echo "\n--> Access the real property:\n"; +access_p($ao); + +echo "\n--> Remove the real property and access the array element:\n"; +unset($ao->p); +access_p($ao); + +echo "\n--> Remove the array element and try access again:\n"; +unset($ao->p); +access_p($ao); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php.expectf new file mode 100644 index 000000000..e89c45089 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic1.php.expectf @@ -0,0 +1,16 @@ +--> Access the real property: +bool(true) +string(15) "object property" +string(23) "object property.changed" + +--> Remove the real property and access the array element: +bool(true) +string(13) "array element" +string(21) "array element.changed" + +--> Remove the array element and try access again: +bool(false) +HipHop Notice: %a +NULL +HipHop Notice: %a +string(8) ".changed" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php new file mode 100644 index 000000000..9dbae3e52 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php @@ -0,0 +1,20 @@ +x); + } +} + +$c = new C(array('x'=>'public')); + +$c->setFlags(ArrayObject::ARRAY_AS_PROPS); +C::go($c); +var_dump($c->x); + + +$c->setFlags(0); +C::go($c); +var_dump($c->x); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php.expectf new file mode 100644 index 000000000..0b013e601 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setFlags_basic2.php.expectf @@ -0,0 +1,4 @@ +string(6) "secret" +string(6) "public" +string(6) "secret" +HipHop Fatal error: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php b/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php new file mode 100644 index 000000000..4e9d46abc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php @@ -0,0 +1,41 @@ +1,'b'=>2,'c'=>3)); + $ao->setIteratorClass("nonExistentClass"); + foreach($ao as $key=>$value) { + echo " $key=>$value\n"; + } +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +try { + $ao = new ArrayObject(array('a'=>1,'b'=>2,'c'=>3)); + $ao->setIteratorClass("stdClass"); + foreach($ao as $key=>$value) { + echo " $key=>$value\n"; + } +} catch (Exception $e) { + var_dump($e->getMessage()); +} + + +try { + $ao = new ArrayObject(array('a'=>1,'b'=>2,'c'=>3), 0, "nonExistentClass"); + foreach($ao as $key=>$value) { + echo " $key=>$value\n"; + } +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +try { + $ao = new ArrayObject(array('a'=>1,'b'=>2,'c'=>3), 0, "stdClass"); + foreach($ao as $key=>$value) { + echo " $key=>$value\n"; + } +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php.expectf new file mode 100644 index 000000000..6fbaea318 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_setIteratorClass_error1.php.expectf @@ -0,0 +1,10 @@ +HipHop Warning: %a + a=>1 + b=>2 + c=>3 +HipHop Warning: %a + a=>1 + b=>2 + c=>3 +string(113) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClass' given" +string(105) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'stdClass' given" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php new file mode 100644 index 000000000..82b2edd77 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php @@ -0,0 +1,27 @@ +uasort('cmp'); +var_dump($ao); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php.expectf new file mode 100644 index 000000000..02eb5f879 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_basic1.php.expectf @@ -0,0 +1,13 @@ +*** Testing ArrayObject::uasort() : basic functionality *** +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + [1]=> + int(3) + [0]=> + int(2) + [2]=> + int(1) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php new file mode 100644 index 000000000..985d5c065 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php @@ -0,0 +1,23 @@ +uasort(); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} + +try { + $ao->uasort(1,2); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php.expectf new file mode 100644 index 000000000..c6b50217b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uasort_error1.php.expectf @@ -0,0 +1,3 @@ +Function expects exactly one argument +Function expects exactly one argument +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php new file mode 100644 index 000000000..5ea68860d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php @@ -0,0 +1,26 @@ +0, 2=>1, 5=>2, 6=>3, 1=>4)); + +$ao->uksort('cmp'); +var_dump($ao); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php.expectf new file mode 100644 index 000000000..2162c9c20 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_basic1.php.expectf @@ -0,0 +1,17 @@ +*** Testing ArrayObject::uksort() : basic functionality *** +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [6]=> + int(3) + [5]=> + int(2) + [3]=> + int(0) + [2]=> + int(1) + [1]=> + int(4) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php new file mode 100644 index 000000000..4e46b6b1d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php @@ -0,0 +1,23 @@ +uksort(); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} + +try { + $ao->uksort(1,2); +} catch (BadMethodCallException $e) { + echo $e->getMessage() . "\n"; +} +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php.expectf b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php.expectf new file mode 100644 index 000000000..c6b50217b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/arrayObject_uksort_error1.php.expectf @@ -0,0 +1,3 @@ +Function expects exactly one argument +Function expects exactly one argument +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_001.php b/hphp/test/zend/bad/ext-spl/array_001.php new file mode 100644 index 000000000..ceffba01d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_001.php @@ -0,0 +1,34 @@ +0, 1=>1); +$ar = new ArrayObject($ar); + +var_dump($ar); + +$ar[2] = 2; +var_dump($ar[2]); +var_dump($ar["3"] = 3); + +var_dump(array_merge((array)$ar, array(4=>4, 5=>5))); + +var_dump($ar["a"] = "a"); + +var_dump($ar); +var_dump($ar[0]); +var_dump($ar[6]); +var_dump($ar["b"]); + +unset($ar[1]); +unset($ar["3"]); +unset($ar["a"]); +unset($ar[7]); +unset($ar["c"]); +var_dump($ar); + +$ar[] = '3'; +$ar[] = 4; +var_dump($ar); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_001.php.expectf b/hphp/test/zend/bad/ext-spl/array_001.php.expectf new file mode 100644 index 000000000..cad7e7205 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_001.php.expectf @@ -0,0 +1,71 @@ +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [1]=> + int(1) + } +} +int(2) +int(3) +array(6) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + [4]=> + int(4) + [5]=> + int(5) +} +string(1) "a" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + ["a"]=> + string(1) "a" + } +} +int(0) +HipHop Notice: %a +NULL +HipHop Notice: %a +NULL +HipHop Notice: %a +HipHop Notice: %a +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [2]=> + int(2) + } +} +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(4) { + [0]=> + int(0) + [2]=> + int(2) + [4]=> + string(1) "3" + [5]=> + int(4) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_002.php b/hphp/test/zend/bad/ext-spl/array_002.php new file mode 100644 index 000000000..9092ba5d6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_002.php @@ -0,0 +1,18 @@ + 'one', + '2' => 'two', + '3' => 'three'); + +$object = new ArrayObject($array); +$object[] = 'four'; + +$arrayObject = new ArrayObject($object); + +$arrayObject[] = 'five'; + +var_dump($arrayObject); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_002.php.expectf b/hphp/test/zend/bad/ext-spl/array_002.php.expectf new file mode 100644 index 000000000..281ccf3c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_002.php.expectf @@ -0,0 +1,19 @@ +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" + } + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_003.php b/hphp/test/zend/bad/ext-spl/array_003.php new file mode 100644 index 000000000..162fa5f8d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_003.php @@ -0,0 +1,35 @@ +imp = "implicit"; + } +}; + +$test = new test; +$test->dyn = "dynamic"; + +print_r($test); + +$object = new ArrayObject($test); + +print_r($object); + +foreach($test as $key => $val) +{ + echo "$key => $val\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_003.php.expectf b/hphp/test/zend/bad/ext-spl/array_003.php.expectf new file mode 100644 index 000000000..c2cf0e5d7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_003.php.expectf @@ -0,0 +1,24 @@ +test Object +( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic +) +ArrayObject Object +( + [storage:ArrayObject:private] => test Object + ( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic + ) + +) +pub => public +imp => implicit +dyn => dynamic +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_004.php b/hphp/test/zend/bad/ext-spl/array_004.php new file mode 100644 index 000000000..246621a16 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_004.php @@ -0,0 +1,16 @@ +0, 1=>1, 2=>2); +$obj = new ArrayObject($arr); + +foreach($obj as $ak=>$av) { + foreach($obj as $bk=>$bv) { + if ($ak==0 && $bk==0) { + $arr[0] = "modify"; + } + echo "$ak=>$av - $bk=>$bv\n"; + } +} + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_004.php.expectf b/hphp/test/zend/bad/ext-spl/array_004.php.expectf new file mode 100644 index 000000000..50d758613 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_004.php.expectf @@ -0,0 +1,10 @@ +0=>0 - 0=>0 +0=>0 - 1=>1 +0=>0 - 2=>2 +1=>1 - 0=>0 +1=>1 - 1=>1 +1=>1 - 2=>2 +2=>2 - 0=>0 +2=>2 - 1=>1 +2=>2 - 2=>2 +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_005.php b/hphp/test/zend/bad/ext-spl/array_005.php new file mode 100644 index 000000000..f50403e82 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_005.php @@ -0,0 +1,84 @@ +id = $id; + $this->name = $name; + } + + public function __toString() + { + return $this->id . ', ' . $this->name; + } + + public function getId() + { + return $this->id; + } +} + +class StudentIdFilter extends FilterIterator +{ + private $id; + + public function __construct(ArrayObject $students, Student $other) + { + FilterIterator::__construct($students->getIterator()); + $this->id = $other->getId(); + } + + public function accept() + { + echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; + return $this->current()->getId() == $this->id; + } +} + +class StudentList implements IteratorAggregate +{ + private $students; + + public function __construct() + { + $this->students = new ArrayObject(array()); + } + + public function add(Student $student) + { + if (!$this->contains($student)) { + $this->students[] = $student; + } + } + + public function contains(Student $student) + { + foreach ($this->students as $s) + { + if ($s->getId() == $student->getId()) { + return true; + } + } + return false; + } + + public function getIterator() { + return $this->students->getIterator(); + } +} + +$students = new StudentList(); +$students->add(new Student('01234123', 'Joe')); +$students->add(new Student('00000014', 'Bob')); +$students->add(new Student('00000014', 'Foo')); + +foreach ($students as $student) { + echo $student, "\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_005.php.expectf b/hphp/test/zend/bad/ext-spl/array_005.php.expectf new file mode 100644 index 000000000..9e96d9db5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_005.php.expectf @@ -0,0 +1,3 @@ +01234123, Joe +00000014, Bob +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_007.php b/hphp/test/zend/bad/ext-spl/array_007.php new file mode 100644 index 000000000..dd9735eac --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_007.php @@ -0,0 +1,39 @@ +imp = "implicit"; + } + + function getIterator() + { + $it = new ArrayObject($this); + return $it->getIterator(); + } +}; + +$test = new test; +$test->dyn = "dynamic"; + +print_r($test); + +print_r($test->getIterator()); + +foreach($test as $key => $val) +{ + echo "$key => $val\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_007.php.expectf b/hphp/test/zend/bad/ext-spl/array_007.php.expectf new file mode 100644 index 000000000..b02483fdd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_007.php.expectf @@ -0,0 +1,28 @@ +test Object +( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic +) +ArrayIterator Object +( + [storage:ArrayIterator:private] => ArrayObject Object + ( + [storage:ArrayObject:private] => test Object + ( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic + ) + + ) + +) +pub => public +imp => implicit +dyn => dynamic +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_008.php b/hphp/test/zend/bad/ext-spl/array_008.php new file mode 100644 index 000000000..c05c11eca --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_008.php @@ -0,0 +1,17 @@ +0, 1=>1, 2=>2); +$obj = new ArrayObject($arr); + +foreach($obj as $ak=>&$av) { + foreach($obj as $bk=>&$bv) { + if ($ak==0 && $bk==0) { + $bv = "modify"; + } + echo "$ak=>$av - $bk=>$bv\n"; + } +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_008.php.expectf b/hphp/test/zend/bad/ext-spl/array_008.php.expectf new file mode 100644 index 000000000..3ca4091c6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_008.php.expectf @@ -0,0 +1,10 @@ +0=>modify - 0=>modify +0=>modify - 1=>1 +0=>modify - 2=>2 +1=>1 - 0=>modify +1=>1 - 1=>1 +1=>1 - 2=>2 +2=>2 - 0=>modify +2=>2 - 1=>1 +2=>2 - 2=>2 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_009.php b/hphp/test/zend/bad/ext-spl/array_009.php new file mode 100644 index 000000000..3ccde4c67 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_009.php @@ -0,0 +1,13 @@ + array(21, 22 => array(221, 222), 23 => array(231)), 3); + +$dir = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); + +foreach ($dir as $file) { + print "$file\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_009.php.expectf b/hphp/test/zend/bad/ext-spl/array_009.php.expectf new file mode 100644 index 000000000..a844ea643 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_009.php.expectf @@ -0,0 +1,7 @@ +1 +21 +221 +222 +231 +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_009a.php b/hphp/test/zend/bad/ext-spl/array_009a.php new file mode 100644 index 000000000..c13501c3c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_009a.php @@ -0,0 +1,26 @@ +current()); + } + + function getChildren() + { + return new MyRecursiveArrayIterator($this->current()); + } +} + +$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); + +$dir = new RecursiveIteratorIterator(new MyRecursiveArrayIterator($array), RecursiveIteratorIterator::LEAVES_ONLY); + +foreach ($dir as $file) { + print "$file\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_009a.php.expectf b/hphp/test/zend/bad/ext-spl/array_009a.php.expectf new file mode 100644 index 000000000..a844ea643 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_009a.php.expectf @@ -0,0 +1,7 @@ +1 +21 +221 +222 +231 +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_010.php b/hphp/test/zend/bad/ext-spl/array_010.php new file mode 100644 index 000000000..f76fa5108 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_010.php @@ -0,0 +1,62 @@ +'3rd', '4th'=>4)); + +var_dump($obj->getArrayCopy()); + +echo "===EMPTY===\n"; +var_dump(empty($obj[0])); +var_dump(empty($obj[1])); +var_dump(empty($obj[2])); +var_dump(empty($obj['4th'])); +var_dump(empty($obj['5th'])); +var_dump(empty($obj[6])); + +echo "===isset===\n"; +var_dump(isset($obj[0])); +var_dump(isset($obj[1])); +var_dump(isset($obj[2])); +var_dump(isset($obj['4th'])); +var_dump(isset($obj['5th'])); +var_dump(isset($obj[6])); + +echo "===offsetGet===\n"; +var_dump($obj[0]); +var_dump($obj[1]); +var_dump($obj[2]); +var_dump($obj['4th']); +var_dump($obj['5th']); +var_dump($obj[6]); + +echo "===offsetSet===\n"; +echo "WRITE 1\n"; +$obj[1] = 'Changed 1'; +var_dump($obj[1]); +echo "WRITE 2\n"; +$obj['4th'] = 'Changed 4th'; +var_dump($obj['4th']); +echo "WRITE 3\n"; +$obj['5th'] = 'Added 5th'; +var_dump($obj['5th']); +echo "WRITE 4\n"; +$obj[6] = 'Added 6'; +var_dump($obj[6]); + +var_dump($obj[0]); +var_dump($obj[2]); + +$x = $obj[6] = 'changed 6'; +var_dump($obj[6]); +var_dump($x); + +echo "===unset===\n"; +var_dump($obj->getArrayCopy()); +unset($obj[2]); +unset($obj['4th']); +unset($obj[7]); +unset($obj['8th']); +var_dump($obj->getArrayCopy()); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_010.php.expectf b/hphp/test/zend/bad/ext-spl/array_010.php.expectf new file mode 100644 index 000000000..bcd00c318 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_010.php.expectf @@ -0,0 +1,74 @@ +array(4) { + [0]=> + string(3) "1st" + [1]=> + int(1) + [2]=> + string(3) "3rd" + ["4th"]=> + int(4) +} +===EMPTY=== +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +===isset=== +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +===offsetGet=== +string(3) "1st" +int(1) +string(3) "3rd" +int(4) +HipHop Notice: %a +NULL +HipHop Notice: %a +NULL +===offsetSet=== +WRITE 1 +string(9) "Changed 1" +WRITE 2 +string(11) "Changed 4th" +WRITE 3 +string(9) "Added 5th" +WRITE 4 +string(7) "Added 6" +string(3) "1st" +string(3) "3rd" +string(9) "changed 6" +string(9) "changed 6" +===unset=== +array(6) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + [2]=> + string(3) "3rd" + ["4th"]=> + string(11) "Changed 4th" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +HipHop Notice: %a +HipHop Notice: %a +array(4) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_011.php b/hphp/test/zend/bad/ext-spl/array_011.php new file mode 100644 index 000000000..d3daf349e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_011.php @@ -0,0 +1,12 @@ + 0, 'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5); +//foreach (new ArrayIterator($a) as $k => $v) +foreach (new LimitIterator(new ArrayIterator($a), 1, 3) as $k => $v) +{ + var_dump(array($k, $v)); +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_011.php.expectf b/hphp/test/zend/bad/ext-spl/array_011.php.expectf new file mode 100644 index 000000000..afda9ef92 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_011.php.expectf @@ -0,0 +1,19 @@ +array(2) { + [0]=> + string(3) "one" + [1]=> + int(1) +} +array(2) { + [0]=> + string(3) "two" + [1]=> + int(2) +} +array(2) { + [0]=> + string(5) "three" + [1]=> + int(3) +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_013.php b/hphp/test/zend/bad/ext-spl/array_013.php new file mode 100644 index 000000000..44da383af --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_013.php @@ -0,0 +1,61 @@ + 'zero', 1 => 'one', 2 => 'two'); +$it = new ArrayIterator($a); + +foreach($it as $key => $val) +{ + echo "$key=>$val\n"; +} + +echo "===Append===\n"; + +$it->append('three'); +$it->append('four'); + +foreach(new NoRewindIterator($it) as $key => $val) +{ + echo "$key=>$val\n"; +} + +echo "===Object===\n"; + +class test +{ + public $zero = 0; + protected $pro; + public $one = 1; + private $pri; + public $two = 2; +} + +$o = new test; +$it = new ArrayIterator($o); + +foreach($it as $key => $val) +{ + echo "$key=>$val\n"; +} + +echo "===Append===\n"; + +$it->append('three'); +$it->append('four'); + +foreach(new NoRewindIterator($it) as $key => $val) +{ + echo "$key=>$val\n"; +} + +var_dump($o->{0}); /* doesn't wotk anyway */ + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_013.php.expectf b/hphp/test/zend/bad/ext-spl/array_013.php.expectf new file mode 100644 index 000000000..4a39189b3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_013.php.expectf @@ -0,0 +1,14 @@ +===Array=== +0=>zero +1=>one +2=>two +===Append=== +3=>three +4=>four +===Object=== +zero=>0 +one=>1 +two=>2 +===Append=== + +Catchable fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in %sarray_013.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_014.php b/hphp/test/zend/bad/ext-spl/array_014.php new file mode 100644 index 000000000..b3830b163 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_014.php @@ -0,0 +1,38 @@ +count()); +$it->seek(5); +var_dump($it->current()); +$it->seek(4); +var_dump($it->current()); +try +{ + $it->seek(-1); + var_dump($it->current()); +} +catch(Exception $e) +{ + echo $e->getMessage() . "\n"; +} + +try +{ + $it->seek(12); + var_dump($it->current()); +} +catch(Exception $e) +{ + echo $e->getMessage() . "\n"; +} + +$pos = 0; +foreach($it as $v) +{ + $it->seek($pos++); + var_dump($v); +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_014.php.expectf b/hphp/test/zend/bad/ext-spl/array_014.php.expectf new file mode 100644 index 000000000..94a56235d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_014.php.expectf @@ -0,0 +1,17 @@ +int(11) +int(5) +int(4) +Seek position -1 is out of range +Seek position 12 is out of range +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_015.php b/hphp/test/zend/bad/ext-spl/array_015.php new file mode 100644 index 000000000..66e83c5f2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_015.php @@ -0,0 +1,39 @@ +getIterator(); + +$ar->offsetUnset($it->key()); +$it->next(); + +var_dump($it->current()); +var_dump($ar); + +foreach($it as $k => $v) +{ + $ar->offsetUnset($k+1); + echo "$k=>$v\n"; +} + +var_dump($ar); + +foreach($it as $k => $v) +{ + $ar->offsetUnset($k); + echo "$k=>$v\n"; +} + +var_dump($ar); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_015.php.expectf b/hphp/test/zend/bad/ext-spl/array_015.php.expectf new file mode 100644 index 000000000..964b8fca6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_015.php.expectf @@ -0,0 +1,51 @@ +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(5) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + } +} +HipHop Notice: %a +int(2) +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(4) { + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + } +} +1=>2 +3=>4 +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(2) { + [1]=> + int(2) + [3]=> + int(4) + } +} +1=>2 +HipHop Notice: %a +3=>4 +HipHop Notice: %a +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(0) { + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_016.php b/hphp/test/zend/bad/ext-spl/array_016.php new file mode 100644 index 000000000..a77a498ed --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_016.php @@ -0,0 +1,19 @@ + +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_016.php.expectf b/hphp/test/zend/bad/ext-spl/array_016.php.expectf new file mode 100644 index 000000000..18e888666 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_016.php.expectf @@ -0,0 +1,9 @@ +int(0) +int(1) +int(2) +int(3) +int(0) +int(1) +int(2) +int(3) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_017.php b/hphp/test/zend/bad/ext-spl/array_017.php new file mode 100644 index 000000000..0a41ad8fc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_017.php @@ -0,0 +1,129 @@ +imp2 = 4; + } + + function dump() + { + echo __METHOD__ . "()\n"; + var_dump(array('Flags'=>$this->getFlags() + ,'OVars'=>get_object_vars($this) + ,'$this'=>$this)); + } + + function setFlags($flags) + { + echo __METHOD__ . "($flags)\n"; + ArrayIterator::setFlags($flags); + } +} + +class ArrayObjectEx extends ArrayObject +{ + public $pub1 = 1; + protected $pro1 = 2; + private $pri1 = 3; + + function __construct($ar = array(), $flags = 0) + { + echo __METHOD__ . "()\n"; + parent::__construct($ar, $flags); + $this->imp1 = 4; + } + + function exchange() + { + echo __METHOD__ . "()\n"; + $this->exchangeArray($this); + } + + function dump() + { + echo __METHOD__ . "()\n"; + var_dump(array('Flags'=>$this->getFlags() + ,'OVars'=>get_object_vars($this) + ,'$this'=>$this)); + } + + function show() + { + echo __METHOD__ . "()\n"; + foreach($this as $n => $v) + { + var_dump(array($n => $v)); + } + } + + function setFlags($flags) + { + echo __METHOD__ . "($flags)\n"; + ArrayObject::setFlags($flags); + } + + function getIterator() + { + echo __METHOD__ . "()\n"; + $it = new ArrayIteratorEx($this, $this->getFlags()); + $it->dyn2 = 5; + $it->dump(); + return $it; + } +} + +function check($obj, $flags) +{ + echo "===CHECK===\n"; + + $obj->setFlags($flags); + $obj->dump(); + $obj->show(); + + echo "===FOREACH===\n"; + + $it = $obj->getIterator(); + foreach($it as $n => $v) + { + var_dump(array($n => $v)); + } + + echo "===PROPERTY===\n"; + + var_dump($obj->pub1); + var_dump(isset($obj->a)); + $obj->setFlags($flags | 2); + var_dump($obj->pub1); + var_dump(isset($obj->a)); + + var_dump($it->pub2); + var_dump(isset($it->pub1)); + $it->setFlags($flags | 2); + var_dump($it->pub2); + var_dump(isset($it->pub1)); +} + +$obj = new ArrayObjectEx(array(0=>1,'a'=>25, 'pub1'=>42), 0); +$obj->dyn1 = 5; + +check($obj, 0); +check($obj, 1); + +echo "#####EXCHANGE#####\n"; + +$obj->exchange(); + +check($obj, 0); +check($obj, 1); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_017.php.expectf b/hphp/test/zend/bad/ext-spl/array_017.php.expectf new file mode 100644 index 000000000..feffa0a7e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_017.php.expectf @@ -0,0 +1,684 @@ +ArrayObjectEx::__construct() +===CHECK=== +ArrayObjectEx::setFlags(0) +ArrayObjectEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(2) { + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + ["$this"]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } +} +ArrayObjectEx::show() +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(2) { + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } + } +} +array(1) { + [0]=> + int(1) +} +array(1) { + ["a"]=> + int(25) +} +array(1) { + ["pub1"]=> + int(42) +} +===FOREACH=== +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(2) { + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } + } +} +array(1) { + [0]=> + int(1) +} +array(1) { + ["a"]=> + int(25) +} +array(1) { + ["pub1"]=> + int(42) +} +===PROPERTY=== +int(1) +bool(false) +ArrayObjectEx::setFlags(2) +int(1) +bool(true) +int(1) +bool(false) +ArrayIteratorEx::setFlags(2) +int(1) +bool(true) +===CHECK=== +ArrayObjectEx::setFlags(1) +ArrayObjectEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub1"]=> + int(1) + ["pro1"]=> + int(2) + ["pri1"]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + ["$this"]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } +} +ArrayObjectEx::show() +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub2"]=> + int(1) + ["pro2"]=> + int(2) + ["pri2"]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } + } +} +array(1) { + [0]=> + int(1) +} +array(1) { + ["a"]=> + int(25) +} +array(1) { + ["pub1"]=> + int(42) +} +===FOREACH=== +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub2"]=> + int(1) + ["pro2"]=> + int(2) + ["pri2"]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } + } +} +array(1) { + [0]=> + int(1) +} +array(1) { + ["a"]=> + int(25) +} +array(1) { + ["pub1"]=> + int(42) +} +===PROPERTY=== +int(1) +bool(false) +ArrayObjectEx::setFlags(3) +int(1) +bool(true) +int(1) +bool(false) +ArrayIteratorEx::setFlags(3) +int(1) +bool(true) +#####EXCHANGE##### +ArrayObjectEx::exchange() +===CHECK=== +ArrayObjectEx::setFlags(0) +ArrayObjectEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(5) { + ["pub1"]=> + int(1) + ["pro1"]=> + int(2) + ["pri1"]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + ["$this"]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } +} +ArrayObjectEx::show() +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(4) { + ["pub1"]=> + int(1) + ["pro1"]=> + int(2) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + } +} +array(1) { + ["pub1"]=> + int(1) +} +array(1) { + ["imp1"]=> + int(4) +} +array(1) { + ["dyn1"]=> + int(5) +} +===FOREACH=== +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(0) + ["OVars"]=> + array(4) { + ["pub1"]=> + int(1) + ["pro1"]=> + int(2) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + } +} +array(1) { + ["pub1"]=> + int(1) +} +array(1) { + ["imp1"]=> + int(4) +} +array(1) { + ["dyn1"]=> + int(5) +} +===PROPERTY=== +int(1) +bool(false) +ArrayObjectEx::setFlags(2) +int(1) +bool(false) +int(1) +bool(false) +ArrayIteratorEx::setFlags(2) +int(1) +bool(true) +===CHECK=== +ArrayObjectEx::setFlags(1) +ArrayObjectEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub1"]=> + int(1) + ["pro1"]=> + int(2) + ["pri1"]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + ["$this"]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } +} +ArrayObjectEx::show() +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub2"]=> + int(1) + ["pro2"]=> + int(2) + ["pri2"]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + } +} +array(1) { + ["pub1"]=> + int(1) +} +array(1) { + ["imp1"]=> + int(4) +} +array(1) { + ["dyn1"]=> + int(5) +} +===FOREACH=== +ArrayObjectEx::getIterator() +ArrayIteratorEx::__construct() +ArrayIteratorEx::dump() +array(3) { + ["Flags"]=> + int(1) + ["OVars"]=> + array(5) { + ["pub2"]=> + int(1) + ["pro2"]=> + int(2) + ["pri2"]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + } + ["$this"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> + int(1) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } + } +} +array(1) { + ["pub1"]=> + int(1) +} +array(1) { + ["imp1"]=> + int(4) +} +array(1) { + ["dyn1"]=> + int(5) +} +===PROPERTY=== +int(1) +bool(false) +ArrayObjectEx::setFlags(3) +int(1) +bool(false) +int(1) +bool(false) +ArrayIteratorEx::setFlags(3) +int(1) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_018.php b/hphp/test/zend/bad/ext-spl/array_018.php new file mode 100644 index 000000000..500a57009 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_018.php @@ -0,0 +1,29 @@ +offsetSet("\0", "Foo"); +} +catch (Exception $e) +{ + var_dump($e->getMessage()); +} + +var_dump($foo); + +try +{ + $foo = new ArrayObject(); + $data = explode("=", "=Foo"); + $foo->offsetSet($data[0], $data[1]); +} +catch (Exception $e) +{ + var_dump($e->getMessage()); +} + +var_dump($foo); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_018.php.expectf b/hphp/test/zend/bad/ext-spl/array_018.php.expectf new file mode 100644 index 000000000..7d80a721f Binary files /dev/null and b/hphp/test/zend/bad/ext-spl/array_018.php.expectf differ diff --git a/hphp/test/zend/bad/ext-spl/array_019.php b/hphp/test/zend/bad/ext-spl/array_019.php new file mode 100644 index 000000000..4cf38df75 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_019.php @@ -0,0 +1,20 @@ + +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_019.php.expectf b/hphp/test/zend/bad/ext-spl/array_019.php.expectf new file mode 100644 index 000000000..93ecc02dd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_019.php.expectf @@ -0,0 +1,5 @@ +int(1) +int(2) +int(3) +int(4) +HipHop Fatal error: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_021.php b/hphp/test/zend/bad/ext-spl/array_021.php new file mode 100644 index 000000000..a90ea3960 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_021.php @@ -0,0 +1,24 @@ +seek('bar'); +} +catch (Exception $e) +{ + echo "got exception\n"; +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_021.php.expectf b/hphp/test/zend/bad/ext-spl/array_021.php.expectf new file mode 100644 index 000000000..744e0ce96 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_021.php.expectf @@ -0,0 +1,3 @@ +foo::seek(bar) +got exception +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_022.php b/hphp/test/zend/bad/ext-spl/array_022.php new file mode 100644 index 000000000..3b26f8900 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_022.php @@ -0,0 +1,43 @@ +==ArrayObject=== + +==ArrayIterator=== + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_022.php.expectf b/hphp/test/zend/bad/ext-spl/array_022.php.expectf new file mode 100644 index 000000000..353d12e6a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_022.php.expectf @@ -0,0 +1,33 @@ +==ArrayObject=== +object(MyArrayObject)#%d (1) { + ["bar"]=> + string(3) "baz" +} +object(MyArrayObject)#%d (3) { + ["bar"]=> + string(3) "baz" + ["baz"]=> + string(3) "Foo" + ["storage":"ArrayObject":private]=> + array(1) { + ["bar"]=> + string(3) "baz" + } +} +==ArrayIterator=== +object(MyArrayIterator)#%d (1) { + ["bar"]=> + string(3) "baz" +} +object(MyArrayIterator)#%d (3) { + ["bar"]=> + string(3) "baz" + ["baz"]=> + string(3) "Foo" + ["storage":"ArrayIterator":private]=> + object(MyArrayIterator)#%d (1) { + ["bar"]=> + string(3) "baz" + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_023.php b/hphp/test/zend/bad/ext-spl/array_023.php new file mode 100644 index 000000000..7fb2163ed --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_023.php @@ -0,0 +1,35 @@ +var); + +$a = unserialize(serialize($a)); + +var_dump($a); +var_dump($a->var); + +class Bla extends ArrayObject +{ + public $var = 'aaa'; + protected $bar = 'bbb'; + private $foo = 'ccc'; +} + +$a = new Bla(); +var_dump($a); +var_dump($a->var); + +$a = unserialize(serialize($a)); + +var_dump($a); +var_dump($a->var); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_023.php.expectf b/hphp/test/zend/bad/ext-spl/array_023.php.expectf new file mode 100644 index 000000000..a7f630882 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_023.php.expectf @@ -0,0 +1,48 @@ +object(Name)#1 (4) { + ["var"]=> + string(1) "a" + ["bar":protected]=> + string(1) "b" + ["foo":"Name":private]=> + string(1) "c" + ["storage":"ArrayObject":private]=> + array(0) { + } +} +string(1) "a" +object(Name)#2 (4) { + ["var"]=> + string(1) "a" + ["bar":protected]=> + string(1) "b" + ["foo":"Name":private]=> + string(1) "c" + ["storage":"ArrayObject":private]=> + array(0) { + } +} +string(1) "a" +object(Bla)#1 (4) { + ["var"]=> + string(3) "aaa" + ["bar":protected]=> + string(3) "bbb" + ["foo":"Bla":private]=> + string(3) "ccc" + ["storage":"ArrayObject":private]=> + array(0) { + } +} +string(3) "aaa" +object(Bla)#2 (4) { + ["var"]=> + string(3) "aaa" + ["bar":protected]=> + string(3) "bbb" + ["foo":"Bla":private]=> + string(3) "ccc" + ["storage":"ArrayObject":private]=> + array(0) { + } +} +string(3) "aaa" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_024.php b/hphp/test/zend/bad/ext-spl/array_024.php new file mode 100644 index 000000000..c367d82b2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_024.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_024.php.expectf b/hphp/test/zend/bad/ext-spl/array_024.php.expectf new file mode 100644 index 000000000..e14ca2b76 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_024.php.expectf @@ -0,0 +1,2 @@ +int(2) +int(-2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_025.php b/hphp/test/zend/bad/ext-spl/array_025.php new file mode 100644 index 000000000..fb74a3901 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_025.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_025.php.expectf b/hphp/test/zend/bad/ext-spl/array_025.php.expectf new file mode 100644 index 000000000..2b6eb9ef1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_025.php.expectf @@ -0,0 +1,27 @@ +ArrayObject Object +( + [storage:ArrayObject:private] => ArrayObject Object + ( + [storage:ArrayObject:private] => Array + ( + [0] => 1 + [1] => 2 + ) + + ) + +) +C:11:"ArrayObject":76:{x:i:0;C:11:"ArrayObject":37:{x:i:0;a:2:{i:0;i:1;i:1;i:2;};m:a:0:{}};m:a:0:{}} +ArrayObject Object +( + [storage:ArrayObject:private] => ArrayObject Object + ( + [storage:ArrayObject:private] => Array + ( + [0] => 1 + [1] => 2 + ) + + ) + +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_026.php b/hphp/test/zend/bad/ext-spl/array_026.php new file mode 100644 index 000000000..e5febeb9c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_026.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_026.php.expectf b/hphp/test/zend/bad/ext-spl/array_026.php.expectf new file mode 100644 index 000000000..9395c9902 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_026.php.expectf @@ -0,0 +1,14 @@ +HipHop Notice: %a +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["d1"]=> + array(2) { + ["d2"]=> + string(5) "hello" + ["d3"]=> + string(5) "world" + } + } +} +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/array_027.php b/hphp/test/zend/bad/ext-spl/array_027.php new file mode 100644 index 000000000..2d732e7a5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/array_027.php @@ -0,0 +1,7 @@ + + array(1) { + ["plop"]=> + *RECURSION* + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug28822.php b/hphp/test/zend/bad/ext-spl/bug28822.php new file mode 100644 index 000000000..17b69c7f6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug28822.php @@ -0,0 +1,9 @@ +offsetSet('key', 'value'); +var_dump($array->offsetExists('key')); +var_dump($array->offsetExists('nokey')); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug28822.php.expectf b/hphp/test/zend/bad/ext-spl/bug28822.php.expectf new file mode 100644 index 000000000..3b8a15ebb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug28822.php.expectf @@ -0,0 +1,3 @@ +bool(true) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31346.php b/hphp/test/zend/bad/ext-spl/bug31346.php new file mode 100644 index 000000000..2f93778dd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31346.php @@ -0,0 +1,13 @@ +var1=1; + +$ao = new ArrayObject($obj); + +$i = $ao->getIterator(); + +$ao->offsetUnset($i->key()); +$i->next(); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31346.php.expectf b/hphp/test/zend/bad/ext-spl/bug31346.php.expectf new file mode 100644 index 000000000..5bd1c8ac4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31346.php.expectf @@ -0,0 +1,2 @@ +HipHop Notice: %a +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31348.php b/hphp/test/zend/bad/ext-spl/bug31348.php new file mode 100644 index 000000000..6cd637d0d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31348.php @@ -0,0 +1,10 @@ +rewind(); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31348.php.expectf b/hphp/test/zend/bad/ext-spl/bug31348.php.expectf new file mode 100644 index 000000000..922a780ce --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31348.php.expectf @@ -0,0 +1 @@ +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31926.php b/hphp/test/zend/bad/ext-spl/bug31926.php new file mode 100644 index 000000000..dffd14010 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31926.php @@ -0,0 +1,10 @@ + array('world')); + +$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array)); +foreach($it as $key => $val) { + var_dump($key, $val); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug31926.php.expectf b/hphp/test/zend/bad/ext-spl/bug31926.php.expectf new file mode 100644 index 000000000..50f979a63 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug31926.php.expectf @@ -0,0 +1,2 @@ +int(0) +string(5) "world" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug32394.php b/hphp/test/zend/bad/ext-spl/bug32394.php new file mode 100644 index 000000000..5a0ce00c9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug32394.php @@ -0,0 +1,12 @@ +append(1); + +foreach($object as $key => $value) +{ + $object->offsetUnset($key); +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug32394.php.expectf b/hphp/test/zend/bad/ext-spl/bug32394.php.expectf new file mode 100644 index 000000000..922a780ce --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug32394.php.expectf @@ -0,0 +1 @@ +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug33136.php b/hphp/test/zend/bad/ext-spl/bug33136.php new file mode 100644 index 000000000..217341fcb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug33136.php @@ -0,0 +1,47 @@ +data = array(); + parent::__construct($this->data); + } + + function offsetGet($index) + { + echo __METHOD__ . "($index)\n"; + return parent::offsetGet($index); + } + + function offsetSet($index, $value) + { + echo __METHOD__ . "(" . (is_null($index) ? "NULL" : $index) . ",$value)\n"; + parent::offsetSet($index, $value); + } +} + +echo "\n\nInitiate Obj\n"; +$arrayObj = new Collection(); + +echo "Assign values\n"; + +$arrayObj[] = "foo"; +var_dump($arrayObj[0]); + +$arrayObj[] = "bar"; +var_dump($arrayObj[0]); +var_dump($arrayObj[1]); + +$arrayObj["foo"] = "baz"; +var_dump($arrayObj["foo"]); + +print_r($arrayObj); + +var_dump(count($arrayObj)); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug33136.php.expectf b/hphp/test/zend/bad/ext-spl/bug33136.php.expectf new file mode 100644 index 000000000..921496d74 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug33136.php.expectf @@ -0,0 +1,29 @@ +Initiate Obj +Assign values +Collection::offsetSet(NULL,foo) +Collection::offsetGet(0) +string(3) "foo" +Collection::offsetSet(NULL,bar) +Collection::offsetGet(0) +string(3) "foo" +Collection::offsetGet(1) +string(3) "bar" +Collection::offsetSet(foo,baz) +Collection::offsetGet(foo) +string(3) "baz" +Collection Object +( + [data:Collection:private] => Array + ( + ) + + [storage:ArrayObject:private] => Array + ( + [0] => foo + [1] => bar + [foo] => baz + ) + +) +int(3) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug34548.php b/hphp/test/zend/bad/ext-spl/bug34548.php new file mode 100644 index 000000000..726285fb3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug34548.php @@ -0,0 +1,25 @@ +append($value); + } + + public function offsetSet($index, $value) + { + parent::offsetSet($index, $value); + } +} + +$data1=array('one', 'two', 'three'); +$data2=array('four', 'five'); + +$foo=new Collection($data1); +$foo->add($data2); + +print_r($foo->getArrayCopy()); + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug34548.php.expectf b/hphp/test/zend/bad/ext-spl/bug34548.php.expectf new file mode 100644 index 000000000..c3bbf4273 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug34548.php.expectf @@ -0,0 +1,9 @@ +Array +( + [0] => one + [1] => two + [2] => three + [3] => four + [4] => five +) +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug36825.php b/hphp/test/zend/bad/ext-spl/bug36825.php new file mode 100644 index 000000000..baf42ba35 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug36825.php @@ -0,0 +1,24 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug36825.php.expectf b/hphp/test/zend/bad/ext-spl/bug36825.php.expectf new file mode 100644 index 000000000..22f6f580a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug36825.php.expectf @@ -0,0 +1,3 @@ +foo::offsetGet(bar) +got exception +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug36941.php b/hphp/test/zend/bad/ext-spl/bug36941.php new file mode 100644 index 000000000..4bd3f3f9a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug36941.php @@ -0,0 +1,27 @@ +===ArrayObject=== + +===ArrayIterator=== + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug36941.php.expectf b/hphp/test/zend/bad/ext-spl/bug36941.php.expectf new file mode 100644 index 000000000..3bdbcf2b7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug36941.php.expectf @@ -0,0 +1,15 @@ +===ArrayObject=== +int(1) +int(1) +int(1) +int(2) +int(1) +int(3) +===ArrayIterator=== +int(1) +int(1) +int(2) +int(2) +int(3) +int(3) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug37457.php b/hphp/test/zend/bad/ext-spl/bug37457.php new file mode 100644 index 000000000..80884b739 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug37457.php @@ -0,0 +1,68 @@ +array = $a; + } + + public function current() + { + echo __METHOD__ . "\n"; + return current($this->array); + } + + public function key() + { + echo __METHOD__ . "\n"; + return key($this->array); + } + + public function next() + { + echo __METHOD__ . "\n"; + $this->valid = (false !== next($this->array)); + } + + public function valid() + { + echo __METHOD__ . "\n"; + return $this->valid; + } + + public function rewind() + { + echo __METHOD__ . "\n"; + $this->valid = (false !== reset($this->array)); + } +} + +class TestFilter extends FilterIterator +{ + public function accept() + { + echo __METHOD__ . "\n"; + throw new Exception("Failure in Accept"); + } +} + +$test = new TestFilter(new Collection(array(0))); + +try +{ + foreach ($test as $item) + { + echo $item; + } +} +catch (Exception $e) +{ + var_dump($e->getMessage()); +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug37457.php.expectf b/hphp/test/zend/bad/ext-spl/bug37457.php.expectf new file mode 100644 index 000000000..ea5a57764 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug37457.php.expectf @@ -0,0 +1,8 @@ +Collection::__construct +Collection::rewind +Collection::valid +Collection::current +Collection::key +TestFilter::accept +string(17) "Failure in Accept" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug38618.php b/hphp/test/zend/bad/ext-spl/bug38618.php new file mode 100644 index 000000000..ffeef6c8e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug38618.php @@ -0,0 +1,87 @@ +title = $title; + } + + public function __toString() + { + return $this->title; + } +} + +class FruitProtected +{ + protected $title; + + public function __construct($title) + { + $this->title = $title; + } + + public function __toString() + { + return $this->title; + } +} + +function test_array($array, $which, $flags = 0) +{ + echo "===$which===\n"; + $it = new RecursiveArrayIterator($array, $flags); + foreach (new RecursiveIteratorIterator($it) as $k => $fruit) { + echo $k , ' => ', $fruit, "\n"; + } +} + +$array = array( + 1 => array( + 1 => array( + 1 => 'apple', + ), + 2 => array( + 1 => 'grape', + ), + ), +); + +test_array($array, 'Default with array'); + +$array = array( + 1 => array( + 1 => array( + 1 => new FruitPublic('apple'), + ), + 2 => array( + 1 => new FruitPublic('grape'), + ), + ), +); + +test_array($array, 'Public Property'); + +$array = array( + 1 => array( + 1 => array( + 1 => new FruitProtected('apple'), + ), + 2 => array( + 1 => new FruitProtected('grape'), + ), + ), +); + +test_array($array, 'Protected Property'); + +test_array($array, 'Public Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY); +test_array($array, 'Protected Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY); +?> +===DONE=== + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug38618.php.expectf b/hphp/test/zend/bad/ext-spl/bug38618.php.expectf new file mode 100644 index 000000000..d0422205b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug38618.php.expectf @@ -0,0 +1,14 @@ +===Default with array=== +1 => apple +1 => grape +===Public Property=== +title => apple +title => grape +===Protected Property=== +===Public Property New=== +1 => apple +1 => grape +===Protected Property New=== +1 => apple +1 => grape +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40036.php b/hphp/test/zend/bad/ext-spl/bug40036.php new file mode 100644 index 000000000..3007ac701 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40036.php @@ -0,0 +1,24 @@ +foo = false; +$view->bar = null; +$view->baz = ''; +if (empty($view['foo']) || empty($view->foo)) { + echo "View::foo empty\n"; +} +if (empty($view['bar']) || empty($view->bar)) { + echo "View::bar empty\n"; +} +if (empty($view['baz']) || empty($view->baz)) { + echo "View::baz empty\n"; +} +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40036.php.expectf b/hphp/test/zend/bad/ext-spl/bug40036.php.expectf new file mode 100644 index 000000000..f0aa23161 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40036.php.expectf @@ -0,0 +1,4 @@ +View::foo empty +View::bar empty +View::baz empty +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40442.php b/hphp/test/zend/bad/ext-spl/bug40442.php new file mode 100644 index 000000000..63848e542 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40442.php @@ -0,0 +1,6 @@ +offsetSet('property', 0); +var_dump($a->offsetExists('property')); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40442.php.expectf b/hphp/test/zend/bad/ext-spl/bug40442.php.expectf new file mode 100644 index 000000000..e7c042967 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40442.php.expectf @@ -0,0 +1,2 @@ +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40872.php b/hphp/test/zend/bad/ext-spl/bug40872.php new file mode 100644 index 000000000..08a7609b0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40872.php @@ -0,0 +1,23 @@ +id = $id; + } + } + + class ProjectsList extends ArrayIterator { + public function add(Project $item) { + $this->offsetSet($item->id, $item); + } + } + + $projects = new ProjectsList(); + $projects->add(new Project('1')); + $projects->add(new Project(2)); + + var_dump($projects->offsetExists(1)); + var_dump($projects->offsetExists('2')); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug40872.php.expectf b/hphp/test/zend/bad/ext-spl/bug40872.php.expectf new file mode 100644 index 000000000..c3b0dc5d5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug40872.php.expectf @@ -0,0 +1,3 @@ +bool(true) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41528.php b/hphp/test/zend/bad/ext-spl/bug41528.php new file mode 100644 index 000000000..c0236a317 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41528.php @@ -0,0 +1,17 @@ +a = 1; + +var_dump($classOne); +var_dump($classOne->a); + +$classOne = unserialize(serialize($classOne)); + +var_dump($classOne); +var_dump($classOne->a); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41528.php.expectf b/hphp/test/zend/bad/ext-spl/bug41528.php.expectf new file mode 100644 index 000000000..7fcfe486e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41528.php.expectf @@ -0,0 +1,16 @@ +object(ClassOne)#1 (2) { + ["a"]=> + int(1) + ["storage":"ArrayObject":private]=> + array(0) { + } +} +int(1) +object(ClassOne)#2 (2) { + ["a"]=> + int(1) + ["storage":"ArrayObject":private]=> + array(0) { + } +} +int(1) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41691.php b/hphp/test/zend/bad/ext-spl/bug41691.php new file mode 100644 index 000000000..33ded6449 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41691.php @@ -0,0 +1,16 @@ +exchangeArray(array('a'=>1,'b'=>1,'c'=>1))); + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41691.php.expectf b/hphp/test/zend/bad/ext-spl/bug41691.php.expectf new file mode 100644 index 000000000..74fcdcf3a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41691.php.expectf @@ -0,0 +1,9 @@ +array(3) { + ["a"]=> + NULL + ["b"]=> + NULL + ["c"]=> + NULL +} +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41692.php b/hphp/test/zend/bad/ext-spl/bug41692.php new file mode 100644 index 000000000..9f5cd6490 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41692.php @@ -0,0 +1,19 @@ +foo); + } +} + +$foo = new Bar(); +var_dump($foo); +$foo['foo'] = 23; + +$bar = new Bar(); +var_dump($bar); + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41692.php.expectf b/hphp/test/zend/bad/ext-spl/bug41692.php.expectf new file mode 100644 index 000000000..94dd1d825 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41692.php.expectf @@ -0,0 +1,41 @@ +object(Bar)#%d (2) { + ["foo":"Bar":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} +object(Bar)#%d (2) { + ["foo":"Bar":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + } +} +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41828.php b/hphp/test/zend/bad/ext-spl/bug41828.php new file mode 100644 index 000000000..5fd782cd4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41828.php @@ -0,0 +1,16 @@ +bar(); + +?> +==DONE== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug41828.php.expectf b/hphp/test/zend/bad/ext-spl/bug41828.php.expectf new file mode 100644 index 000000000..3dad4aedf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug41828.php.expectf @@ -0,0 +1 @@ +HipHop Fatal error: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug42654.php b/hphp/test/zend/bad/ext-spl/bug42654.php new file mode 100644 index 000000000..26930d4fd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug42654.php @@ -0,0 +1,20 @@ + 'val1', + array(2 => 'val2', + array(3 => 'val3'), + ), + 4 => 'val4' + ); + +$iterator = new RecursiveIteratorIterator(new +RecursiveArrayIterator($data)); +foreach($iterator as $foo) { + $key = $iterator->key(); + echo "update $key\n"; + var_dump($iterator->getInnerIterator()); + $iterator->offsetSet($key, 'alter'); + var_dump($iterator->getInnerIterator()); +} +$copy = $iterator->getArrayCopy(); +var_dump($copy); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug42654.php.expectf b/hphp/test/zend/bad/ext-spl/bug42654.php.expectf new file mode 100644 index 000000000..bf5ba7c2d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug42654.php.expectf @@ -0,0 +1,134 @@ +update 1 +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(3) { + [1]=> + string(4) "val1" + [2]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } + [4]=> + string(4) "val4" + } +} +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(3) { + [1]=> + string(5) "alter" + [2]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } + [4]=> + string(4) "val4" + } +} +update 2 +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } +} +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(2) { + [2]=> + string(5) "alter" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } +} +update 3 +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(1) { + [3]=> + string(4) "val3" + } +} +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(1) { + [3]=> + string(5) "alter" + } +} +update 4 +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(3) { + [1]=> + string(5) "alter" + [2]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } + [4]=> + string(4) "val4" + } +} +object(RecursiveArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(3) { + [1]=> + string(5) "alter" + [2]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } + [4]=> + string(5) "alter" + } +} +array(3) { + [1]=> + string(5) "alter" + [2]=> + array(2) { + [2]=> + string(4) "val2" + [3]=> + array(1) { + [3]=> + string(4) "val3" + } + } + [4]=> + string(5) "alter" +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug42703.php b/hphp/test/zend/bad/ext-spl/bug42703.php new file mode 100644 index 000000000..40d73b09c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug42703.php @@ -0,0 +1,34 @@ + $value) { + echo $key, $value; + } +} +catch (Exception $e) { + var_dump($e->getMessage()); +} + +var_dump($itit->current()); +var_dump($itit->key()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug42703.php.expectf b/hphp/test/zend/bad/ext-spl/bug42703.php.expectf new file mode 100644 index 000000000..dce684ad2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug42703.php.expectf @@ -0,0 +1,3 @@ +string(3) "boo" +NULL +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug44615.php b/hphp/test/zend/bad/ext-spl/bug44615.php new file mode 100644 index 000000000..406dd8260 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug44615.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug44615.php.expectf b/hphp/test/zend/bad/ext-spl/bug44615.php.expectf new file mode 100644 index 000000000..88718f960 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug44615.php.expectf @@ -0,0 +1,9 @@ +string(1) "z" +object(stdClass)#1 (0) { +} +string(1) "q" +string(1) "s" +Second: +string(1) "z" +string(1) "q" +string(1) "s" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45216.php b/hphp/test/zend/bad/ext-spl/bug45216.php new file mode 100644 index 000000000..5bd5a04ce --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45216.php @@ -0,0 +1,11 @@ +text 1'); +$handle = fopen($file, 'r'); + +$object = new SplFileObject($file); +var_dump($object->fgetss()); +var_dump(fgetss($handle)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45216.php.expectf b/hphp/test/zend/bad/ext-spl/bug45216.php.expectf new file mode 100644 index 000000000..71dec0174 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45216.php.expectf @@ -0,0 +1,2 @@ +string(12) "text 0text 1" +string(12) "text 0text 1" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45614.php b/hphp/test/zend/bad/ext-spl/bug45614.php new file mode 100644 index 000000000..a24fe90c9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45614.php @@ -0,0 +1,37 @@ +key()) . " => " . $it->current() . +"\n"; + $it->next(); + echo str_replace("\0", '\0', $it->key()) . " => " . $it->current() . +"\n"; +} + +$ao = new ArrayObject(new C); +$ai = $ao->getIterator(); + +echo "--> Show the first two items:\n"; +showFirstTwoItems($ai); + +echo "\n--> Rewind and show the first two items:\n"; +$ai->rewind(); +showFirstTwoItems($ai); + +echo "\n--> Invalidate current position and show the first two items:\n"; +unset($ai[$ai->key()]); +$ai->current(); +showFirstTwoItems($ai); + +echo "\n--> Rewind, seek and show the first two items:\n"; +$ai->rewind(); +$ai->seek(0); +showFirstTwoItems($ai); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45614.php.expectf b/hphp/test/zend/bad/ext-spl/bug45614.php.expectf new file mode 100644 index 000000000..d7d400891 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45614.php.expectf @@ -0,0 +1,15 @@ +--> Show the first two items: +pub1 => public1 +pub2 => public2 + +--> Rewind and show the first two items: +pub1 => public1 +pub2 => public2 + +--> Invalidate current position and show the first two items: +pub1 => public1 +pub3 => public3 + +--> Rewind, seek and show the first two items: +pub1 => public1 +pub3 => public3 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45622.php b/hphp/test/zend/bad/ext-spl/bug45622.php new file mode 100644 index 000000000..44c628dc2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45622.php @@ -0,0 +1,28 @@ +'array element')); +$ao->setFlags(ArrayObject::ARRAY_AS_PROPS); + +echo "\n--> Access the real property:\n"; +var_dump(isset($ao->p)); +var_dump($ao->p); + +echo "\n--> Remove the real property and access the array element:\n"; +unset($ao->p); +var_dump(isset($ao->p)); +var_dump($ao->p); + +echo "\n--> Remove the array element and try access again:\n"; +unset($ao->p); +var_dump(isset($ao->p)); +var_dump($ao->p); + +echo "\n--> Re-add the real property:\n"; +$ao->p = 'object property'; +var_dump(isset($ao->p)); +var_dump($ao->p); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45622.php.expectf b/hphp/test/zend/bad/ext-spl/bug45622.php.expectf new file mode 100644 index 000000000..ee335e0d1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45622.php.expectf @@ -0,0 +1,16 @@ +--> Access the real property: +bool(true) +%unicode|string%(15) "object property" + +--> Remove the real property and access the array element: +bool(true) +%unicode|string%(13) "array element" + +--> Remove the array element and try access again: +bool(false) +HipHop Notice: %a +NULL + +--> Re-add the real property: +bool(true) +%unicode|string%(15) "object property" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45622b.php b/hphp/test/zend/bad/ext-spl/bug45622b.php new file mode 100644 index 000000000..36aba07e9 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45622b.php @@ -0,0 +1,21 @@ +prop1; + +echo "Doesn't trigger __set.\n"; +$ao->prop2 = 'foo'; + +echo "Doesn't trigger __unset.\n"; +unset($ao->prop3); + +echo "Shouldn't trigger __isset.\n"; +isset($ao->prop4); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45622b.php.expectf b/hphp/test/zend/bad/ext-spl/bug45622b.php.expectf new file mode 100644 index 000000000..efac7eab4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45622b.php.expectf @@ -0,0 +1,6 @@ +Doesn't trigger __get. +HipHop Notice: %a +Doesn't trigger __set. +Doesn't trigger __unset. +HipHop Notice: %a +Shouldn't trigger __isset. \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45826.php b/hphp/test/zend/bad/ext-spl/bug45826.php new file mode 100644 index 000000000..fe05d4c21 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45826.php @@ -0,0 +1,65 @@ +append($y); +$o->append($y); +$o->append($o); + +var_dump($o[0] === $o[1]); +var_dump($o[2] === $o); + +$s1 = serialize($o); +$s2 = $o->serialize(); +var_dump($s1); +var_dump($s2); + +$o1 =unserialize($s1); + +var_dump($o1[0] === $o1[1]); +var_dump($o1[2] === $o1); + +$o2 = new ArrayObject(); +$o2->unserialize($s2); + +var_dump($o2[0] === $o2[1]); +var_dump($o2[2] !== $o2); +var_dump($o2[2][2] === $o2[2]); + +echo "#### Extending ArrayObject\n"; +unset($o,$x,$s1,$s2,$o1,$o2); +class ArrayObject2 extends ArrayObject { + public function serialize() { + return parent::serialize(); + } + + public function unserialize($s) { + return parent::unserialize($s); + } +} + +$o = new ArrayObject2(); +$y = new StdClass; +$o->append($y); +$o->append($y); +$o->append($o); + +var_dump($o[0] === $o[1]); +var_dump($o[2] === $o); + +$s1 = serialize($o); +$s2 = $o->serialize(); +var_dump($s1); +var_dump($s2); + +$o1 =unserialize($s1); + +var_dump($o1[0] === $o1[1]); +var_dump($o1[2] === $o1); + +$o2 = new ArrayObject2(); +$o2->unserialize($s2); + +var_dump($o2[0] === $o2[1]); +var_dump($o2[2] !== $o2); +var_dump($o2[2][2] === $o2[2]); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug45826.php.expectf b/hphp/test/zend/bad/ext-spl/bug45826.php.expectf new file mode 100644 index 000000000..03bedbd68 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug45826.php.expectf @@ -0,0 +1,19 @@ +bool(true) +bool(true) +string(84) "C:11:"ArrayObject":60:{x:i:0;a:3:{i:0;O:8:"stdClass":0:{}i:1;r:4;i:2;r:1;};m:a:0:{}}" +string(125) "x:i:0;a:3:{i:0;O:8:"stdClass":0:{}i:1;r:3;i:2;C:11:"ArrayObject":45:{x:i:0;a:3:{i:0;r:3;i:1;r:3;i:2;r:5;};m:a:0:{}}};m:a:0:{}" +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +#### Extending ArrayObject +bool(true) +bool(true) +string(85) "C:12:"ArrayObject2":60:{x:i:0;a:3:{i:0;O:8:"stdClass":0:{}i:1;r:4;i:2;r:1;};m:a:0:{}}" +string(126) "x:i:0;a:3:{i:0;O:8:"stdClass":0:{}i:1;r:3;i:2;C:12:"ArrayObject2":45:{x:i:0;a:3:{i:0;r:3;i:1;r:3;i:2;r:5;};m:a:0:{}}};m:a:0:{}" +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46051.php b/hphp/test/zend/bad/ext-spl/bug46051.php new file mode 100644 index 000000000..f144eacd8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46051.php @@ -0,0 +1,9 @@ +openFile(NULL, NULL, NULL); +} catch (Exception $e) { } + +var_dump($x->getPathName()); \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46051.php.expectf b/hphp/test/zend/bad/ext-spl/bug46051.php.expectf new file mode 100644 index 000000000..d013f39c5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46051.php.expectf @@ -0,0 +1 @@ +%unicode|string%(%d) "%sbug46051.php" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46053.php b/hphp/test/zend/bad/ext-spl/bug46053.php new file mode 100644 index 000000000..260b1faee --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46053.php @@ -0,0 +1,7 @@ +getPathName(); +$x->seek(10); +$x->seek(0); +var_dump(trim($x->fgets())); \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46053.php.expectf b/hphp/test/zend/bad/ext-spl/bug46053.php.expectf new file mode 100644 index 000000000..ab4f8172d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46053.php.expectf @@ -0,0 +1 @@ +string(%d) "accept()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46088.php.expectf b/hphp/test/zend/bad/ext-spl/bug46088.php.expectf new file mode 100644 index 000000000..eb28e0c67 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46088.php.expectf @@ -0,0 +1 @@ +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46115.php b/hphp/test/zend/bad/ext-spl/bug46115.php new file mode 100644 index 000000000..4be1edd8d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46115.php @@ -0,0 +1,6 @@ +invoke($h); +?> +DONE \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46115.php.expectf b/hphp/test/zend/bad/ext-spl/bug46115.php.expectf new file mode 100644 index 000000000..096264973 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46115.php.expectf @@ -0,0 +1 @@ +DONE \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46160.php b/hphp/test/zend/bad/ext-spl/bug46160.php new file mode 100644 index 000000000..ed4987b29 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46160.php @@ -0,0 +1,9 @@ +offsetSet(0, 0); +} catch (Exception $e) { } + +?> +DONE \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug46160.php.expectf b/hphp/test/zend/bad/ext-spl/bug46160.php.expectf new file mode 100644 index 000000000..096264973 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug46160.php.expectf @@ -0,0 +1 @@ +DONE \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug47534.php b/hphp/test/zend/bad/ext-spl/bug47534.php new file mode 100644 index 000000000..bf10dfb23 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug47534.php @@ -0,0 +1,8 @@ +rewind(); +echo gettype($it1->current())."\n"; + +$it2 = new RecursiveDirectoryIterator(dirname(__FILE__)); +$it2->rewind(); +echo gettype($it2->current())."\n"; \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug47534.php.expectf b/hphp/test/zend/bad/ext-spl/bug47534.php.expectf new file mode 100644 index 000000000..c78390912 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug47534.php.expectf @@ -0,0 +1,2 @@ +string +object \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug48361.php b/hphp/test/zend/bad/ext-spl/bug48361.php new file mode 100644 index 000000000..2977172c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug48361.php @@ -0,0 +1,6 @@ +getRealPath()); +var_dump($info->getPathInfo()->getRealPath()); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug48361.php.expectf b/hphp/test/zend/bad/ext-spl/bug48361.php.expectf new file mode 100644 index 000000000..02fab70b8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug48361.php.expectf @@ -0,0 +1,3 @@ +string(%d) "%stests%sbug48361.php" +string(%d) "%stests" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49263.php b/hphp/test/zend/bad/ext-spl/bug49263.php new file mode 100644 index 000000000..627965b0e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49263.php @@ -0,0 +1,15 @@ +attach($o1, array('prev' => 2, 'next' => $o2)); +$s->attach($o2, array('prev' => $o1)); + +$ss = serialize($s); +unset($s,$o1,$o2); +echo $ss."\n"; +var_dump(unserialize($ss)); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49263.php.expectf b/hphp/test/zend/bad/ext-spl/bug49263.php.expectf new file mode 100644 index 000000000..3859cc6cb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49263.php.expectf @@ -0,0 +1,33 @@ +C:16:"SplObjectStorage":113:{x:i:2;O:8:"stdClass":0:{},a:2:{s:4:"prev";i:2;s:4:"next";O:8:"stdClass":0:{}};r:6;,a:1:{s:4:"prev";r:3;};m:a:0:{}} +object(SplObjectStorage)#2 (1) { + ["storage":"SplObjectStorage":private]=> + array(2) { + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#1 (0) { + } + ["inf"]=> + array(2) { + ["prev"]=> + int(2) + ["next"]=> + object(stdClass)#3 (0) { + } + } + } + ["%s"]=> + array(2) { + ["obj"]=> + object(stdClass)#3 (0) { + } + ["inf"]=> + array(1) { + ["prev"]=> + object(stdClass)#1 (0) { + } + } + } + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49723.php b/hphp/test/zend/bad/ext-spl/bug49723.php new file mode 100644 index 000000000..3ce77672e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49723.php @@ -0,0 +1,11 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49723.php.expectf b/hphp/test/zend/bad/ext-spl/bug49723.php.expectf new file mode 100644 index 000000000..922a780ce --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49723.php.expectf @@ -0,0 +1 @@ +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49972.php b/hphp/test/zend/bad/ext-spl/bug49972.php new file mode 100644 index 000000000..ccd4fce1f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49972.php @@ -0,0 +1,6 @@ +undefined(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug49972.php.expectf b/hphp/test/zend/bad/ext-spl/bug49972.php.expectf new file mode 100644 index 000000000..3dad4aedf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug49972.php.expectf @@ -0,0 +1 @@ +HipHop Fatal error: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug50579.php b/hphp/test/zend/bad/ext-spl/bug50579.php new file mode 100644 index 000000000..9c6f31ccb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug50579.php @@ -0,0 +1,30 @@ +'test888', + 'test2'=>'what?', + 'test3'=>'test999')); + } +} +$h = new foo; +$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE); +$i->replacement = '[$0]'; +foreach ($i as $name=>$value) { + echo $name . '=>' . $value . "\n"; +} + +$i->replacement = '$1'; +foreach ($i as $name=>$value) { + echo $name . '=>' . $value . "\n"; +} + +$h = new foo; +$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE); +$i->replacement = '[$1]'; +foreach ($i as $name=>$value) { + echo $name . '=>' . $value . "\n"; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug50579.php.expectf b/hphp/test/zend/bad/ext-spl/bug50579.php.expectf new file mode 100644 index 000000000..9e829f3fe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug50579.php.expectf @@ -0,0 +1,6 @@ +test1=>[test888] +test3=>[test999] +test1=>888 +test3=>999 +test1=>[888] +test3=>[999] \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug51119.php b/hphp/test/zend/bad/ext-spl/bug51119.php new file mode 100644 index 000000000..98f07295c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug51119.php @@ -0,0 +1,25 @@ +getMessage() . "\n"; +} + +try { + $limitIterator = new LimitIterator($arrayIterator, -1); + foreach ($limitIterator as $item) { + echo $item . "\n"; + } +} catch (OutOfRangeException $e){ + print $e->getMessage() . "\n"; +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug51119.php.expectf b/hphp/test/zend/bad/ext-spl/bug51119.php.expectf new file mode 100644 index 000000000..2cada6f51 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug51119.php.expectf @@ -0,0 +1,5 @@ +a +b +c +Parameter offset must be >= 0 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug51374.php b/hphp/test/zend/bad/ext-spl/bug51374.php new file mode 100644 index 000000000..66f0846d2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug51374.php @@ -0,0 +1,12 @@ +setFileClass('Foo'); +$file = $fileInfo->openFile('r'); + +print var_dump($file->bam); // is null or UNKNOWN:0 +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug51374.php.expectf b/hphp/test/zend/bad/ext-spl/bug51374.php.expectf new file mode 100644 index 000000000..de29593a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug51374.php.expectf @@ -0,0 +1,3 @@ +array(0) { +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52238.php b/hphp/test/zend/bad/ext-spl/bug52238.php new file mode 100644 index 000000000..a8215bd3e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52238.php @@ -0,0 +1,13 @@ +bar()); + } +} +var_dump(iterator_to_array(new Foo)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52238.php.expectf b/hphp/test/zend/bad/ext-spl/bug52238.php.expectf new file mode 100644 index 000000000..a5eca669c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52238.php.expectf @@ -0,0 +1,7 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s: Foo->bar() +#1 [internal function]: Foo->getIterator() +#2 %s: iterator_to_array(Object(Foo)) +#3 {main} + thrown in hphp/test/zend/bad/ext-spl/bug52238.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52573.php b/hphp/test/zend/bad/ext-spl/bug52573.php new file mode 100644 index 000000000..4948306ff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52573.php @@ -0,0 +1,8 @@ +fscanf('fscanf(' \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52573.php.expectf b/hphp/test/zend/bad/ext-spl/bug52573.php.expectf new file mode 100644 index 000000000..466e575ef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52573.php.expectf @@ -0,0 +1,6 @@ +int(1) +string(4) "test" +array(1) { + [0]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52861.php b/hphp/test/zend/bad/ext-spl/bug52861.php new file mode 100644 index 000000000..28f807a62 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52861.php @@ -0,0 +1,6 @@ + array('bar' => array('baz' => 'boo')))); + +unset($arrayObject['foo']['bar']['baz']); +print_r($arrayObject->getArrayCopy()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug52861.php.expectf b/hphp/test/zend/bad/ext-spl/bug52861.php.expectf new file mode 100644 index 000000000..2fc48217a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug52861.php.expectf @@ -0,0 +1,11 @@ +Array +( + [foo] => Array + ( + [bar] => Array + ( + ) + + ) + +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53071.php b/hphp/test/zend/bad/ext-spl/bug53071.php new file mode 100644 index 000000000..247c53929 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53071.php @@ -0,0 +1,21 @@ +member = $myA; // myC has a referece to myA + $myB->Attach($myC); // myB attaches myC + $myA->member = $myB; // myA has myB, comleting the cycle +} +LimitedScope(); +var_dump(gc_collect_cycles()); + +echo "Done.\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53071.php.expectf b/hphp/test/zend/bad/ext-spl/bug53071.php.expectf new file mode 100644 index 000000000..7f8a20c0c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53071.php.expectf @@ -0,0 +1,2 @@ +int(5) +Done. \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53144.php b/hphp/test/zend/bad/ext-spl/bug53144.php new file mode 100644 index 000000000..59fa7637a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53144.php @@ -0,0 +1,14 @@ +removeAll($b); +var_dump(count($b)); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53144.php.expectf b/hphp/test/zend/bad/ext-spl/bug53144.php.expectf new file mode 100644 index 000000000..7edc73871 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53144.php.expectf @@ -0,0 +1,2 @@ +int(2) +int(0) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53362.php b/hphp/test/zend/bad/ext-spl/bug53362.php new file mode 100644 index 000000000..462a53141 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53362.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53362.php.expectf b/hphp/test/zend/bad/ext-spl/bug53362.php.expectf new file mode 100644 index 000000000..7aca65c67 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53362.php.expectf @@ -0,0 +1,3 @@ +NULL +NULL +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53515.php b/hphp/test/zend/bad/ext-spl/bug53515.php new file mode 100644 index 000000000..fe2fcc5ed --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53515.php @@ -0,0 +1,15 @@ + 1, 'b'=> true, 'c' => 0, 'd' => null, 'e' => false, 'f' => array()); +$o = new ArrayObject($a, ArrayObject::ARRAY_AS_PROPS); + +$a['z'] = ''; +$a[''] = ''; + +foreach ($a as $key => $value) { + echo $key . ': ' . (is_null($value) ? 'null' : @"$value") . + ' array_key_exists: ' . (array_key_exists($key, $a) ? 'true' : 'false') . + ' property_exists: ' . (property_exists($o, $key) ? 'true' : 'false'),"\n"; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug53515.php.expectf b/hphp/test/zend/bad/ext-spl/bug53515.php.expectf new file mode 100644 index 000000000..5116a4627 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug53515.php.expectf @@ -0,0 +1,8 @@ +a: 1 array_key_exists: true property_exists: true +b: 1 array_key_exists: true property_exists: true +c: 0 array_key_exists: true property_exists: true +d: null array_key_exists: true property_exists: true +e: array_key_exists: true property_exists: true +f: Array array_key_exists: true property_exists: true +z: array_key_exists: true property_exists: false +: array_key_exists: true property_exists: false \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54291.php b/hphp/test/zend/bad/ext-spl/bug54291.php new file mode 100644 index 000000000..d371ddc17 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54291.php @@ -0,0 +1,3 @@ +isFile(); \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54291.php.expectf b/hphp/test/zend/bad/ext-spl/bug54291.php.expectf new file mode 100644 index 000000000..d31873c70 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54291.php.expectf @@ -0,0 +1,5 @@ +HipHop Fatal error: %a +Stack trace: +#0 %s(%d): DirectoryIterator->__construct('?/abc') +#1 {main} + thrown in hphp/test/zend/bad/ext-spl/bug54291.php on line %d \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54292.php b/hphp/test/zend/bad/ext-spl/bug54292.php new file mode 100644 index 000000000..4996a2dde --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54292.php @@ -0,0 +1,9 @@ +getMessage()); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54292.php.expectf b/hphp/test/zend/bad/ext-spl/bug54292.php.expectf new file mode 100644 index 000000000..55f49f7c7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54292.php.expectf @@ -0,0 +1 @@ +string(74) "SplFileObject::__construct() expects parameter 2 to be string, array given" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54304.php b/hphp/test/zend/bad/ext-spl/bug54304.php new file mode 100644 index 000000000..50a16b483 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54304.php @@ -0,0 +1,17 @@ +'test999')); + } +} + +$h = new foo; +$i = new RegexIterator($h, '/^test(.*)/', RegexIterator::REPLACE); +$i->replacement = 42; +var_dump($i->replacement); +foreach ($i as $name=>$value) { + var_dump($name, $value); +} +var_dump($i->replacement); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54304.php.expectf b/hphp/test/zend/bad/ext-spl/bug54304.php.expectf new file mode 100644 index 000000000..c3555064e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54304.php.expectf @@ -0,0 +1,4 @@ +int(42) +string(5) "test3" +string(2) "42" +int(42) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54323.php b/hphp/test/zend/bad/ext-spl/bug54323.php new file mode 100644 index 000000000..9c8e87f9a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54323.php @@ -0,0 +1,15 @@ +$value) { + } + unset($ao['prop']); + var_dump($c->prop, $ao['prop']); +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54323.php.expectf b/hphp/test/zend/bad/ext-spl/bug54323.php.expectf new file mode 100644 index 000000000..a174b8398 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54323.php.expectf @@ -0,0 +1,4 @@ +HipHop Notice: %a +HipHop Notice: %a +NULL +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54384.php b/hphp/test/zend/bad/ext-spl/bug54384.php new file mode 100644 index 000000000..6de3e6d1c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54384.php @@ -0,0 +1,151 @@ +rewind(); +} ); + +echo "FilterIterator... "; +class FilterIteratorTest extends FilterIterator { + function __construct(){} + function accept(){} +} +test( function() { + $o = new FilterIteratorTest; + $o->rewind(); +} ); + +echo "RecursiveFilterIterator... "; +class RecursiveFilterIteratorTest extends RecursiveFilterIterator { + function __construct(){} + function accept(){} +} +test( function() { +$o = new RecursiveFilterIteratorTest; +$o->hasChildren(); +} ); + +echo "ParentIterator... "; +class ParentIteratorTest extends ParentIterator { + function __construct(){} +} +test ( function() { +$o = new ParentIteratorTest; +$o->accept(); +} ); + +echo "LimitIterator... "; +class LimitIteratorTest extends LimitIterator { + function __construct(){} +} +test ( function() { +$o = new LimitIteratorTest; +$o->rewind(); +} ); + +echo "CachingIterator... "; +class CachingIteratorTest extends CachingIterator { + function __construct(){} +} +test ( function() { +$o = new CachingIteratorTest; +$o->rewind(); +} ); + +echo "RecursiveCachingIterator... "; +class RecursiveCachingIteratorTest extends RecursiveCachingIterator { + function __construct(){} +} +test ( function() { +$o = new RecursiveCachingIteratorTest; +$o->rewind(); +} ); + +echo "NoRewindIterator... "; +class NoRewindIteratorTest extends NoRewindIterator { + function __construct(){} +} +test ( function() { +$o = new NoRewindIteratorTest; +$o->valid(); +} ); + +echo "RegexIterator... "; +class RegexIteratorTest extends RegexIterator { + function __construct(){} +} +test ( function() { +$o = new RegexIteratorTest; +$o->rewind(); +} ); + +echo "RecursiveRegexIterator... "; +class RecursiveRegexIteratorTest extends RecursiveRegexIterator { + function __construct(){} +} +test ( function() { +$o = new RecursiveRegexIteratorTest; +$o->hasChildren(); +} ); + +echo "GlobIterator... "; +class GlobIteratorTest extends GlobIterator { + function __construct(){} +} +test ( function() { +$o = new GlobIteratorTest; +$o->count(); +} ); + +echo "SplFileObject... "; +class SplFileObjectTest extends SplFileObject { + function __construct(){} +} +test ( function() { +$o = new SplFileObjectTest; +$o->rewind(); +} ); + +echo "SplTempFileObject... "; +class SplTempFileObjectTest extends SplTempFileObject { + function __construct(){} +} +test ( function() { +$o = new SplTempFileObjectTest; +$o->rewind(); +} ); + +echo "AppendIterator... "; +class AppendIteratorTest extends AppendIterator { + function __construct(){} +} +test ( function() { +$o = new AppendIteratorTest; +foreach ($o as $a) { +echo $a,"\n"; +} +} ); + +echo "InfiniteIterator... "; +class InfiniteIteratorTest extends InfiniteIterator { + function __construct(){} +} +test ( function() { +$o = new InfiniteIteratorTest; +foreach ($o as $a) { +echo $a,"\n"; +} +} ); diff --git a/hphp/test/zend/bad/ext-spl/bug54384.php.expectf b/hphp/test/zend/bad/ext-spl/bug54384.php.expectf new file mode 100644 index 000000000..7688cd5d3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54384.php.expectf @@ -0,0 +1,15 @@ +IteratorIterator... exception (expected) +FilterIterator... exception (expected) +RecursiveFilterIterator... exception (expected) +ParentIterator... exception (expected) +LimitIterator... exception (expected) +CachingIterator... exception (expected) +RecursiveCachingIterator... exception (expected) +NoRewindIterator... exception (expected) +RegexIterator... exception (expected) +RecursiveRegexIterator... exception (expected) +GlobIterator... exception (expected) +SplFileObject... exception (expected) +SplTempFileObject... exception (expected) +AppendIterator... exception (expected) +InfiniteIterator... exception (expected) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54970.php b/hphp/test/zend/bad/ext-spl/bug54970.php new file mode 100644 index 000000000..e3b73e4d2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54970.php @@ -0,0 +1,14 @@ +setSize(3); +$fa[2] = '!'; +var_dump($fa); +$fa->setSize(2); +var_dump($fa); +var_dump($fa->getSize()); + + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54970.php.expectf b/hphp/test/zend/bad/ext-spl/bug54970.php.expectf new file mode 100644 index 000000000..bb7df4401 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54970.php.expectf @@ -0,0 +1,15 @@ +object(SplFixedArray)#%d (3) { + [0]=> + string(5) "Hello" + [1]=> + string(5) "World" + [2]=> + string(1) "!" +} +object(SplFixedArray)#%d (2) { + [0]=> + string(5) "Hello" + [1]=> + string(5) "World" +} +int(2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54971.php b/hphp/test/zend/bad/ext-spl/bug54971.php new file mode 100644 index 000000000..2c136a6fe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54971.php @@ -0,0 +1,19 @@ + +val1 +val2 + +XML; + + +$doc = new DOMDocument(); +$doc->loadXML($source); + +$xpath = new DOMXPath($doc); +$items = $xpath->query('//node'); + +print_r(array_map('get_class', iterator_to_array($items, false))); +print_r(array_map('get_class', iterator_to_array($items, true))); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug54971.php.expectf b/hphp/test/zend/bad/ext-spl/bug54971.php.expectf new file mode 100644 index 000000000..b3094550a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug54971.php.expectf @@ -0,0 +1,10 @@ +Array +( + [0] => DOMElement + [1] => DOMElement +) +Array +( + [0] => DOMElement + [1] => DOMElement +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug60201.php b/hphp/test/zend/bad/ext-spl/bug60201.php new file mode 100644 index 000000000..14fa810fb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug60201.php @@ -0,0 +1,8 @@ +getParameters(); +var_dump($params); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug60201.php.expectf b/hphp/test/zend/bad/ext-spl/bug60201.php.expectf new file mode 100644 index 000000000..a9552b6a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug60201.php.expectf @@ -0,0 +1,18 @@ +array(3) { + [0]=> + &object(ReflectionParameter)#%d (1) { + ["name"]=> + string(9) "delimiter" + } + [1]=> + &object(ReflectionParameter)#%d (1) { + ["name"]=> + string(9) "enclosure" + } + [2]=> + &object(ReflectionParameter)#%d (1) { + ["name"]=> + string(6) "escape" + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61326.php b/hphp/test/zend/bad/ext-spl/bug61326.php new file mode 100644 index 000000000..de452b38c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61326.php @@ -0,0 +1,10 @@ +foo = 'bar'; +var_dump($aobj1 == $aobj3); \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61326.php.expectf b/hphp/test/zend/bad/ext-spl/bug61326.php.expectf new file mode 100644 index 000000000..d451c88b4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61326.php.expectf @@ -0,0 +1,3 @@ +bool(false) +bool(true) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61347.php b/hphp/test/zend/bad/ext-spl/bug61347.php new file mode 100644 index 000000000..3a26ad95d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61347.php @@ -0,0 +1,22 @@ + NULL, 37 => NULL); +var_dump(isset($a['b'])); //false + +$b = new ArrayObject($a); +var_dump(isset($b['b'])); //false +var_dump(isset($b[37])); //false +var_dump(isset($b['no_exists'])); //false +var_dump(empty($b['b'])); //true +var_dump(empty($b[37])); //true + +var_dump(array_key_exists('b', $b)); //true +var_dump($b['b']); + +$a = array('b' => '', 37 => false); +$b = new ArrayObject($a); +var_dump(isset($b['b'])); //true +var_dump(isset($b[37])); //true +var_dump(isset($b['no_exists'])); //false +var_dump(empty($b['b'])); //true +var_dump(empty($b[37])); //true + diff --git a/hphp/test/zend/bad/ext-spl/bug61347.php.expectf b/hphp/test/zend/bad/ext-spl/bug61347.php.expectf new file mode 100644 index 000000000..5f0323dbf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61347.php.expectf @@ -0,0 +1,13 @@ +bool(false) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +bool(true) +NULL +bool(true) +bool(true) +bool(false) +bool(true) +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61418.php b/hphp/test/zend/bad/ext-spl/bug61418.php new file mode 100644 index 000000000..5bc83f8c1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61418.php @@ -0,0 +1,18 @@ + $file) +{ +} +unset($regexpIterator); +unset($fileIterator); + +$dirIterator = new DirectoryIterator(__DIR__); +$regexpIterator2 = new RegexIterator($dirIterator, '#.*#'); +foreach ($dirIterator as $key => $file) +{ +} +unset($regexpIterator2); +unset($dirIterator); +?> +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61418.php.expectf b/hphp/test/zend/bad/ext-spl/bug61418.php.expectf new file mode 100644 index 000000000..17026517c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61418.php.expectf @@ -0,0 +1 @@ +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61453.php b/hphp/test/zend/bad/ext-spl/bug61453.php new file mode 100644 index 000000000..3981ae04e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61453.php @@ -0,0 +1,14 @@ + +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61453.php.expectf b/hphp/test/zend/bad/ext-spl/bug61453.php.expectf new file mode 100644 index 000000000..17026517c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61453.php.expectf @@ -0,0 +1 @@ +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61527.php b/hphp/test/zend/bad/ext-spl/bug61527.php new file mode 100644 index 000000000..7080d9e48 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61527.php @@ -0,0 +1,63 @@ +getIterator(); + +/* testing empty array, should no notice at all */ +$ai->next(); +var_dump($ai->key()); +var_dump($ai->current()); + +/* testing array changing */ +$ao2 = new ArrayObject(array(1 => 1, 2, 3, 4, 5)); +$ai2 = $ao2->getIterator(); + +$ao2->offsetUnset($ai2->key()); +$ai2->next(); + +/* now point to 2 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->key()); + +/* now point to 3 */ +$ao2->offsetUnset($ai2->key()); +var_dump($ai2->current()); + +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +/* should be at the end and no notice */ +$ai2->next(); +var_dump($ai2->key()); +var_dump($ai2->current()); + +$ai2->rewind(); +$ai2->next(); +$ai2->next(); +/* should reached the end */ +var_dump($ai2->next()); +var_dump($ai2->key()); + +/* testing RecursiveArrayIterator */ +$ao3 = new ArrayObject(array(), NULL, 'RecursiveArrayIterator'); +$ai3 = $ao3->getIterator(); + +var_dump($ai3->getChildren()); + +$ao4 = new ArrayObject(array(1, 2), NULL, 'RecursiveArrayIterator'); +$ai4 = $ao4->getIterator(); + +$ai4->next(); +$ai4->next(); +$ai4->next(); +var_dump($ai4->hasChildren()); + +$ai4->rewind(); +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->hasChildren()); + +$ao4->offsetUnset($ai4->key()); +var_dump($ai4->getChildren()); +?> +==DONE== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug61527.php.expectf b/hphp/test/zend/bad/ext-spl/bug61527.php.expectf new file mode 100644 index 000000000..32cd5f7c3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug61527.php.expectf @@ -0,0 +1,20 @@ +NULL +NULL +HipHop Notice: %a +HipHop Notice: %a +NULL +HipHop Notice: %a +NULL +int(5) +int(5) +NULL +NULL +NULL +NULL +NULL +bool(false) +HipHop Notice: %a +bool(false) +HipHop Notice: %a +NULL +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62073.php b/hphp/test/zend/bad/ext-spl/bug62073.php new file mode 100644 index 000000000..fcf0dd72c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62073.php @@ -0,0 +1,14 @@ +insert(42); +foreach ($heap as $key => $value) { + var_dump($key); + var_dump($value); + break; +} + +$heap = new SplMaxHeap(); +$heap->insert(42); +var_dump($heap->key()); +var_dump($heap->current()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62073.php.expectf b/hphp/test/zend/bad/ext-spl/bug62073.php.expectf new file mode 100644 index 000000000..2ed9e3742 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62073.php.expectf @@ -0,0 +1,4 @@ +int(0) +int(42) +int(0) +int(42) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62262.php b/hphp/test/zend/bad/ext-spl/bug62262.php new file mode 100644 index 000000000..c8e41064e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62262.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62262.php.expectf b/hphp/test/zend/bad/ext-spl/bug62262.php.expectf new file mode 100644 index 000000000..254d25151 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62262.php.expectf @@ -0,0 +1 @@ +bool(true) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62433.php b/hphp/test/zend/bad/ext-spl/bug62433.php new file mode 100644 index 000000000..438cd6f3e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62433.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62433.php.expectf b/hphp/test/zend/bad/ext-spl/bug62433.php.expectf new file mode 100644 index 000000000..6b1a0e43b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62433.php.expectf @@ -0,0 +1,4 @@ +bool(true) +bool(true) +bool(false) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62904.php b/hphp/test/zend/bad/ext-spl/bug62904.php new file mode 100644 index 000000000..2365f7744 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62904.php @@ -0,0 +1,14 @@ +getMessage()); +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62904.php.expectf b/hphp/test/zend/bad/ext-spl/bug62904.php.expectf new file mode 100644 index 000000000..df95594cb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62904.php.expectf @@ -0,0 +1 @@ +string(40) "The instance wasn't initialized properly" \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug62978.php b/hphp/test/zend/bad/ext-spl/bug62978.php new file mode 100644 index 000000000..830acaf38 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug62978.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug63680.php.expectf b/hphp/test/zend/bad/ext-spl/bug63680.php.expectf new file mode 100644 index 000000000..c4f25cd82 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug63680.php.expectf @@ -0,0 +1 @@ +int(2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64023.php b/hphp/test/zend/bad/ext-spl/bug64023.php new file mode 100644 index 000000000..262d524f7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64023.php @@ -0,0 +1,13 @@ +__toString(), $a->__toString() . '', "\n"; + +// Does not work - outputs parent::__toString() +echo $a . '', "\n"; diff --git a/hphp/test/zend/bad/ext-spl/bug64023.php.expectf b/hphp/test/zend/bad/ext-spl/bug64023.php.expectf new file mode 100644 index 000000000..4c79f04d6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64023.php.expectf @@ -0,0 +1,2 @@ +-expected- -expected- -expected- + -expected- \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64106.php b/hphp/test/zend/bad/ext-spl/bug64106.php new file mode 100644 index 000000000..f0202409a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64106.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64106.php.expectf b/hphp/test/zend/bad/ext-spl/bug64106.php.expectf new file mode 100644 index 000000000..0136aab3f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64106.php.expectf @@ -0,0 +1 @@ +HipHop Notice: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64228.php b/hphp/test/zend/bad/ext-spl/bug64228.php new file mode 100644 index 000000000..22abaf81e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64228.php @@ -0,0 +1,15 @@ + $value) { + $dirs[] = $value->getFileName(); +} + +@rmdir($empty_dir); + +sort($dirs); +print_r($dirs); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64228.php.expectf b/hphp/test/zend/bad/ext-spl/bug64228.php.expectf new file mode 100644 index 000000000..712bb4032 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64228.php.expectf @@ -0,0 +1,5 @@ +Array +( + [0] => . + [1] => .. +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64264.php b/hphp/test/zend/bad/ext-spl/bug64264.php new file mode 100644 index 000000000..d27f45621 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64264.php @@ -0,0 +1,20 @@ +setSize(2); +$myFixedArr[1] = 'bar'; +$myFixedArr->setSize(5); +$array = $myFixedArr->toArray(); +$array[2] = "ERROR"; +$array[3] = "ERROR"; +$array[4] = "ERROR"; +unset($array[4]); +$myFixedArr->setSize(2); + +print_r($myFixedArr->toArray()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/bug64264.php.expectf b/hphp/test/zend/bad/ext-spl/bug64264.php.expectf new file mode 100644 index 000000000..feb7e97cc --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/bug64264.php.expectf @@ -0,0 +1,5 @@ +Array +( + [0] => foo + [1] => bar +) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation.php b/hphp/test/zend/bad/ext-spl/class_implements_variation.php new file mode 100644 index 000000000..92212af86 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation.php @@ -0,0 +1,25 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation.php.expectf b/hphp/test/zend/bad/ext-spl/class_implements_variation.php.expectf new file mode 100644 index 000000000..18c3109f0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation.php.expectf @@ -0,0 +1,14 @@ +*** Testing class_implements() : variation *** +--- testing no interfaces --- +array(0) { +} +array(0) { +} + +--- testing autoload --- +attempting to autoload non-existent +HipHop Warning: %a +bool(false) +HipHop Warning: %a +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation1.php b/hphp/test/zend/bad/ext-spl/class_implements_variation1.php new file mode 100644 index 000000000..93dc0d56c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation1.php @@ -0,0 +1,111 @@ + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //resource + 'resource' => $res, +); + +// loop through each element of the array for pattern + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( class_implements($value, $autoload) ); +}; + +fclose($res); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation1.php.expectf b/hphp/test/zend/bad/ext-spl/class_implements_variation1.php.expectf new file mode 100644 index 000000000..4c119762c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation1.php.expectf @@ -0,0 +1,106 @@ +*** Testing class_implements() : variation *** + +--int 0-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--int 1-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--float .5-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--empty array-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--associative array-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - class_implements(): Class does not exist and could not be loaded, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - class_implements(): Class does not exist and could not be loaded, %s(%d) +bool(false) + +--instance of classWithToString-- +array(0) { +} + +--instance of classWithoutToString-- +array(0) { +} + +--undefined var-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--unset var-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) + +--resource-- +Error: 2 - class_implements(): object or string expected, %s(%d) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation2.php b/hphp/test/zend/bad/ext-spl/class_implements_variation2.php new file mode 100644 index 000000000..8e9b64aef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation2.php @@ -0,0 +1,111 @@ + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //resource + 'resource' => $res, +); + +// loop through each element of the array for pattern + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( class_implements($class, $value) ); +}; + +fclose($res); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_implements_variation2.php.expectf b/hphp/test/zend/bad/ext-spl/class_implements_variation2.php.expectf new file mode 100644 index 000000000..fa3d9f6f6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_implements_variation2.php.expectf @@ -0,0 +1,144 @@ +*** Testing class_implements() : variation *** + +--int 0-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--int 1-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--int 12345-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--int -12345-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--float 10.5-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--float -10.5-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--float 12.3456789000e10-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--float -12.3456789000e10-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--float .5-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--empty array-- +Error: 2 - class_implements() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - class_implements() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - class_implements() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - class_implements() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--uppercase NULL-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--lowercase null-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--lowercase true-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--lowercase false-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--uppercase TRUE-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--uppercase FALSE-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--empty string DQ-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--empty string SQ-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--instance of classWithToString-- +Error: 2 - class_implements() expects parameter 2 to be boolean, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - class_implements() expects parameter 2 to be boolean, object given, %s(%d) +bool(false) + +--undefined var-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--unset var-- +array(1) { + ["Traversable"]=> + string(11) "Traversable" +} + +--resource-- +Error: 2 - class_implements() expects parameter 2 to be boolean, resource given, %s(%d) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation.php b/hphp/test/zend/bad/ext-spl/class_uses_variation.php new file mode 100644 index 000000000..0aa9462ca --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation.php @@ -0,0 +1,25 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation.php.expectf b/hphp/test/zend/bad/ext-spl/class_uses_variation.php.expectf new file mode 100644 index 000000000..ab3ba12ac --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation.php.expectf @@ -0,0 +1,14 @@ +*** Testing class_uses() : variation *** +--- testing no traits --- +array(0) { +} +array(0) { +} + +--- testing autoload --- +attempting to autoload non-existent +HipHop Warning: %a +bool(false) +HipHop Warning: %a +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation1.php b/hphp/test/zend/bad/ext-spl/class_uses_variation1.php new file mode 100644 index 000000000..6c772b413 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation1.php @@ -0,0 +1,111 @@ + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //resource + 'resource' => $res, +); + +// loop through each element of the array for pattern + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( class_uses($value, $autoload) ); +}; + +fclose($res); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation1.php.expectf b/hphp/test/zend/bad/ext-spl/class_uses_variation1.php.expectf new file mode 100644 index 000000000..261a7e5a1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation1.php.expectf @@ -0,0 +1,106 @@ +*** Testing class_uses() : variation *** + +--int 0-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--int 1-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--float .5-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--empty array-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--associative array-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - class_uses(): Class does not exist and could not be loaded, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - class_uses(): Class does not exist and could not be loaded, %s(%d) +bool(false) + +--instance of classWithToString-- +array(0) { +} + +--instance of classWithoutToString-- +array(0) { +} + +--undefined var-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--unset var-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) + +--resource-- +Error: 2 - class_uses(): object or string expected, %s(%d) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation2.php b/hphp/test/zend/bad/ext-spl/class_uses_variation2.php new file mode 100644 index 000000000..6598e9962 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation2.php @@ -0,0 +1,113 @@ + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //resource + 'resource' => $res, +); + +// loop through each element of the array for pattern + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( class_uses($class, $value) ); +}; + +fclose($res); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/class_uses_variation2.php.expectf b/hphp/test/zend/bad/ext-spl/class_uses_variation2.php.expectf new file mode 100644 index 000000000..79e8d36da --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/class_uses_variation2.php.expectf @@ -0,0 +1,144 @@ +*** Testing class_uses() : variation *** + +--int 0-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--int 1-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--int 12345-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--int -12345-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--float 10.5-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--float -10.5-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--float 12.3456789000e10-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--float -12.3456789000e10-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--float .5-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--empty array-- +Error: 2 - class_uses() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - class_uses() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - class_uses() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - class_uses() expects parameter 2 to be boolean, array given, %s(%d) +bool(false) + +--uppercase NULL-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--lowercase null-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--lowercase true-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--lowercase false-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--uppercase TRUE-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--uppercase FALSE-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--empty string DQ-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--empty string SQ-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--instance of classWithToString-- +Error: 2 - class_uses() expects parameter 2 to be boolean, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - class_uses() expects parameter 2 to be boolean, object given, %s(%d) +bool(false) + +--undefined var-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--unset var-- +array(1) { + ["foo"]=> + string(3) "foo" +} + +--resource-- +Error: 2 - class_uses() expects parameter 2 to be boolean, resource given, %s(%d) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/countable_class_basic1.php b/hphp/test/zend/bad/ext-spl/countable_class_basic1.php new file mode 100644 index 000000000..905421470 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/countable_class_basic1.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/countable_class_basic1.php.expectf b/hphp/test/zend/bad/ext-spl/countable_class_basic1.php.expectf new file mode 100644 index 000000000..15aa50319 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/countable_class_basic1.php.expectf @@ -0,0 +1,22 @@ +Interface [ interface Countable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [1] { + Method [ abstract public method count ] { + + - Parameters [0] { + } + } + } +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_001.php b/hphp/test/zend/bad/ext-spl/dit_001.php new file mode 100644 index 000000000..45e822e22 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_001.php @@ -0,0 +1,8 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_001.php.expectf b/hphp/test/zend/bad/ext-spl/dit_001.php.expectf new file mode 100644 index 000000000..239cc71d5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_001.php.expectf @@ -0,0 +1,13 @@ +object(DirectoryIterator)#%d (4) { + %s"pathName"%s"SplFileInfo":private]=> + %s(%d) ".%c%s" + %s"fileName"%s"SplFileInfo":private]=> + %s(%d) "%s" + %s"glob"%s"DirectoryIterator":private]=> + bool(false) + %s"subPathName"%s"RecursiveDirectoryIterator":private]=> + %s(0) "" +} +bool(false) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_001_noglob.php b/hphp/test/zend/bad/ext-spl/dit_001_noglob.php new file mode 100644 index 000000000..45e822e22 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_001_noglob.php @@ -0,0 +1,8 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_001_noglob.php.expectf b/hphp/test/zend/bad/ext-spl/dit_001_noglob.php.expectf new file mode 100644 index 000000000..4bc208c34 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_001_noglob.php.expectf @@ -0,0 +1,11 @@ +object(DirectoryIterator)#%d (3) { + %s"pathName"%s"SplFileInfo":private]=> + %s(%d) ".%c%s" + %s"fileName"%s"SplFileInfo":private]=> + %s(%d) "%s" + %s"subPathName"%s"RecursiveDirectoryIterator":private]=> + %s(0) "" +} +bool(false) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_002.php b/hphp/test/zend/bad/ext-spl/dit_002.php new file mode 100644 index 000000000..ffd2491ba --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_002.php @@ -0,0 +1,41 @@ + 0, + 'FilesystemIterator' => 1, + 'RecursiveDirectoryIterator' => 1, + 'GlobIterator' => 1, +); + +foreach ($classes as $class => $flags) { + echo "===$class===\n"; + $ref = new ReflectionClass($class); + $obj = $ref->newInstance('glob://*'); + echo get_class($obj->current()) . "\n"; + if ($flags) + { + var_dump($obj->getFlags()); + $flags = array( + FilesystemIterator::CURRENT_AS_FILEINFO => 0, + FilesystemIterator::CURRENT_AS_SELF => 0, + FilesystemIterator::CURRENT_AS_PATHNAME => 1, + ); + foreach($flags as $flag => $isstring) { + $obj->setFlags($flag); + $obj->rewind(); + var_dump($obj->getFlags()); + if ($isstring) { + $val = $obj->current(); + if (is_string($val)) { + var_dump(true); + } else { + var_dump($val); + } + } else { + echo get_class($obj->current()) . "\n"; + } + } + } +} +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_002.php.expectf b/hphp/test/zend/bad/ext-spl/dit_002.php.expectf new file mode 100644 index 000000000..dc23c8c93 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_002.php.expectf @@ -0,0 +1,30 @@ +===DirectoryIterator=== +DirectoryIterator +===FilesystemIterator=== +SplFileInfo +int(%d) +int(0) +SplFileInfo +int(16) +FilesystemIterator +int(32) +bool(true) +===RecursiveDirectoryIterator=== +SplFileInfo +int(0) +int(0) +SplFileInfo +int(16) +RecursiveDirectoryIterator +int(32) +bool(true) +===GlobIterator=== +SplFileInfo +int(0) +int(0) +SplFileInfo +int(16) +GlobIterator +int(32) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_003.php b/hphp/test/zend/bad/ext-spl/dit_003.php new file mode 100644 index 000000000..659255a1c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_003.php @@ -0,0 +1,9 @@ + 0); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_003.php.expectf b/hphp/test/zend/bad/ext-spl/dit_003.php.expectf new file mode 100644 index 000000000..e7c042967 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_003.php.expectf @@ -0,0 +1,2 @@ +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_005.php b/hphp/test/zend/bad/ext-spl/dit_005.php new file mode 100644 index 000000000..bc959dda6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_005.php @@ -0,0 +1,13 @@ +key() == $b->key()); +$a->next(); +$a->next(); +$a->next(); +$c = clone $a; +var_dump((string)$c == (string)$a); +var_dump($a->key() == $c->key()); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_005.php.expectf b/hphp/test/zend/bad/ext-spl/dit_005.php.expectf new file mode 100644 index 000000000..9780468b1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_005.php.expectf @@ -0,0 +1,5 @@ +bool(true) +bool(true) +bool(true) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_006.php b/hphp/test/zend/bad/ext-spl/dit_006.php new file mode 100644 index 000000000..66fd3f168 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_006.php @@ -0,0 +1,39 @@ +seek(2); + +$n = 0; +while ($di->valid()) { + $n++; + $di->next(); +} + +echo "With seek(2) we get $n\n"; +$di->seek(0); + +$m = 0; +while ($di->valid()) { + $m++; + $di->next(); +} +echo "With seek(0) we get $m\n"; + +$o = 0; +$di->rewind(); +while ($di->valid()) { + $o++; + $di->next(); +} + +echo "Without seek we get $o\n"; + +$p = 0; +$di->seek($o+1); +while ($di->valid()) { + $p++; + $di->next(); +} + +var_dump($n !== $m, $m === $o, $p === 0); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dit_006.php.expectf b/hphp/test/zend/bad/ext-spl/dit_006.php.expectf new file mode 100644 index 000000000..eee4bb719 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dit_006.php.expectf @@ -0,0 +1,7 @@ +With seek(2) we get %d +With seek(0) we get %d +Without seek we get %d +bool(true) +bool(true) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_001.php b/hphp/test/zend/bad/ext-spl/dllist_001.php new file mode 100644 index 000000000..ab5d4081c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_001.php @@ -0,0 +1,47 @@ +pop(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + $dll->shift(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +// data consistency +$a = 2; +$dll->push($a); +echo $dll->pop()."\n"; + +$a = 2; +$dll->unshift($a); +echo $dll->shift()."\n"; + +// peakable +$dll->push(1); +$dll->push(2); +echo $dll->top()."\n"; +echo $dll->bottom()."\n"; +$dll->pop(); +$dll->pop(); + +// countable +$dll->push(NULL); +$dll->push(NULL); +echo count($dll)."\n"; +echo $dll->count()."\n"; +var_dump($dll->pop()); +var_dump($dll->pop()); + +// clonable +$dll->push(2); +$dll_clone = clone $dll; +$dll_clone->pop(); +echo count($dll)."\n"; +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_001.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_001.php.expectf new file mode 100644 index 000000000..5d92e16c3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_001.php.expectf @@ -0,0 +1,12 @@ +Exception: Can't pop from an empty datastructure +Exception: Can't shift from an empty datastructure +2 +2 +2 +1 +2 +2 +NULL +NULL +1 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_002.php b/hphp/test/zend/bad/ext-spl/dllist_002.php new file mode 100644 index 000000000..be04bb764 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_002.php @@ -0,0 +1,34 @@ +push(2); +$dll->push(3); +$dll->push(4); + +$dll2 = clone $dll; + +// std iterator +foreach($dll as $k=>$v) { + echo "$k=>$v\n"; + // inner iterator + foreach($dll as $k2=>$v2) { + echo "->$k2=>$v2\n"; + } +} + +echo "# deleted\n"; + +foreach($dll as $k=>$v) { + echo "$k=>$v\n"; + unset($dll); +} + +echo "# while popping\n"; + +foreach($dll2 as $k=>$v) { + echo "$k=>$v\n"; + echo "popped ".$dll2->pop()."\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_002.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_002.php.expectf new file mode 100644 index 000000000..9fbecb12b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_002.php.expectf @@ -0,0 +1,22 @@ +0=>2 +->0=>2 +->1=>3 +->2=>4 +1=>3 +->0=>2 +->1=>3 +->2=>4 +2=>4 +->0=>2 +->1=>3 +->2=>4 +# deleted +0=>2 +1=>3 +2=>4 +# while popping +0=>2 +popped 4 +1=>3 +popped 3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_003.php b/hphp/test/zend/bad/ext-spl/dllist_003.php new file mode 100644 index 000000000..dde838592 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_003.php @@ -0,0 +1,27 @@ +push(2); +$dll->push(3); +$dll->push(4); + +$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); + +foreach ($dll as $k => $v) { + echo "$k=>$v\n"; +} + +$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); +foreach ($dll as $k => $v) { + echo "$k=>$v\n"; +} + +$dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO | SplDoublyLinkedList::IT_MODE_DELETE); +var_dump($dll->count()); +foreach ($dll as $k => $v) { + echo "$k=>$v\n"; +} +var_dump($dll->count()); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_003.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_003.php.expectf new file mode 100644 index 000000000..2f1448cf5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_003.php.expectf @@ -0,0 +1,12 @@ +2=>4 +1=>3 +0=>2 +0=>2 +1=>3 +2=>4 +int(3) +0=>2 +0=>3 +0=>4 +int(0) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_004.php b/hphp/test/zend/bad/ext-spl/dllist_004.php new file mode 100644 index 000000000..198fea64c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_004.php @@ -0,0 +1,45 @@ +pop(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + $stack->shift(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +// data consistency +$a = 2; +$stack->push($a); +echo $stack->pop()."\n"; + +// peakable +$stack->push(1); +$stack->push(2); +echo $stack->top()."\n"; + +// iterable +foreach ($stack as $elem) { + echo "[$elem]\n"; +} + +// countable +$stack->push(NULL); +$stack->push(NULL); +echo count($stack)."\n"; +echo $stack->count()."\n"; +var_dump($stack->pop()); +var_dump($stack->pop()); + +// clonable +$stack->push(2); +$stack_clone = clone $stack; +$stack_clone->pop(); +echo count($stack)."\n"; +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_004.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_004.php.expectf new file mode 100644 index 000000000..7d39b8cbf --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_004.php.expectf @@ -0,0 +1,12 @@ +Exception: Can't pop from an empty datastructure +Exception: Can't shift from an empty datastructure +2 +2 +[2] +[1] +4 +4 +NULL +NULL +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_005.php b/hphp/test/zend/bad/ext-spl/dllist_005.php new file mode 100644 index 000000000..82c4c4202 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_005.php @@ -0,0 +1,45 @@ +dequeue(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + $queue->shift(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +// data consistency +$a = 2; +$queue->enqueue($a); +echo $queue->dequeue()."\n"; + +// peakable +$queue->enqueue(1); +$queue->enqueue(2); +echo $queue->top()."\n"; + +// iterable +foreach ($queue as $elem) { + echo "[$elem]\n"; +} + +// countable +$queue->enqueue(NULL); +$queue->enqueue(NULL); +echo count($queue)."\n"; +echo $queue->count()."\n"; +var_dump($queue->dequeue()); +var_dump($queue->dequeue()); + +// clonable +$queue->enqueue(2); +$queue_clone = clone $queue; +$queue_clone->dequeue(); +echo count($queue)."\n"; +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_005.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_005.php.expectf new file mode 100644 index 000000000..bff61fb61 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_005.php.expectf @@ -0,0 +1,12 @@ +Exception: Can't shift from an empty datastructure +Exception: Can't shift from an empty datastructure +2 +2 +[1] +[2] +4 +4 +int(1) +int(2) +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_006.php b/hphp/test/zend/bad/ext-spl/dllist_006.php new file mode 100644 index 000000000..5745a1a91 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_006.php @@ -0,0 +1,46 @@ +push(1); +$a->push(2); +$a->push(3); + +$a[] = "foo"; +$a[3] = 4; + +var_dump($a[0]); +var_dump($a[1]); +var_dump($a[2]); +var_dump($a[3]); + +echo "Unsetting..\n"; +var_dump($a[2]); +unset($a[2]); +var_dump($a[2]); + + +try { + var_dump($a["1"]); +} catch (OutOfRangeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +try { + var_dump($a["a"]); +} catch (OutOfRangeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +try { + var_dump($a["0"]); +} catch (OutOfRangeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +try { + var_dump($a["9"]); +} catch (OutOfRangeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_006.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_006.php.expectf new file mode 100644 index 000000000..bf750bf73 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_006.php.expectf @@ -0,0 +1,12 @@ +int(1) +int(2) +int(3) +int(4) +Unsetting.. +int(3) +int(4) +int(2) +Exception: Offset invalid or out of range +int(1) +Exception: Offset invalid or out of range +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_007.php b/hphp/test/zend/bad/ext-spl/dllist_007.php new file mode 100644 index 000000000..f94aa14b1 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_007.php @@ -0,0 +1,13 @@ +push(1); +$a->push(2); +$a->push(3); + +$a->rewind(); +while ($a->valid()) { + var_dump($a->current(), $a->next()); +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_007.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_007.php.expectf new file mode 100644 index 000000000..b774763ff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_007.php.expectf @@ -0,0 +1,7 @@ +int(1) +NULL +int(2) +NULL +int(3) +NULL +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_008.php b/hphp/test/zend/bad/ext-spl/dllist_008.php new file mode 100644 index 000000000..8954fada0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_008.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_008.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_008.php.expectf new file mode 100644 index 000000000..e14ca2b76 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_008.php.expectf @@ -0,0 +1,2 @@ +int(2) +int(-2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_010.php b/hphp/test/zend/bad/ext-spl/dllist_010.php new file mode 100644 index 000000000..c41b65d40 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_010.php @@ -0,0 +1,23 @@ +push(1); +$dll->push(2); +$dll->push(3); +$dll->push(4); + + +$dll->rewind(); +$dll->prev(); +var_dump($dll->current()); +$dll->rewind(); +var_dump($dll->current()); +$dll->next(); +var_dump($dll->current()); +$dll->next(); +$dll->next(); +var_dump($dll->current()); +$dll->prev(); +var_dump($dll->current()); + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_010.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_010.php.expectf new file mode 100644 index 000000000..2436a6894 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_010.php.expectf @@ -0,0 +1,6 @@ +NULL +int(1) +int(2) +int(4) +int(3) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_011.php b/hphp/test/zend/bad/ext-spl/dllist_011.php new file mode 100644 index 000000000..90a5df591 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_011.php @@ -0,0 +1,7 @@ +rewind(); +$dll->prev(); +var_dump($dll->current()); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_011.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_011.php.expectf new file mode 100644 index 000000000..887e68da8 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_011.php.expectf @@ -0,0 +1,2 @@ +NULL +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_012.php b/hphp/test/zend/bad/ext-spl/dllist_012.php new file mode 100644 index 000000000..e643d2408 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_012.php @@ -0,0 +1,7 @@ + +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_012.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_012.php.expectf new file mode 100644 index 000000000..95c369e79 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_012.php.expectf @@ -0,0 +1,10 @@ +object(SplDoublyLinkedList)#%d (2) { + ["flags":"SplDoublyLinkedList":private]=> + int(0) + ["dllist":"SplDoublyLinkedList":private]=> + array(1) { + [0]=> + *RECURSION* + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_memleak.php b/hphp/test/zend/bad/ext-spl/dllist_memleak.php new file mode 100644 index 000000000..3910a7895 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_memleak.php @@ -0,0 +1,17 @@ +push(1); +$dll->push(2); +$dll->push(3); +$dll->push(4); + + +$dll->rewind(); +echo $dll->current()."\n"; +$dll->next(); +$dll->next(); +echo $dll->current()."\n"; + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/dllist_memleak.php.expectf b/hphp/test/zend/bad/ext-spl/dllist_memleak.php.expectf new file mode 100644 index 000000000..822830181 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/dllist_memleak.php.expectf @@ -0,0 +1,3 @@ +1 +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_001.php b/hphp/test/zend/bad/ext-spl/fileobject_001.php new file mode 100644 index 000000000..1a40bb3dd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_001.php @@ -0,0 +1,39 @@ +key()); +var_dump($o->current()); +$o->setFlags(SplFileObject::DROP_NEW_LINE); +var_dump($o->key()); +var_dump($o->current()); +var_dump($o->key()); +$o->next(); +var_dump($o->key()); +var_dump($o->current()); +var_dump($o->key()); +$o->rewind(); +var_dump($o->key()); +var_dump($o->current()); +var_dump($o->key()); +$o->seek(4); +var_dump($o->key()); +var_dump($o->current()); +var_dump($o->key()); + +echo "===A===\n"; +foreach($o as $n => $l) +{ + var_dump($n, $l); +} + +echo "===B===\n"; +$o = new SplFileObject(dirname(__FILE__) . '/fileobject_001b.txt'); +$o->setFlags(SplFileObject::DROP_NEW_LINE); +foreach($o as $n => $l) +{ + var_dump($n, $l); +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_001.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_001.php.expectf new file mode 100644 index 000000000..81a553b15 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_001.php.expectf @@ -0,0 +1,45 @@ +int(0) +string(2) "0 +" +int(0) +string(2) "0 +" +int(0) +int(1) +string(1) "1" +int(1) +int(0) +string(1) "0" +int(0) +int(4) +string(1) "4" +int(4) +===A=== +int(0) +string(1) "0" +int(1) +string(1) "1" +int(2) +string(1) "2" +int(3) +string(1) "3" +int(4) +string(1) "4" +int(5) +string(1) "5" +int(6) +string(0) "" +===B=== +int(0) +string(1) "0" +int(1) +string(1) "1" +int(2) +string(1) "2" +int(3) +string(1) "3" +int(4) +string(1) "4" +int(5) +string(1) "5" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_002.php b/hphp/test/zend/bad/ext-spl/fileobject_002.php new file mode 100644 index 000000000..ac49b08ea --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_002.php @@ -0,0 +1,25 @@ +key()); + while(($c = $o->fgetc()) !== false) + { + var_dump($o->key(), $c, $o->eof()); + } + echo "===EOF?===\n"; + var_dump($o->eof()); + var_dump($o->key()); + var_dump($o->eof()); +} + +test('fileobject_001a.txt'); +test('fileobject_001b.txt'); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_002.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_002.php.expectf new file mode 100644 index 000000000..966bdd2cb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_002.php.expectf @@ -0,0 +1,93 @@ +===fileobject_001a.txt=== +int(0) +int(0) +string(1) "0" +bool(false) +int(1) +string(1) " +" +bool(false) +int(1) +string(1) "1" +bool(false) +int(2) +string(1) " +" +bool(false) +int(2) +string(1) "2" +bool(false) +int(3) +string(1) " +" +bool(false) +int(3) +string(1) "3" +bool(false) +int(4) +string(1) " +" +bool(false) +int(4) +string(1) "4" +bool(false) +int(5) +string(1) " +" +bool(false) +int(5) +string(1) "5" +bool(false) +int(6) +string(1) " +" +bool(false) +===EOF?=== +bool(true) +int(6) +bool(true) +===fileobject_001b.txt=== +int(0) +int(0) +string(1) "0" +bool(false) +int(1) +string(1) " +" +bool(false) +int(1) +string(1) "1" +bool(false) +int(2) +string(1) " +" +bool(false) +int(2) +string(1) "2" +bool(false) +int(3) +string(1) " +" +bool(false) +int(3) +string(1) "3" +bool(false) +int(4) +string(1) " +" +bool(false) +int(4) +string(1) "4" +bool(false) +int(5) +string(1) " +" +bool(false) +int(5) +string(1) "5" +bool(false) +===EOF?=== +bool(true) +int(5) +bool(true) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_003.php b/hphp/test/zend/bad/ext-spl/fileobject_003.php new file mode 100644 index 000000000..bbc1a5621 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_003.php @@ -0,0 +1,47 @@ +getPathname() == $c->getPathname()); + + try { + $f = new SplFileObject($name); + var_dump($name); + var_dump($f->getPathName()); + $l = substr($f->getPathName(), -1); + var_dump($l != '/' && $l != '\\' && $l == $lc); + var_dump($f->getFileName()); + $l = substr($f->getFileName(), -1); + var_dump($l != '/' && $l != '\\' && $l == $lc); + var_dump($f->getPath()); + $l = substr($f->getPath(), -1); + var_dump($l != '/' && $l != '\\' && $l == $lp); + } catch (LogicException $e) { + echo "LogicException: ".$e->getMessage()."\n"; + } + try { + $fo = $o->openFile(); + var_dump($fo->getPathName(), $fo->getFileName(), $fo->getPath()); + } catch (LogicException $e) { + echo "LogicException: ".$e->getMessage()."\n"; + } +} + +test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1)); +test(dirname(__FILE__) . '/', substr(dirname(__FILE__),-1), 'l'); +test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l'); + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_003.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_003.php.expectf new file mode 100644 index 000000000..0dcc6a883 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_003.php.expectf @@ -0,0 +1,63 @@ +===0=== +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "fileobject_001a.txt" +} +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "fileobject_001a.txt" +} +bool(false) +bool(true) +bool(true) +%s(%d) "%sfileobject_001a.txt" +string(%d) "%sfileobject_001a.txt" +bool(true) +string(19) "fileobject_001a.txt" +bool(true) +string(%d) "%stests" +bool(true) +string(%d) "%sfileobject_001a.txt" +string(19) "fileobject_001a.txt" +string(%d) "%stests" +===1=== +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "%s" +} +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "%s" +} +bool(false) +bool(true) +bool(true) +LogicException: Cannot use SplFileObject with directories +LogicException: Cannot use SplFileObject with directories +===2=== +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "%s" +} +object(SplFileInfo)#%d (2) { + ["pathName":"SplFileInfo":private]=> + string(%d) "%s" + ["fileName":"SplFileInfo":private]=> + string(%d) "%s" +} +bool(false) +bool(true) +bool(true) +LogicException: Cannot use SplFileObject with directories +LogicException: Cannot use SplFileObject with directories +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_004.php b/hphp/test/zend/bad/ext-spl/fileobject_004.php new file mode 100644 index 000000000..f29f361b0 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_004.php @@ -0,0 +1,14 @@ +getPath()); +var_dump($fo->getFilename()); +var_dump($fo->getRealPath()); +?> +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_004.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_004.php.expectf new file mode 100644 index 000000000..76a972c04 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_004.php.expectf @@ -0,0 +1,4 @@ +string(%d) "%sspl%stests" +string(19) "fileobject_004.phpt" +string(%d) "%sspl%stests%sfileobject_004.phpt" +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_005.php b/hphp/test/zend/bad/ext-spl/fileobject_005.php new file mode 100644 index 000000000..c1270c65f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_005.php @@ -0,0 +1,25 @@ +fwrite("blahlubba"); +var_dump($fo->ftruncate(4)); + +$fo->rewind(); +var_dump($fo->fgets(8)); + +$fo->rewind(); +$fo->fwrite("blahlubba"); + +// This should throw a warning and return NULL since an argument is missing +var_dump($fo->ftruncate()); + +?> +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_005.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_005.php.expectf new file mode 100644 index 000000000..09d6a5426 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_005.php.expectf @@ -0,0 +1,6 @@ +bool(true) +HipHop Warning: %a +NULL +HipHop Warning: %a +NULL +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php b/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php new file mode 100644 index 000000000..3d96e7a7f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php @@ -0,0 +1,6 @@ +isFile()); +var_dump($s->isDir()); +var_dump($s->isLink()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php.expectf new file mode 100644 index 000000000..7fef7dc93 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_checktype_basic.php.expectf @@ -0,0 +1,3 @@ +bool(true) +bool(false) +bool(false) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php b/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php new file mode 100644 index 000000000..160a41103 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php @@ -0,0 +1,5 @@ +getBasename(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php.expectf new file mode 100644 index 000000000..d912cba99 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_getbasename_basic.php.expectf @@ -0,0 +1 @@ +fileobject_getbasename_basic.php \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php b/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php new file mode 100644 index 000000000..95069e2ac --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php @@ -0,0 +1,10 @@ +seek(1); +echo $s->getCurrentLine(); +echo $s->getCurrentLine(); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php.expectf new file mode 100644 index 000000000..a25faf952 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_getcurrentline_basic.php.expectf @@ -0,0 +1,2 @@ +//line 3 +//line 4 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php new file mode 100644 index 000000000..6a39ff2fd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php @@ -0,0 +1,10 @@ +setMaxLineLen(-1); +} +catch (DomainException $e) { + echo 'DomainException thrown'; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php.expectf new file mode 100644 index 000000000..6058dacf6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error001.php.expectf @@ -0,0 +1 @@ +DomainException thrown \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php new file mode 100644 index 000000000..5ceea2264 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php @@ -0,0 +1,5 @@ +setMaxLineLen(); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error002.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php new file mode 100644 index 000000000..4df7dc4ff --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php @@ -0,0 +1,5 @@ +setMaxLineLen('string'); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php.expectf b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fileobject_setmaxlinelen_error003.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php b/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php new file mode 100644 index 000000000..157fa17f6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php @@ -0,0 +1,22 @@ +setFlags(FileSystemIterator::CURRENT_AS_SELF | + FileSystemIterator::KEY_AS_FILENAME | + FileSystemIterator::SKIP_DOTS | + FileSystemIterator::UNIX_PATHS); +printflags($it); + +$it->setFlags(-1); +printflags($it); + +function printflags($it) { + printf("%08X\n", $it->getFlags()); + printf("%08X\n", ($it->getFlags() & FileSystemIterator::CURRENT_MODE_MASK)); + printf("%08X\n", ($it->getFlags() & FileSystemIterator::KEY_MODE_MASK)); + printf("%08X\n", ($it->getFlags() & FileSystemIterator::OTHER_MODE_MASK)); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php.expectf b/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php.expectf new file mode 100644 index 000000000..15d95e279 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/filesystemiterator_flags.php.expectf @@ -0,0 +1,12 @@ +00001000 +00000000 +00000000 +00001000 +00003110 +00000010 +00000100 +00003000 +00003FF0 +000000F0 +00000F00 +00003000 \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_001.php b/hphp/test/zend/bad/ext-spl/fixedarray_001.php new file mode 100644 index 000000000..519a6c571 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_001.php @@ -0,0 +1,44 @@ +getMessage()."\n"; +} +try { + var_dump($a["asdf"]); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + unset($a[-1]); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +$a->setSize(10); + + +$a[0] = "value0"; +$a[1] = "value1"; +$a[2] = "value2"; +$a[3] = "value3"; +$ref = "value4"; +$ref2 =&$ref; +$a[4] = $ref; +$ref = "value5"; + +unset($a[1]); + +var_dump($a[0], $a[2], $a[3], $a[4]); + +// countable + +var_dump(count($a), $a->getSize(), count($a) == $a->getSize()); + +// clonable +$b = clone $a; +$a[0] = "valueNew"; +var_dump($b[0]); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_001.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_001.php.expectf new file mode 100644 index 000000000..4a2ba9940 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_001.php.expectf @@ -0,0 +1,12 @@ +Exception: Index invalid or out of range +Exception: Index invalid or out of range +Exception: Index invalid or out of range +string(6) "value0" +string(6) "value2" +string(6) "value3" +string(6) "value4" +int(10) +int(10) +bool(true) +string(6) "value0" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_002.php b/hphp/test/zend/bad/ext-spl/fixedarray_002.php new file mode 100644 index 000000000..69e8c1112 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_002.php @@ -0,0 +1,64 @@ +getMessage()."\n"; +} +try { + var_dump($a["asdf"]); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + unset($a[-1]); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +$a->setSize(10); + + +$a[0] = "value0"; +$a[1] = "value1"; +$a[2] = "value2"; +$a[3] = "value3"; +$ref = "value4"; +$ref2 =&$ref; +$a[4] = $ref; +$ref = "value5"; + +unset($a[1]); +var_dump(isset($a[1]), isset($a[2]), empty($a[1]), empty($a[2])); + +var_dump($a[0], $a[2], $a[3], $a[4]); + +// countable + +var_dump(count($a), $a->getSize(), count($a) == $a->getSize()); +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_002.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_002.php.expectf new file mode 100644 index 000000000..a7cc7cb18 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_002.php.expectf @@ -0,0 +1,32 @@ +A::offsetSet +Exception: Index invalid or out of range +A::offsetGet +Exception: Index invalid or out of range +A::offsetUnset +Exception: Index invalid or out of range +A::offsetSet +A::offsetSet +A::offsetSet +A::offsetSet +A::offsetSet +A::offsetUnset +A::offsetExists +A::offsetExists +A::offsetExists +A::offsetExists +bool(false) +bool(true) +bool(true) +bool(false) +A::offsetGet +A::offsetGet +A::offsetGet +A::offsetGet +string(6) "value0" +string(6) "value2" +string(6) "value3" +string(6) "value4" +int(2) +int(10) +bool(false) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_003.php b/hphp/test/zend/bad/ext-spl/fixedarray_003.php new file mode 100644 index 000000000..2c5612a06 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_003.php @@ -0,0 +1,47 @@ + $v) { + echo "$k => $v\n"; +} +echo "==Child instance==\n"; +$a = new A(5); +$a[0] = "a"; +$a[1] = "c"; +$a[2] = "d"; +$a[3] = "e"; +$a[4] = "f"; +foreach ($a as $k => $v) { + echo "$k => $v\n"; +} +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_003.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_003.php.expectf new file mode 100644 index 000000000..1385537a3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_003.php.expectf @@ -0,0 +1,35 @@ +==Direct instance== +0 => a +1 => c +2 => d +3 => e +4 => f +==Child instance== +A::rewind +A::valid +A::current +A::key +0 => a +A::next +A::valid +A::current +A::key +1 => c +A::next +A::valid +A::current +A::key +2 => d +A::next +A::valid +A::current +A::key +3 => e +A::next +A::valid +A::current +A::key +4 => f +A::next +A::valid +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_004.php b/hphp/test/zend/bad/ext-spl/fixedarray_004.php new file mode 100644 index 000000000..3258975eb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_004.php @@ -0,0 +1,12 @@ +getMessage()); +} + +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_004.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_004.php.expectf new file mode 100644 index 000000000..3960d4d73 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_004.php.expectf @@ -0,0 +1,2 @@ +string(29) "Index invalid or out of range" +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_005.php b/hphp/test/zend/bad/ext-spl/fixedarray_005.php new file mode 100644 index 000000000..fcc0b7185 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_005.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_005.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_005.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_005.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_006.php b/hphp/test/zend/bad/ext-spl/fixedarray_006.php new file mode 100644 index 000000000..754d28bef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_006.php @@ -0,0 +1,16 @@ +getMessage(), "\n"; +} + +print "ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_006.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_006.php.expectf new file mode 100644 index 000000000..537e4178d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_006.php.expectf @@ -0,0 +1,2 @@ +Index invalid or out of range +ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_007.php b/hphp/test/zend/bad/ext-spl/fixedarray_007.php new file mode 100644 index 000000000..c7402b8a3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_007.php @@ -0,0 +1,20 @@ +getMessage(), "\n"; +} + +foreach ($a as $c) { + if ($c) { + echo $c->getSize(), "\n"; + } +} + +print "ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_007.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_007.php.expectf new file mode 100644 index 000000000..9671fc167 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_007.php.expectf @@ -0,0 +1,2 @@ +10 +ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_008.php b/hphp/test/zend/bad/ext-spl/fixedarray_008.php new file mode 100644 index 000000000..abb846552 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_008.php @@ -0,0 +1,22 @@ +getSize()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_008.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_008.php.expectf new file mode 100644 index 000000000..fbc581e77 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_008.php.expectf @@ -0,0 +1,4 @@ +int(3) +int(2) +int(3) +int(3) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_009.php b/hphp/test/zend/bad/ext-spl/fixedarray_009.php new file mode 100644 index 000000000..5442f6c1e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_009.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_009.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_009.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_009.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_010.php b/hphp/test/zend/bad/ext-spl/fixedarray_010.php new file mode 100644 index 000000000..2244e4390 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_010.php @@ -0,0 +1,40 @@ +setSize(2); +$a->setSize(3); +$a->setSize(0); + +$a = new SplFixedArray(0); +$a->setSize(0); +var_dump($a->getSize()); + +$a = new SplFixedArray(10); +$a->setSize(10); +var_dump($a->getSize()); + +$a = new SplFixedArray(1); +$a->setSize(5); +var_dump($a->getSize()); + +$a = new SplFixedArray(20); +$a->setSize(3); +var_dump($a->getSize()); + +$a = new SplFixedArray(3); + +$a[0] = "test"; +$a[1] = array(1,2,"blah"); +$a[2] = 1; +$a[0] = "test"; + +$a->setSize(0); +var_dump($a->getSize()); + +print "ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_010.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_010.php.expectf new file mode 100644 index 000000000..0556daeba --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_010.php.expectf @@ -0,0 +1,6 @@ +int(0) +int(10) +int(5) +int(3) +int(0) +ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_011.php b/hphp/test/zend/bad/ext-spl/fixedarray_011.php new file mode 100644 index 000000000..44ba03361 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_011.php @@ -0,0 +1,9 @@ +setSize(NULL); + +print "ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_011.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_011.php.expectf new file mode 100644 index 000000000..b5754e203 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_011.php.expectf @@ -0,0 +1 @@ +ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_012.php b/hphp/test/zend/bad/ext-spl/fixedarray_012.php new file mode 100644 index 000000000..56a28ab25 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_012.php @@ -0,0 +1,13 @@ +getMessage(), "\n"; +} + +print "ok\n"; + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_012.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_012.php.expectf new file mode 100644 index 000000000..537e4178d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_012.php.expectf @@ -0,0 +1,2 @@ +Index invalid or out of range +ok \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_013.php b/hphp/test/zend/bad/ext-spl/fixedarray_013.php new file mode 100644 index 000000000..6da965155 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_013.php @@ -0,0 +1,16 @@ +getMessage(), "\n"; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_013.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_013.php.expectf new file mode 100644 index 000000000..4067f6ba2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_013.php.expectf @@ -0,0 +1 @@ +Index invalid or out of range \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_014.php b/hphp/test/zend/bad/ext-spl/fixedarray_014.php new file mode 100644 index 000000000..c8ee092ef --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_014.php @@ -0,0 +1,10 @@ +getMessage(); +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_014.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_014.php.expectf new file mode 100644 index 000000000..4067f6ba2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_014.php.expectf @@ -0,0 +1 @@ +Index invalid or out of range \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_015.php b/hphp/test/zend/bad/ext-spl/fixedarray_015.php new file mode 100644 index 000000000..220bb6672 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_015.php @@ -0,0 +1,38 @@ +getMessage(), "\n"; +} +try { + $a[1] = 1; +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(count($a[1])); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump($a->getSize()); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + foreach ($a as $v) { + } +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump($a->setSize(10)); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} + +echo "Done\n"; +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_015.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_015.php.expectf new file mode 100644 index 000000000..bf6a809d2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_015.php.expectf @@ -0,0 +1,7 @@ +HipHop Warning: %a +Index invalid or out of range +Index invalid or out of range +Index invalid or out of range +int(0) +bool(true) +Done \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_016.php b/hphp/test/zend/bad/ext-spl/fixedarray_016.php new file mode 100644 index 000000000..ff28e5fd2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_016.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_016.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_016.php.expectf new file mode 100644 index 000000000..4fb9e437e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_016.php.expectf @@ -0,0 +1,8 @@ +bool(false) +bool(true) +object(SplFixedArray)#%d (2) { + [0]=> + string(3) "foo" + [1]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_017.php b/hphp/test/zend/bad/ext-spl/fixedarray_017.php new file mode 100644 index 000000000..ff28e5fd2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_017.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_017.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_017.php.expectf new file mode 100644 index 000000000..4fb9e437e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_017.php.expectf @@ -0,0 +1,8 @@ +bool(false) +bool(true) +object(SplFixedArray)#%d (2) { + [0]=> + string(3) "foo" + [1]=> + NULL +} \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_018.php b/hphp/test/zend/bad/ext-spl/fixedarray_018.php new file mode 100644 index 000000000..2c694467c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_018.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_018.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_018.php.expectf new file mode 100644 index 000000000..e14ca2b76 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_018.php.expectf @@ -0,0 +1,2 @@ +int(2) +int(-2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_019.php b/hphp/test/zend/bad/ext-spl/fixedarray_019.php new file mode 100644 index 000000000..084ffdc21 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_019.php @@ -0,0 +1,30 @@ +$v) { + echo "$k=>"; + var_dump($v); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_019.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_019.php.expectf new file mode 100644 index 000000000..7ddaced1a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_019.php.expectf @@ -0,0 +1,17 @@ +rewind +valid +current +key +0=>NULL +next +valid +current +key +1=>NULL +next +valid +current +key +2=>NULL +next +valid \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_020.php b/hphp/test/zend/bad/ext-spl/fixedarray_020.php new file mode 100644 index 000000000..5dbbe42f3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_020.php @@ -0,0 +1,23 @@ +'foo', 2=>'bar', 0=>'gee'); +$fa = SplFixedArray::fromArray($a, false); +var_dump(count($fa), $fa->toArray() === array_values($a)); + +$fa = SplFixedArray::fromArray($a, true); +var_dump(count($fa), $fa->toArray() === $a, $fa->toArray() === (array)$fa); + +try { + echo "From Array with string keys, no preserve\n"; + SplFixedArray::fromArray(array("foo"=>"bar"), false); + echo "No exception\n"; +} catch (Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + echo "From Array with string keys, preserve\n"; + SplFixedArray::fromArray(array("foo"=>"bar"), true); + echo "No exception\n"; +} catch (Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_020.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_020.php.expectf new file mode 100644 index 000000000..844487b6d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_020.php.expectf @@ -0,0 +1,9 @@ +int(3) +bool(true) +int(3) +bool(false) +bool(true) +From Array with string keys, no preserve +No exception +From Array with string keys, preserve +Exception: array must contain only positive integer keys \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_021.php b/hphp/test/zend/bad/ext-spl/fixedarray_021.php new file mode 100644 index 000000000..b30da1b91 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_021.php @@ -0,0 +1,60 @@ +count()); + +/* negative init value */ +try { + $b = new SplFixedArray(-10); +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +/* resize and negative value */ +$b = new SplFixedArray(); +try { + $b->setSize(-5); +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +/* calling __construct() twice */ +$c = new SplFixedArray(0); +var_dump($c->__construct()); + +/* fromArray() from empty array */ +$d = new SplFixedArray(); +$d->fromArray(array()); + +var_dump(count($a)); +var_dump($a->count()); +var_dump($a); + +/* foreach by ref */ +$e = new SplFixedArray(10); +$e[0] = 1; +$e[1] = 5; +$e[2] = 10; + +try { + foreach ($e as $k=>&$v) { + var_dump($v); + } +} catch (Exception $e) { + var_dump($e->getMessage()); +} + +//non-long indexes +$a = new SplFixedArray(4); +$a["2"] = "foo"; +$a["1"] = "foo"; +$a["3"] = "0"; + +var_dump(isset($a["0"], $a[-1]), $a["1"]); +var_dump(empty($a["3"])); + +?> +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/fixedarray_021.php.expectf b/hphp/test/zend/bad/ext-spl/fixedarray_021.php.expectf new file mode 100644 index 000000000..2db974b69 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/fixedarray_021.php.expectf @@ -0,0 +1,14 @@ +int(0) +int(0) +string(35) "array size cannot be less than zero" +string(35) "array size cannot be less than zero" +NULL +int(0) +int(0) +object(SplFixedArray)#%d (0) { +} +string(52) "An iterator cannot be used with foreach by reference" +bool(false) +string(3) "foo" +bool(true) +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_001.php b/hphp/test/zend/bad/ext-spl/heap_001.php new file mode 100644 index 000000000..7b0ed1844 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_001.php @@ -0,0 +1,37 @@ +extract(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + + +$h->insert(1); +$h->insert(2); +$h->insert(3); +$h->insert(3); +$h->insert(3); + +echo $h->count()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->count()."\n"; + +echo "--\n"; + +$b = 4; +$h->insert($b); +$b = 5; + +$h2 = clone $h; +echo $h->extract()."\n"; +echo $h2->extract()."\n"; +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_001.php.expectf b/hphp/test/zend/bad/ext-spl/heap_001.php.expectf new file mode 100644 index 000000000..3a6e1e739 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_001.php.expectf @@ -0,0 +1,12 @@ +Exception: Can't extract from an empty heap +5 +3 +3 +3 +2 +1 +0 +-- +4 +4 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_002.php b/hphp/test/zend/bad/ext-spl/heap_002.php new file mode 100644 index 000000000..fa62d71d7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_002.php @@ -0,0 +1,35 @@ +extract(); +} catch (RuntimeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + + +$h->insert(1); +$h->insert(2); +$h->insert(3); +$h->insert(3); +$h->insert(3); + +echo $h->count()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->extract()."\n"; +echo $h->count()."\n"; + +echo "--\n"; + +$b = 4; +$h->insert($b); +$b = 5; + +echo $h->extract()."\n"; +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_002.php.expectf b/hphp/test/zend/bad/ext-spl/heap_002.php.expectf new file mode 100644 index 000000000..b8e3f220b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_002.php.expectf @@ -0,0 +1,11 @@ +Exception: Can't extract from an empty heap +5 +1 +2 +3 +3 +3 +0 +-- +4 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_003.php b/hphp/test/zend/bad/ext-spl/heap_003.php new file mode 100644 index 000000000..ab5118600 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_003.php @@ -0,0 +1,28 @@ + $b) { + $result = 1; + } else if ($a < $b) { + $result = -1; + } else { + $result = 0; + } + return $result; + } +} + +$h = new myHeap; + +$in = range(0,10); +shuffle($in); +foreach ($in as $i) { + $h->insert($i); +} + +foreach ($h as $out) { + echo $out."\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_003.php.expectf b/hphp/test/zend/bad/ext-spl/heap_003.php.expectf new file mode 100644 index 000000000..adcd03081 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_003.php.expectf @@ -0,0 +1,12 @@ +10 +9 +8 +7 +6 +5 +4 +3 +2 +1 +0 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_004.php b/hphp/test/zend/bad/ext-spl/heap_004.php new file mode 100644 index 000000000..b897eae35 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_004.php @@ -0,0 +1,54 @@ +insert(1); + echo "inserted 1\n"; + $h->insert(2); + echo "inserted 2\n"; + $h->insert(3); + echo "inserted 3\n"; +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +try { + $h->insert(4); + echo "inserted 4\n"; +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +try { + var_dump($h->extract()); +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + var_dump($h->extract()); +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} + +echo "Recovering..\n"; +$h->recoverFromCorruption(); + +try { + var_dump($h->extract()); +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +try { + var_dump($h->extract()); +} catch(Exception $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_004.php.expectf b/hphp/test/zend/bad/ext-spl/heap_004.php.expectf new file mode 100644 index 000000000..57b714bc4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_004.php.expectf @@ -0,0 +1,9 @@ +inserted 1 +Exception: foo +Exception: Heap is corrupted, heap properties are no longer ensured. +Exception: Heap is corrupted, heap properties are no longer ensured. +Exception: Heap is corrupted, heap properties are no longer ensured. +Recovering.. +int(1) +int(2) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_005.php b/hphp/test/zend/bad/ext-spl/heap_005.php new file mode 100644 index 000000000..2aeaa2c15 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_005.php @@ -0,0 +1,16 @@ +insert($i); +} + +foreach ($h as $k => $o) { + echo "$k => $o\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_005.php.expectf b/hphp/test/zend/bad/ext-spl/heap_005.php.expectf new file mode 100644 index 000000000..736a71af2 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_005.php.expectf @@ -0,0 +1,101 @@ +99 => 1 +98 => 2 +97 => 3 +96 => 4 +95 => 5 +94 => 6 +93 => 7 +92 => 8 +91 => 9 +90 => 10 +89 => 11 +88 => 12 +87 => 13 +86 => 14 +85 => 15 +84 => 16 +83 => 17 +82 => 18 +81 => 19 +80 => 20 +79 => 21 +78 => 22 +77 => 23 +76 => 24 +75 => 25 +74 => 26 +73 => 27 +72 => 28 +71 => 29 +70 => 30 +69 => 31 +68 => 32 +67 => 33 +66 => 34 +65 => 35 +64 => 36 +63 => 37 +62 => 38 +61 => 39 +60 => 40 +59 => 41 +58 => 42 +57 => 43 +56 => 44 +55 => 45 +54 => 46 +53 => 47 +52 => 48 +51 => 49 +50 => 50 +49 => 51 +48 => 52 +47 => 53 +46 => 54 +45 => 55 +44 => 56 +43 => 57 +42 => 58 +41 => 59 +40 => 60 +39 => 61 +38 => 62 +37 => 63 +36 => 64 +35 => 65 +34 => 66 +33 => 67 +32 => 68 +31 => 69 +30 => 70 +29 => 71 +28 => 72 +27 => 73 +26 => 74 +25 => 75 +24 => 76 +23 => 77 +22 => 78 +21 => 79 +20 => 80 +19 => 81 +18 => 82 +17 => 83 +16 => 84 +15 => 85 +14 => 86 +13 => 87 +12 => 88 +11 => 89 +10 => 90 +9 => 91 +8 => 92 +7 => 93 +6 => 94 +5 => 95 +4 => 96 +3 => 97 +2 => 98 +1 => 99 +0 => 100 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_006.php b/hphp/test/zend/bad/ext-spl/heap_006.php new file mode 100644 index 000000000..8e29cd26a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_006.php @@ -0,0 +1,16 @@ +insert($i); +} + +foreach ($h as $k => $o) { + echo "$k => $o\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_006.php.expectf b/hphp/test/zend/bad/ext-spl/heap_006.php.expectf new file mode 100644 index 000000000..0028306ed --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_006.php.expectf @@ -0,0 +1,101 @@ +99 => 100 +98 => 99 +97 => 98 +96 => 97 +95 => 96 +94 => 95 +93 => 94 +92 => 93 +91 => 92 +90 => 91 +89 => 90 +88 => 89 +87 => 88 +86 => 87 +85 => 86 +84 => 85 +83 => 84 +82 => 83 +81 => 82 +80 => 81 +79 => 80 +78 => 79 +77 => 78 +76 => 77 +75 => 76 +74 => 75 +73 => 74 +72 => 73 +71 => 72 +70 => 71 +69 => 70 +68 => 69 +67 => 68 +66 => 67 +65 => 66 +64 => 65 +63 => 64 +62 => 63 +61 => 62 +60 => 61 +59 => 60 +58 => 59 +57 => 58 +56 => 57 +55 => 56 +54 => 55 +53 => 54 +52 => 53 +51 => 52 +50 => 51 +49 => 50 +48 => 49 +47 => 48 +46 => 47 +45 => 46 +44 => 45 +43 => 44 +42 => 43 +41 => 42 +40 => 41 +39 => 40 +38 => 39 +37 => 38 +36 => 37 +35 => 36 +34 => 35 +33 => 34 +32 => 33 +31 => 32 +30 => 31 +29 => 30 +28 => 29 +27 => 28 +26 => 27 +25 => 26 +24 => 25 +23 => 24 +22 => 23 +21 => 22 +20 => 21 +19 => 20 +18 => 19 +17 => 18 +16 => 17 +15 => 16 +14 => 15 +13 => 14 +12 => 13 +11 => 12 +10 => 11 +9 => 10 +8 => 9 +7 => 8 +6 => 7 +5 => 6 +4 => 5 +3 => 4 +2 => 3 +1 => 2 +0 => 1 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_007.php b/hphp/test/zend/bad/ext-spl/heap_007.php new file mode 100644 index 000000000..e3cc5160b --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_007.php @@ -0,0 +1,21 @@ +insert(1); +$h->insert(5); +$h->insert(0); +$h->insert(4); + +$h->rewind(); +echo "count(\$h) = ".count($h)."\n"; +echo "\$h->count() = ".$h->count()."\n"; + +while ($h->valid()) { + $k = $h->key(); + $v = $h->current(); + echo "$k=>$v\n"; + $h->next(); +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_007.php.expectf b/hphp/test/zend/bad/ext-spl/heap_007.php.expectf new file mode 100644 index 000000000..bcd87bc82 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_007.php.expectf @@ -0,0 +1,7 @@ +count($h) = 4 +$h->count() = 4 +3=>5 +2=>4 +1=>1 +0=>0 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_008.php b/hphp/test/zend/bad/ext-spl/heap_008.php new file mode 100644 index 000000000..1ebe09978 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_008.php @@ -0,0 +1,12 @@ +insert(1); +$h->insert(5); +$h->insert(0); +$h->insert(4); + +var_dump($h); +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_008.php.expectf b/hphp/test/zend/bad/ext-spl/heap_008.php.expectf new file mode 100644 index 000000000..f321093fd --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_008.php.expectf @@ -0,0 +1,18 @@ +object(SplMaxHeap)#1 (3) { + ["flags":"SplHeap":private]=> + int(0) + ["isCorrupted":"SplHeap":private]=> + bool(false) + ["heap":"SplHeap":private]=> + array(4) { + [0]=> + int(5) + [1]=> + int(4) + [2]=> + int(0) + [3]=> + int(1) + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_009.php b/hphp/test/zend/bad/ext-spl/heap_009.php new file mode 100644 index 000000000..86937b20f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_009.php @@ -0,0 +1,42 @@ +getMessage(),"\n"; + } +} + +// 1. SplMinHeap emtpy +$heap = new SplMinHeap; +testForException( $heap ); + +// 2. SplMinHeap non-emtpy +$heap = new SplMinHeap; +$heap->insert( 1 ); +testForException( $heap ); + +// 3. SplMaxHeap emtpy +$heap = new SplMaxHeap; +testForException( $heap ); + +// 4. SplMaxHeap non-emtpy +$heap = new SplMaxHeap; +$heap->insert( 1 ); +testForException( $heap ); + +// 5. SplPriorityQueue empty +$heap = new SplPriorityQueue; +testForException( $heap ); + +// 6. SplPriorityQueue non-empty +$heap = new SplPriorityQueue; +$heap->insert( 1, 2 ); +testForException( $heap ); + +?> +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_009.php.expectf b/hphp/test/zend/bad/ext-spl/heap_009.php.expectf new file mode 100644 index 000000000..f2ab83d69 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_009.php.expectf @@ -0,0 +1,7 @@ +An iterator cannot be used with foreach by reference +An iterator cannot be used with foreach by reference +An iterator cannot be used with foreach by reference +An iterator cannot be used with foreach by reference +An iterator cannot be used with foreach by reference +An iterator cannot be used with foreach by reference +==DONE== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_010.php b/hphp/test/zend/bad/ext-spl/heap_010.php new file mode 100644 index 000000000..e591e57c3 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_010.php @@ -0,0 +1,15 @@ +insert(1); +$obj->insert(2); +var_dump(count($obj)); +class SplMaxHeap2 extends SplMaxHeap{ + public function count() { + return -parent::count(); + } +} +$obj = new SplMaxHeap2(); +$obj->insert(1); +$obj->insert(2); +var_dump(count($obj)); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_010.php.expectf b/hphp/test/zend/bad/ext-spl/heap_010.php.expectf new file mode 100644 index 000000000..e14ca2b76 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_010.php.expectf @@ -0,0 +1,2 @@ +int(2) +int(-2) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_011.php b/hphp/test/zend/bad/ext-spl/heap_011.php new file mode 100644 index 000000000..c7455a384 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_011.php @@ -0,0 +1,25 @@ +insert(1); +$h->insert(6); +$h->insert(5); +$h->insert(2); +var_dump($h->top()); + +class SplMaxHeap2 extends SplMaxHeap { + public function compare($a, $b) { + return -parent::compare($a,$b); + } +} +$h = new SplMaxHeap2(); +$h->insert(1); +$h->insert(6); +$h->insert(5); +$h->insert(2); +var_dump($h->top()); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_011.php.expectf b/hphp/test/zend/bad/ext-spl/heap_011.php.expectf new file mode 100644 index 000000000..68ae6ab0f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_011.php.expectf @@ -0,0 +1,2 @@ +int(6) +int(1) \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_012.php b/hphp/test/zend/bad/ext-spl/heap_012.php new file mode 100644 index 000000000..113b438f5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_012.php @@ -0,0 +1,6 @@ +insert($a); +var_dump($a) +?> +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_012.php.expectf b/hphp/test/zend/bad/ext-spl/heap_012.php.expectf new file mode 100644 index 000000000..a2fbb5efe --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_012.php.expectf @@ -0,0 +1,12 @@ +object(SplMaxHeap)#%d (3) { + ["flags":"SplHeap":private]=> + int(0) + ["isCorrupted":"SplHeap":private]=> + bool(false) + ["heap":"SplHeap":private]=> + array(1) { + [0]=> + *RECURSION* + } +} +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_corruption.php b/hphp/test/zend/bad/ext-spl/heap_corruption.php new file mode 100644 index 000000000..245981c33 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_corruption.php @@ -0,0 +1,53 @@ +allow_compare == true) + { + if ($v1 > $v2) + { + return 1; + } + else if ($v1 < $v2) + { + return -1; + } + else + { + return 0; + } + } + else + { + throw new Exception('Compare exception'); + } + } +} + +$heap = new myHeap(); +$heap->insert(1); +$heap->insert(2); +$heap->insert(3); +$heap->insert(4); + +$heap->allow_compare = false; + +try { + $heap->extract(); +} +catch (Exception $e) { + echo "Compare Exception: " . $e->getMessage() . PHP_EOL; +} + +try { + $heap->top(); +} +catch (Exception $e) { + echo "Corruption Exception: " . $e->getMessage() . PHP_EOL; +} + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_corruption.php.expectf b/hphp/test/zend/bad/ext-spl/heap_corruption.php.expectf new file mode 100644 index 000000000..fbc23ccc7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_corruption.php.expectf @@ -0,0 +1,2 @@ +Compare Exception: Compare exception +Corruption Exception: Heap is corrupted, heap properties are no longer ensured. \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php b/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php new file mode 100644 index 000000000..8a7313696 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php @@ -0,0 +1,14 @@ +current()); + +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php.expectf b/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php.expectf new file mode 100644 index 000000000..fe3a0735d --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_current_variation_001.php.expectf @@ -0,0 +1 @@ +NULL \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php b/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php new file mode 100644 index 000000000..6e7ead541 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php @@ -0,0 +1,11 @@ +isEmpty(1); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php.expectf b/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_isempty_variation_001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_it_current_empty.php b/hphp/test/zend/bad/ext-spl/heap_it_current_empty.php new file mode 100644 index 000000000..c757c5303 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_it_current_empty.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_it_current_empty.php.expectf b/hphp/test/zend/bad/ext-spl/heap_it_current_empty.php.expectf new file mode 100644 index 000000000..e69de29bb diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php b/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php new file mode 100644 index 000000000..c96bf6b6a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php @@ -0,0 +1,6 @@ +insert(5); +// top doesn't take any args, lets see what happens if we give it one +$h->top('bogus'); +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php.expectf b/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php.expectf new file mode 100644 index 000000000..cfb6a8593 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_001.php.expectf @@ -0,0 +1 @@ +HipHop Warning: %a \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php b/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php new file mode 100644 index 000000000..d4d6e2a8f --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php @@ -0,0 +1,23 @@ +insert(4); +try { + $h->insert(5); +} catch (Exception $e) {} + +// call top, should fail with corrupted heap +try { + $h->top(); +} catch (Exception $e) { + echo $e->getMessage(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php.expectf b/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php.expectf new file mode 100644 index 000000000..c2812b796 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_002.php.expectf @@ -0,0 +1 @@ +Heap is corrupted, heap properties are no longer ensured. \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php b/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php new file mode 100644 index 000000000..34d9a9415 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php @@ -0,0 +1,8 @@ +top(); +} catch (Exception $e) { + echo $e->getMessage(); +} +?> \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php.expectf b/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php.expectf new file mode 100644 index 000000000..627c48440 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/heap_top_variation_003.php.expectf @@ -0,0 +1 @@ +Can't peek at an empty heap \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_001.php b/hphp/test/zend/bad/ext-spl/iterator_001.php new file mode 100644 index 000000000..0fcb446ba --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_001.php @@ -0,0 +1,89 @@ +a = $a; + } + + public function rewind() + { + echo __METHOD__ . "\n"; + $this->i = 0; + } + + public function valid() + { + $ret = $this->i < count($this->a); + echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; + return $ret; + } + + public function key() + { + echo __METHOD__ . "\n"; + return $this->i; + } + + public function current() + { + echo __METHOD__ . "\n"; + return $this->a[$this->i]; + } + + public function next() + { + echo __METHOD__ . "\n"; + $this->i++; + } + + public function greaterThan($comp) + { + echo get_class($this) . '::' . __FUNCTION__ . '(' . $comp . ")\n"; + return $this->current() > $comp; + } +} + +class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator +{ + public function seek($index) + { + if ($index < count($this->a)) { + $this->i = $index; + } + echo __METHOD__ . '(' . $index . ")\n"; + } +} + +$a = array(1, 2, 3, 4, 5); +$it = new LimitIterator(new NumericArrayIterator($a), 1, 3); +foreach ($it as $v) +{ + print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; +} + +echo "===SEEKABLE===\n"; +$a = array(1, 2, 3, 4, 5); +$it = new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3); +foreach($it as $v) +{ + print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; +} + +echo "===STACKED===\n"; +echo "Shows '2 is greater than 2' because the test is actually done with the current value which is 3.\n"; +$a = array(1, 2, 3, 4, 5); +$it = new CachingIterator(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3)); +foreach($it as $v) +{ + print $v . ' is ' . ($it->greaterThan(2) ? 'greater than 2' : 'less than or equal 2') . "\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_001.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_001.php.expectf new file mode 100644 index 000000000..3e9d3ba82 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_001.php.expectf @@ -0,0 +1,78 @@ +NumericArrayIterator::__construct +NumericArrayIterator::rewind +NumericArrayIterator::valid(true) +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +NumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +2 is less than or equal 2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +NumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +3 is greater than 2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +NumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +4 is greater than 2 +NumericArrayIterator::next +===SEEKABLE=== +NumericArrayIterator::__construct +NumericArrayIterator::rewind +SeekableNumericArrayIterator::seek(1) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +2 is less than or equal 2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +3 is greater than 2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +4 is greater than 2 +NumericArrayIterator::next +===STACKED=== +Shows '2 is greater than 2' because the test is actually done with the current value which is 3. +NumericArrayIterator::__construct +NumericArrayIterator::rewind +SeekableNumericArrayIterator::seek(1) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +2 is greater than 2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +3 is greater than 2 +NumericArrayIterator::next +SeekableNumericArrayIterator::greaterThan(2) +NumericArrayIterator::current +4 is greater than 2 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_002.php b/hphp/test/zend/bad/ext-spl/iterator_002.php new file mode 100644 index 000000000..ace19f554 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_002.php @@ -0,0 +1,44 @@ +current()); + } + + function getChildren() + { + return new RecursiceArrayIterator($this->current()); + } +} + +class CrashIterator extends FilterIterator implements RecursiveIterator +{ + function accept() + { + return true; + } + + function hasChildren() + { + return $this->getInnerIterator()->hasChildren(); + } + + function getChildren() + { + return new RecursiceArrayIterator($this->getInnerIterator()->current()); + } +} + +$array = array(1, 2 => array(21, 22 => array(221, 222), 23 => array(231)), 3); + +$dir = new RecursiveIteratorIterator(new CrashIterator(new RecursiceArrayIterator($array)), RecursiveIteratorIterator::LEAVES_ONLY); + +foreach ($dir as $file) { + print "$file\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_002.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_002.php.expectf new file mode 100644 index 000000000..a844ea643 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_002.php.expectf @@ -0,0 +1,7 @@ +1 +21 +221 +222 +231 +3 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_003.php b/hphp/test/zend/bad/ext-spl/iterator_003.php new file mode 100644 index 000000000..be636467e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_003.php @@ -0,0 +1,88 @@ +id = $id; + $this->name = $name; + } + + public function __toString() + { + return $this->id . ', ' . $this->name; + } + + public function getId() + { + return $this->id; + } +} + +class StudentIdFilter extends FilterIterator +{ + private $id; + + public function __construct(ArrayObject $students, Student $other) + { + FilterIterator::__construct($students->getIterator()); + $this->id = $other->getId(); + } + + public function accept() + { + echo "ACCEPT ".$this->current()->getId()." == ".$this->id."\n"; + return $this->current()->getId() == $this->id; + } +} + +class StudentList implements IteratorAggregate +{ + private $students; + + public function __construct() + { + $this->students = new ArrayObject(array()); + } + + public function add(Student $student) + { + if (!$this->contains($student)) { + $this->students[] = $student; + } + } + + public function contains(Student $student) + { + foreach ($this->students as $s) + { + if ($s->getId() == $student->getId()) { + return true; + } + } + return false; + } + + public function getIterator() { + return new CachingIterator($this->students->getIterator(), true); + } +} + +$students = new StudentList(); +$students->add(new Student('01234123', 'Joe')); +$students->add(new Student('00000014', 'Bob')); +$students->add(new Student('00000014', 'Foo')); + +// The goal is to verify we can access the cached string value even if it was +// generated by a call to __toString(). To check this we need to access the +// iterator's __toString() method. +$it = $students->getIterator(); +foreach ($it as $student) { + echo $it->__toString(), "\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_003.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_003.php.expectf new file mode 100644 index 000000000..9e96d9db5 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_003.php.expectf @@ -0,0 +1,3 @@ +01234123, Joe +00000014, Bob +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_004.php b/hphp/test/zend/bad/ext-spl/iterator_004.php new file mode 100644 index 000000000..e0a64924c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_004.php @@ -0,0 +1,81 @@ +a = $a; + } + + public function rewind() + { + echo __METHOD__ . "\n"; + $this->i = 0; + } + + public function valid() + { + $ret = $this->i < count($this->a); + echo __METHOD__ . '(' . ($ret ? 'true' : 'false') . ")\n"; + return $ret; + } + + public function key() + { + echo __METHOD__ . "\n"; + return $this->i; + } + + public function current() + { + echo __METHOD__ . "\n"; + return $this->a[$this->i]; + } + + public function next() + { + echo __METHOD__ . "\n"; + $this->i++; + } +} + +class SeekableNumericArrayIterator extends NumericArrayIterator implements SeekableIterator +{ + public function seek($index) + { + if ($index < count($this->a)) { + $this->i = $index; + } + echo __METHOD__ . '(' . $index . ")\n"; + } +} + +$a = array(1, 2, 3, 4, 5); +foreach (new LimitIterator(new NumericArrayIterator($a), 1, 3) as $v) +{ + print "$v\n"; +} + +echo "===SEEKABLE===\n"; +$a = array(1, 2, 3, 4, 5); +foreach(new LimitIterator(new SeekableNumericArrayIterator($a), 1, 3) as $v) +{ + print "$v\n"; +} + +echo "===SEEKING===\n"; +$a = array(1, 2, 3, 4, 5); +$l = new LimitIterator(new SeekableNumericArrayIterator($a)); +for($i = 1; $i < 4; $i++) +{ + $l->seek($i); + print $l->current() . "\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_004.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_004.php.expectf new file mode 100644 index 000000000..f5ad433eb --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_004.php.expectf @@ -0,0 +1,57 @@ +NumericArrayIterator::__construct +NumericArrayIterator::rewind +NumericArrayIterator::valid(true) +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +3 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +4 +NumericArrayIterator::next +===SEEKABLE=== +NumericArrayIterator::__construct +NumericArrayIterator::rewind +SeekableNumericArrayIterator::seek(1) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +2 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +3 +NumericArrayIterator::next +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +4 +NumericArrayIterator::next +===SEEKING=== +NumericArrayIterator::__construct +SeekableNumericArrayIterator::seek(1) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +2 +SeekableNumericArrayIterator::seek(2) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +3 +SeekableNumericArrayIterator::seek(3) +NumericArrayIterator::valid(true) +NumericArrayIterator::current +NumericArrayIterator::key +4 +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_005.php b/hphp/test/zend/bad/ext-spl/iterator_005.php new file mode 100644 index 000000000..3b57e31ed --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_005.php @@ -0,0 +1,37 @@ + +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_005.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_005.php.expectf new file mode 100644 index 000000000..7186d76da --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_005.php.expectf @@ -0,0 +1,11 @@ +ArrayIteratorEx::rewind +int(0) +int(1) +int(2) +int(3) +ArrayObjectEx::getIterator +int(0) +int(1) +int(2) +int(3) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_007.php b/hphp/test/zend/bad/ext-spl/iterator_007.php new file mode 100644 index 000000000..4d69f3d6a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_007.php @@ -0,0 +1,96 @@ +getInnerIterator() as $v) { + var_dump($v); +} + +echo "===1===\n"; +foreach ($it as $v) { + var_dump($v); +} + +$pos =0; + +$it = new NoRewindIteratorEx(new ArrayIteratorEx(range(0,3))); + +echo "===2===\n"; +foreach ($it as $v) { + var_dump($v); + if ($pos++ > 1) { + break; + } +} + +echo "===3===\n"; +foreach ($it as $v) { + var_dump($v); +} + +echo "===4===\n"; +foreach ($it as $v) { + var_dump($v); +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_007.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_007.php.expectf new file mode 100644 index 000000000..2b8c6a33a --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_007.php.expectf @@ -0,0 +1,66 @@ +===0=== +ArrayIteratorEx::rewind +ArrayIteratorEx::valid +ArrayIteratorEx::current +int(0) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +int(1) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +int(2) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +int(3) +ArrayIteratorEx::next +ArrayIteratorEx::valid +===1=== +NoRewindIteratorEx::rewind +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +===2=== +NoRewindIteratorEx::rewind +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +NoRewindIteratorEx::current +ArrayIteratorEx::current +int(0) +NoRewindIteratorEx::next +ArrayIteratorEx::next +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +NoRewindIteratorEx::current +ArrayIteratorEx::current +int(1) +NoRewindIteratorEx::next +ArrayIteratorEx::next +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +NoRewindIteratorEx::current +ArrayIteratorEx::current +int(2) +===3=== +NoRewindIteratorEx::rewind +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +NoRewindIteratorEx::current +int(2) +NoRewindIteratorEx::next +ArrayIteratorEx::next +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +NoRewindIteratorEx::current +ArrayIteratorEx::current +int(3) +NoRewindIteratorEx::next +ArrayIteratorEx::next +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +===4=== +NoRewindIteratorEx::rewind +NoRewindIteratorEx::valid +ArrayIteratorEx::valid +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_008.php b/hphp/test/zend/bad/ext-spl/iterator_008.php new file mode 100644 index 000000000..a335a1994 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_008.php @@ -0,0 +1,45 @@ + 5) { + break; + } +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_008.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_008.php.expectf new file mode 100644 index 000000000..28f6428d6 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_008.php.expectf @@ -0,0 +1,40 @@ +ArrayIteratorEx::rewind +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(0) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(1) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(2) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::rewind +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(0) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(1) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(2) +ArrayIteratorEx::next +ArrayIteratorEx::valid +ArrayIteratorEx::rewind +ArrayIteratorEx::valid +ArrayIteratorEx::current +ArrayIteratorEx::key +int(0) +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_009.php b/hphp/test/zend/bad/ext-spl/iterator_009.php new file mode 100644 index 000000000..c7613dce7 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_009.php @@ -0,0 +1,38 @@ + +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_009.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_009.php.expectf new file mode 100644 index 000000000..52c2d1237 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_009.php.expectf @@ -0,0 +1,3 @@ +EmptyIteratorEx::rewind +EmptyIteratorEx::valid +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_010.php b/hphp/test/zend/bad/ext-spl/iterator_010.php new file mode 100644 index 000000000..942238b58 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_010.php @@ -0,0 +1,12 @@ + $val) +{ + echo "$key=>$val\n"; +} + +?> +===DONE=== +$val) +{ + echo "$key=>$val\n"; +} + +echo "===InfiniteIterator===\n"; + +$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); +$it = new InfiniteIterator($it); +$it = new LimitIterator($it, 2, 5); +foreach($it as $val=>$key) +{ + echo "$val=>$key\n"; +} + +echo "===Infinite/LimitIterator===\n"; + +$it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D')); +$it = new LimitIterator($it, 1, 2); +$it = new InfiniteIterator($it); +$it = new LimitIterator($it, 2, 5); +foreach($it as $val=>$key) +{ + echo "$val=>$key\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_011.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_011.php.expectf new file mode 100644 index 000000000..c088c958c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_011.php.expectf @@ -0,0 +1,14 @@ +===EmptyIterator=== +===InfiniteIterator=== +2=>C +3=>D +0=>A +1=>B +2=>C +===Infinite/LimitIterator=== +1=>B +2=>C +1=>B +2=>C +1=>B +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_012.php b/hphp/test/zend/bad/ext-spl/iterator_012.php new file mode 100644 index 000000000..961232851 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_012.php @@ -0,0 +1,22 @@ + 'A', 1 => 'B', 2 => 'C'))); + +echo $it->key() . '=>' . $it->current() . "\n"; + +echo "===Next===\n"; + +$it->next(); + +echo "===Foreach===\n"; + +foreach($it as $key=>$val) +{ + echo "$key=>$val\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_012.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_012.php.expectf new file mode 100644 index 000000000..0dc36b991 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_012.php.expectf @@ -0,0 +1,7 @@ +===Current=== +0=>A +===Next=== +===Foreach=== +1=>B +2=>C +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_013.php b/hphp/test/zend/bad/ext-spl/iterator_013.php new file mode 100644 index 000000000..f70ac79d4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_013.php @@ -0,0 +1,46 @@ +$val) +{ + echo "$key=>$val\n"; +} + +echo "===Append===\n"; + +$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B'))); + +foreach($it as $key=>$val) +{ + echo "$key=>$val\n"; +} + +echo "===Rewind===\n"; + +foreach($it as $key=>$val) +{ + echo "$key=>$val\n"; +} + +echo "===Append===\n"; + +$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D'))); + +foreach(new NoRewindIterator($it) as $key=>$val) +{ + echo "$key=>$val\n"; +} + +echo "===Rewind===\n"; + +foreach($it as $key=>$val) +{ + echo "$key=>$val\n"; +} + +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_013.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_013.php.expectf new file mode 100644 index 000000000..c4d893185 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_013.php.expectf @@ -0,0 +1,16 @@ +===Empty=== +===Append=== +0=>A +1=>B +===Rewind=== +0=>A +1=>B +===Append=== +2=>C +3=>D +===Rewind=== +0=>A +1=>B +2=>C +3=>D +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_014.php b/hphp/test/zend/bad/ext-spl/iterator_014.php new file mode 100644 index 000000000..499176f3e --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_014.php @@ -0,0 +1,74 @@ +getDepth().")\n"; + } + + function endChildren() + { + echo __METHOD__ . "(".$this->getDepth().")\n"; + } +} + +foreach(new RecursiveArrayIteratorIterator(new MyRecursiveArrayIterator(array("a", array("ba", array("bba", "bbb"), array(array("bcaa"))), array("ca"), "d"))) as $k=>$v) +{ + echo "$k=>$v\n"; +} +?> +===DONE=== + \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_014.php.expectf b/hphp/test/zend/bad/ext-spl/iterator_014.php.expectf new file mode 100644 index 000000000..8af51a09c --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_014.php.expectf @@ -0,0 +1,60 @@ +RecursiveArrayIteratorIterator::rewind +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +0=>a +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::getChildren +RecursiveArrayIteratorIterator::beginChildren(1) +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +0=>ba +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::getChildren +RecursiveArrayIteratorIterator::beginChildren(2) +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +0=>bba +RecursiveArrayIteratorIterator::next +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +1=>bbb +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::endChildren(2) +MyRecursiveArrayIterator::getChildren +RecursiveArrayIteratorIterator::beginChildren(2) +MyRecursiveArrayIterator::getChildren +RecursiveArrayIteratorIterator::beginChildren(3) +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +0=>bcaa +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::endChildren(3) +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::endChildren(2) +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::endChildren(1) +MyRecursiveArrayIterator::getChildren +RecursiveArrayIteratorIterator::beginChildren(1) +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +0=>ca +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::endChildren(1) +RecursiveArrayIteratorIterator::valid +RecursiveArrayIteratorIterator::current +RecursiveArrayIteratorIterator::key +3=>d +RecursiveArrayIteratorIterator::next +MyRecursiveArrayIterator::valid = false +RecursiveArrayIteratorIterator::valid +MyRecursiveArrayIterator::valid = false +===DONE=== \ No newline at end of file diff --git a/hphp/test/zend/bad/ext-spl/iterator_015.php b/hphp/test/zend/bad/ext-spl/iterator_015.php new file mode 100644 index 000000000..b149568a4 --- /dev/null +++ b/hphp/test/zend/bad/ext-spl/iterator_015.php @@ -0,0 +1,38 @@ +\n"; + parent::rewind(); + } + function beginChildren() + { + echo str_repeat(' ',$this->getDepth())."\n"; + } + function valid() + { + if (!parent::valid()) { + echo "