Annotation of embedaddon/php/ext/openssl/tests/bug38261.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: openssl key from zval leaks 
                      3: --SKIPIF--
                      4: <?php 
                      5: if (!extension_loaded("openssl")) die("skip"); 
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9: $cert = false;
                     10: class test {
                     11:        function __toString() {
                     12:                return "test object";
                     13:        }
                     14: }
                     15: $t = new test;
                     16: 
                     17: var_dump(openssl_x509_parse("foo"));
                     18: var_dump(openssl_x509_parse($t));
                     19: var_dump(openssl_x509_parse(array()));
                     20: var_dump(openssl_x509_parse());
                     21: var_dump(openssl_x509_parse($cert));
                     22: var_dump(openssl_x509_parse(new stdClass));
                     23: 
                     24: ?>
                     25: --EXPECTF--
                     26: bool(false)
                     27: bool(false)
                     28: bool(false)
                     29: 
                     30: Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %sbug38261.php on line %d
                     31: NULL
                     32: bool(false)
                     33: 
                     34: Catchable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>