11Encoding
22########
33
4+ .. highlight :: php
45.. versionchanged :: 2.0 options array is replaced with named parameters
56.. note :: Parameter order is not guaranteed for options, use named parameters
67
@@ -9,7 +10,7 @@ Scalars and arrays
910
1011.. versionchanged :: 4.1 floats now throw an exception instead of becoming strings
1112
12- .. code-block :: php
13+ ::
1314
1415 <?php
1516
@@ -43,9 +44,7 @@ ArrayObject and stdClass
4344
4445.. versionchanged :: 3.0 ``Traversable`` objects no longer become dictionaries automatically
4546
46- ArrayObject and stdClass become dictionaries:
47-
48- .. code-block :: php
47+ ArrayObject and stdClass become dictionaries::
4948
5049 <?php
5150
@@ -70,9 +69,7 @@ Big integer support
7069.. note :: More in the :ref:`decoding section <bencode_decoding_bigint>`
7170
7271GMP object, Pear's Math_BigInteger, brick/math BigInteger, and internal type BigIntType (simple numeric string wrapper)
73- will become integers:
74-
75- .. code-block :: php
72+ will become integers::
7673
7774 <?php
7875
@@ -92,9 +89,7 @@ Stringable
9289
9390.. versionchanged :: 3.0 ``Stringable`` objects no longer become strings automatically
9491
95- You can convert ``Stringable `` objects to strings using ``useStringable `` option:
96-
97- .. code-block :: php
92+ You can convert ``Stringable `` objects to strings using ``useStringable `` option::
9893
9994 <?php
10095
@@ -119,9 +114,7 @@ Object Wrappers
119114.. versionadded :: 1.7/2.7/3.0 ``DictType``
120115
121116You can use any traversable as a list by wrapping it with ``ListType ``.
122- Keys will be discarded in that case.
123-
124- .. code-block :: php
117+ Keys will be discarded in that case::
125118
126119 <?php
127120
@@ -133,9 +126,7 @@ Keys will be discarded in that case.
133126 ); // "li1ei2ei3ee"
134127
135128You can use any traversable as a dictionary by wrapping it with ``DictType ``.
136- Keys will be cast to string and must be unique.
137-
138- .. code-block :: php
129+ Keys will be cast to string and must be unique::
139130
140131 <?php
141132
@@ -156,9 +147,7 @@ BencodeSerializable
156147.. versionadded :: 1.7/2.7/3.0 ``JsonSerializable`` handling
157148
158149You can also force object representation by implementing BencodeSerializable interface.
159- This will work exactly like JsonSerializable _ interface.
160-
161- .. code-block :: php
150+ This will work exactly like JsonSerializable _ interface::
162151
163152 <?php
164153
@@ -182,9 +171,7 @@ This will work exactly like JsonSerializable_ interface.
182171 $encoded = Bencode::encode($file);
183172 // "d5:class6:MyFile4:name14:myfile.torrent4:sizei5242880ee"
184173
185- Optionally you can use JsonSerializable _ itself too:
186-
187- .. code-block :: php
174+ Optionally you can use JsonSerializable _ itself too::
188175
189176 <?php
190177
@@ -214,9 +201,7 @@ Working with files
214201
215202.. versionchanged :: 3.0 ``($filename, $data)`` → ``($data, $filename)``
216203
217- Save data to file:
218-
219- .. code-block :: php
204+ Save data to file::
220205
221206 <?php
222207
@@ -229,9 +214,7 @@ Working with streams
229214
230215.. versionadded :: 1.5/2.5
231216
232- Save data to a writable stream or to a new php://temp if no stream is specified
233-
234- .. code-block :: php
217+ Save data to a writable stream or to a new php://temp if no stream is specified::
235218
236219 <?php
237220
@@ -244,9 +227,7 @@ Encoder object
244227
245228.. versionadded :: 1.7/2.7/3.0
246229
247- Encoder object can be configured on creation and used multiple times.
248-
249- .. code-block :: php
230+ Encoder object can be configured on creation and used multiple times::
250231
251232 <?php
252233
0 commit comments