swig/Examples/test-suite/php/php_iterator_runme.php
Olly Betts 32283991c5 Don't generate a .php wrapper file by default
It's now only generated if something to put in it is specified via:

%pragma(php) include=...

or

%pragma(php) code=...
2021-05-04 14:14:56 +12:00

23 lines
444 B
PHP

<?php
require "tests.php";
// No new functions.
check::functions(array());
check::classes(array('MyIterator'));
// No new global variables.
check::globals(array());
$s = '';
foreach (new MyIterator(1, 6) as $i) {
$s .= $i;
}
check::equal($s, '12345', 'Simple iteration failed');
$s = '';
foreach (new MyIterator(2, 5) as $k => $v) {
$s .= "($k=>$v)";
}
check::equal($s, '(0=>2)(1=>3)(2=>4)', 'Simple iteration failed');
check::done();