1--TEST-- 2Bug #25378 (unserialize() crashes with invalid data) 3--FILE-- 4<?php 5var_dump(unserialize('b:0;')); 6var_dump(unserialize('b:1;')); 7var_dump(unserialize('i:823;')); 8var_dump(unserialize('s:0:"";')); 9var_dump(unserialize('s:3:"foo";')); 10var_dump(unserialize('a:1:{i:0;s:2:"12";}')); 11var_dump(unserialize('a:2:{i:0;a:0:{}i:1;a:0:{}}')); 12var_dump(unserialize('a:3:{i:0;s:3:"foo";i:1;s:3:"bar";i:2;s:3:"baz";}')); 13var_dump(unserialize('O:8:"stdClass":0:{}')); 14?> 15===DONE=== 16--EXPECTF-- 17bool(false) 18bool(true) 19int(823) 20string(0) "" 21string(3) "foo" 22array(1) { 23 [0]=> 24 string(2) "12" 25} 26array(2) { 27 [0]=> 28 array(0) { 29 } 30 [1]=> 31 array(0) { 32 } 33} 34array(3) { 35 [0]=> 36 string(3) "foo" 37 [1]=> 38 string(3) "bar" 39 [2]=> 40 string(3) "baz" 41} 42object(stdClass)#%d (0) { 43} 44===DONE=== 45