Server IP : 192.158.238.246 / Your IP : 18.116.36.48 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cpanel/ea-php80/root/usr/share/tests/pecl/igbinary/tests/ |
Upload File : |
--TEST-- igbinary and large Serializable --INI-- ; Note that php 8.1 deprecates using Serializable without __serialize/__unserialize but we are testing Serialize for igbinary. Suppress deprecations. error_reporting=E_ALL & ~E_DEPRECATED --FILE-- <?php class Test implements Serializable { public $prop; public function serialize() { return $this->prop; } public function unserialize($s) { $this->prop = $s; } } $t = new Test(); $t->prop = str_repeat('0', 256); var_export(bin2hex($s = igbinary_serialize($t))); echo "\n"; var_export(igbinary_unserialize($s)); echo "\n"; $t->prop = str_repeat('0', 1 << 16); $t2 = igbinary_unserialize(igbinary_serialize($t)); var_dump($t2->prop === $t->prop); ?> --EXPECT-- '000000021704546573741e010030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030' Test::__set_state(array( 'prop' => '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', )) bool(true)