Skip to content

Commit a924b0c

Browse files
Sobaknikic
authored andcommitted
Drop spaces before interpunction signs (#20)
1 parent bda2aff commit a924b0c

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Book/php7/build_system/building_extensions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,10 @@ to recompile extensions against a newer PHP version.
317317

318318
Too many numbers? Yes. One API number, bound to one PHP version, would really be enough for anybody and would ease
319319
the understanding of PHP versionning. Unfortunately, we got 3 different API numbers in addition to the PHP version
320-
itself. Which one should you look for ? The answer is any : they all-three-of-them evolve when PHP version evolve.
320+
itself. Which one should you look for? The answer is any : they all-three-of-them evolve when PHP version evolve.
321321
For historical reasons, we got 3 different numbers.
322322

323-
But, you are a C developper anren't you ? Why not build a "compatibility" header on your side, based on such number ?
323+
But, you are a C developper anren't you? Why not build a "compatibility" header on your side, based on such number?
324324
We authors, use something like this in extensions of ours::
325325

326326
#include "php.h"
@@ -356,9 +356,9 @@ We authors, use something like this in extensions of ours::
356356
#define IS_PHP_5 1
357357
#endif
358358
359-
See ?
359+
See?
360360

361-
Or, simpler (so better ?) is to use PHP_VERSION_ID which you are probably much more familiar about::
361+
Or, simpler (so better) is to use PHP_VERSION_ID which you are probably much more familiar about::
362362
363363
#if PHP_VERSION_ID >= 50600
364364

Book/php7/extensions_design/php_functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Here it is::
3232
You can spot that this structure is not complex. This is all you'll need to declare and register a new function.
3333
Let's detail it together:
3434

35-
A function's got a name: ``fname``. Nothing to add, you see what it's used for right ? Just notice the ``const char *``
35+
A function's got a name: ``fname``. Nothing to add, you see what it's used for right? Just notice the ``const char *``
3636
type. That can't fit into the engine. This ``fname`` is a model and the engine will create from it an
3737
:doc:`interned zend_string<../internal_types/strings/zend_strings>`.
3838

@@ -259,7 +259,7 @@ zval, and you are expected to play with it. :doc:`Here are more resources about
259259
.. note:: While programming PHP functions in C extensions, you receive the return value as an argument, and you don't
260260
return anything from your C function body.
261261

262-
Ok first point explained. Second one as you may have guessed: where are the PHP function arguments ? Where is
262+
Ok first point explained. Second one as you may have guessed: where are the PHP function arguments? Where is
263263
``$fahreinheit``? That one is pretty hard to fully explain, it is hell hard to in fact.
264264

265265
But we don't need to have a look at the details here. Let's explain the crucial concepts:

Book/php7/internal_types/strings/zend_strings.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ known. Please, note that the length computes the number of ASCII chars (bytes) n
3333
counting the eventual middle NULs. For example, the string "foo" is stored as "foo\\0" in a ``zend_string`` and its
3434
length is then 3. Also, the string "foo\\0bar" will be stored as "foo\\0bar\\0" and the length will be 7.
3535

36-
Finally, the characters are stored into the ``char[1]`` field. This is not a ``char *``, but a ``char[1]``. Why that ?
36+
Finally, the characters are stored into the ``char[1]`` field. This is not a ``char *``, but a ``char[1]``. Why that?
3737
This is a memory optimization known as "C struct hack" (you may use a search engine with these terms). Basically, that
3838
allows the engine to allocate space for the ``zend_string`` structure and the characters to be stored, as one solo C
3939
pointer. This optimizes memory accesses as memory will be a contiguous allocated block, and not two blocks sparsed in
@@ -284,7 +284,7 @@ Say you want to create the string "foo". What you tend to do is simply create a
284284
285285
/* ... */
286286
287-
But a question arises : Hasn't that piece of string already been created before you need it ?
287+
But a question arises : Hasn't that piece of string already been created before you need it?
288288
When you need a string, you code is executed at some point in PHP's life, that means that some piece of code happening
289289
before yours may have needed the exact same piece of string ("foo" for our example).
290290

Book/php7/internal_types/zend_resources.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ makes use of it in its heart or in some extensions. Let's see that type together
1212
and suffers from a long past history, so don't be suprised about its design especially when reading the source code
1313
about it
1414

15-
What is the "Resource" type ?
16-
-----------------------------
15+
What is the "Resource" type?
16+
----------------------------
1717

1818
Easy enough you know about it. We are talking about this here:
1919

Book/php7/memory_management/memory_debugging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ a crash.
282282

283283
Valgrind could also report invalid reads. That means you perform a memory read operation out of the bounds of an
284284
allocated pointer. Better scenario that a block overwrite, you still access memory area you should not, and here again
285-
in such a scenario that could lead to an immediate crash, or later, or never ? Don't do that.
285+
in such a scenario that could lead to an immediate crash, or later, or never? Don't do that.
286286

287287
.. note:: As soon as you read "Invalid" in the output of valgrind, that smells really bad for you. Whether invalid
288288
read or write, you have a problem in your code, and you should consider this problem as high risk: fix it

Book/php7/memory_management/zend_memory_manager.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PHP is a share-nothing architecture. Well, not at 100%. Let us explain.
1818
here, you'll get additionnal informations about the different steps and cycles that can be drawn from PHP
1919
lifetime.
2020

21-
PHP can treat several (dozen, thousands ?) of requests into the same process. By default, PHP will forget anything it
21+
PHP can treat several (dozen, thousands?) of requests into the same process. By default, PHP will forget anything it
2222
knows of the current request, when that later finishes.
2323

2424
"Forgetting" things translates to freeing any dynamic buffer that got allocated while treating a request. That means
@@ -35,11 +35,11 @@ default, PHP forgets *a very huge number* of informations from one request to an
3535

3636
There exists however some pretty rare informations you need to persist across several requests. But that's uncommon.
3737

38-
What could be kept unchanged through requests ? What we call **persistent** objects. Once more let us insist : those
38+
What could be kept unchanged through requests? What we call **persistent** objects. Once more let us insist : those
3939
are rare cases. For example, the current PHP executable path won't change from requests to requests. That latter
4040
information is allocated permanently, that means it is allocated with a traditionnal libc's ``malloc()`` call.
4141

42-
What else ? Some strings. For example, the *"_SERVER"* string will be reused from request to request, as every request
42+
What else? Some strings. For example, the *"_SERVER"* string will be reused from request to request, as every request
4343
will create the ``$_SERVER`` PHP array. So the *"_SERVER"* string itself can be permanently allocated, because it will
4444
be allocated once.
4545

0 commit comments

Comments
 (0)