PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/php/argout_runme.php

#
PHP | 37 lines | 24 code | 9 blank | 4 comment | 1 complexity | f42af4b3e03e066975b6436593652a1d MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. <?php
  2. require "tests.php";
  3. require "argout.php";
  4. check::functions(array(incp,incr,inctr,new_intp,copy_intp,delete_intp,intp_assign,intp_value,voidhandle,handle));
  5. $ip=copy_intp(42);
  6. check::equal(42,incp($ip),"42==incp($ip)");
  7. check::equal(43,intp_value($ip),"43=$ip");
  8. $p=copy_intp(2);
  9. check::equal(2,incp($p),"2==incp($p)");
  10. check::equal(3,intp_value($p),"3==$p");
  11. $r=copy_intp(7);
  12. check::equal(7,incr($r),"7==incr($r)");
  13. check::equal(8,intp_value($r),"8==$r");
  14. $tr=copy_intp(4);
  15. check::equal(4,inctr($tr),"4==incr($tr)");
  16. check::equal(5,intp_value($tr),"5==$tr");
  17. # Check the voidhandle call, first with null
  18. unset($handle);
  19. voidhandle(&$handle);
  20. check::resource($handle,"_p_void",'$handle is not _p_void');
  21. $handledata=handle($handle);
  22. check::equal($handledata,"Here it is","\$handledata != \"Here it is\"");
  23. unset($handle);
  24. // without reference, should fatal error so can't test here
  25. //voidhandle($handle);
  26. //check::isnull($handle,'$handle not null');
  27. check::done();
  28. ?>