File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,24 @@ Disable serialization of objects
7
7
require_once __DIR__ . "/../utils/basic.inc " ;
8
8
9
9
$ str = 'O:22:"MongoDB\Driver\Manager":0:{} ' ;
10
- $ v = @unserialize ($ str );
11
- var_dump ($ v );
10
+ try {
11
+ /* We throw exception in 5.3 - 5.6 triggers warning and returns false
12
+ * This is inconsistency is only with manipulated serialization strings, or using them across versions
13
+ * which isn't support by PHP in the getgo anyway */
14
+ $ v = @unserialize ($ str );
15
+ var_dump ($ v );
16
+ } catch (Exception $ e ) {
17
+ var_dump (false );
18
+ }
12
19
13
- throws ( function () {
14
- $ manager = new MongoDB \ Driver \ Manager ( " mongodb://localhost " );
20
+ $ manager = new MongoDB \ Driver \ Manager ( " mongodb://localhost " );
21
+ throws ( function () use ( $ manager) {
15
22
serialize ($ manager );
16
- }, "Exception " , " serialize " );
23
+ }, "Exception " );
17
24
?>
18
25
===DONE===
19
26
<?php exit (0 ); ?>
20
27
--EXPECT--
21
28
bool(false)
22
- OK: Got Exception thrown from serialize
29
+ OK: Got Exception
23
30
===DONE===
You can’t perform that action at this time.
0 commit comments