Skip to content

Commit 3b99768

Browse files
lex111nikic
authored andcommitted
Fix markdown headings
1 parent 40ac5c1 commit 3b99768

21 files changed

+264
-264
lines changed

spec/01-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Introduction
1+
# Introduction
22
This specification is intended to provide a complete and concise
33
definition of the syntax and semantics of the PHP language, suitable for
44
use by the following:

spec/02-conformance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Conformance
1+
# Conformance
22
In this specification, "must" is to be interpreted as a requirement on
33
an implementation or on a program; conversely, "must not" is to be
44
interpreted as a prohibition.

spec/03-terms-and-definitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Terms and Definitions
1+
# Terms and Definitions
22
For the purposes of this document, the following terms and definitions
33
apply:
44

spec/04-basic-concepts.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#Basic Concepts
2-
##Program Structure
1+
# Basic Concepts
2+
## Program Structure
33
A PHP *program* consists of one or more source files, known formally as
44
*scripts*.
55

@@ -54,7 +54,7 @@ The top level of a script is simply referred to as the *top level*.
5454
If `<?=` is used as the *start-tag*, the Engine proceeds as if the *statement-list* started with [echo](10-expressions.md#echo)
5555
statement.
5656

57-
##Program Start-Up
57+
## Program Start-Up
5858
A program begins execution at the start of a [script](#program-structure) designated in
5959
some unspecified manner. This script is called the *start-up script*.
6060

@@ -83,7 +83,7 @@ when it's invoked.
8383
The implementation may accept more than one start-up script, in which case they
8484
are executed in implementation-defined order and share the global environment.
8585

86-
##Program Termination
86+
## Program Termination
8787
A program may terminate normally in the following ways:
8888

8989
- Execution reaches the end of the [start-up script](#program-start-up).
@@ -107,7 +107,7 @@ registered by `set_exception_handler`, that is equivalent to exit(0). It
107107
is unspecified whether [object destructors](14-classes.md#destructors) are run.
108108
In all other cases, the behavior is unspecified.
109109

110-
##__halt_compiler
110+
## __halt_compiler
111111

112112
PHP script files can incorporate data which is to be ignored by the Engine when
113113
compiling the script. An example of such files are [PHAR](http://www.php.net/phar) files.
@@ -138,8 +138,8 @@ var_dump(stream_get_contents($fp));
138138
__halt_compiler(); the file data which will be ignored by the Engine
139139
```
140140

141-
##The Memory Model
142-
###General
141+
## The Memory Model
142+
### General
143143
This section and those immediately following it describe the abstract
144144
memory model used by PHP for storing variables. A conforming
145145
implementation may use whatever approach is desired as long as from any
@@ -258,7 +258,7 @@ of which (except `unset`) use the & punctuator:
258258
- [byRef variable-use list in an anonymous function](10-expressions.md#anonymous-function-creation).
259259
- [unset](10-expressions.md#unset).
260260

261-
###Reclamation and Automatic Memory Management
261+
### Reclamation and Automatic Memory Management
262262
The Engine is required to manage the lifetimes of VStores and HStores
263263
using some form of automatic memory management.
264264
In particular, when a VStore or HStore is created, memory is allocated for it.
@@ -297,8 +297,8 @@ a VSlot, this indicates that the VSlot has been reclaimed or, in the case
297297
of a VSlot contained with an HStore, that the containing HStore has been
298298
reclaimed or is eligible for reclamation.
299299

300-
###Assignment
301-
####General
300+
### Assignment
301+
#### General
302302
This section and those immediately following it describe the abstract
303303
model's implementation of *value assignment* and *byRef assignment*.
304304
Value assignment of non-array types to local variables is described
@@ -311,7 +311,7 @@ Value assignment and byRef assignment are core to the PHP language, and
311311
many other operations in this specification are described in terms of
312312
value assignment and byRef assignment.
313313

314-
####Value Assignment of Scalar Types to a Local Variable
314+
#### Value Assignment of Scalar Types to a Local Variable
315315
Value assignment is the primary means by which the programmer can create
316316
local variables. If a local variable that appears on the left-hand side
317317
of value assignment does not exist, the engine will bring a new local
@@ -439,7 +439,7 @@ defer copying a string's contents for value assignment so long as it has
439439
no observable effect on behavior from any testable viewpoint (excluding
440440
performance and resource consumption).
441441

442-
####Value Assignment of Objects to a Local Variable
442+
#### Value Assignment of Objects to a Local Variable
443443

444444
To demonstrate value assignment of objects to local variables, consider
445445
the case in which we have a Point class that supports a two-dimensional
@@ -533,7 +533,7 @@ though they can have an arbitrarily large number of instance properties
533533
of arbitrary type. Likewise, the same mechanics apply to value
534534
assignment of all resource types.
535535

536-
####ByRef Assignment for Scalar Types with Local Variables
536+
#### ByRef Assignment for Scalar Types with Local Variables
537537
Let's begin with the same value [assignment](10-expressions.md#simple-assignment) as in the previous
538538
section, `$a = 123` and `$b = false`:
539539

@@ -662,7 +662,7 @@ Note that literals, constants, and other expressions that don't
662662
designate a modifiable lvalue cannot be used on the left- or right-hand
663663
side of byRef assignment.
664664

665-
####ByRef Assignment of Non-Scalar Types with Local Variables
665+
#### ByRef Assignment of Non-Scalar Types with Local Variables
666666
ByRef assignment of non-scalar types works using the same mechanism as
667667
byRef assignment for scalar types. Nevertheless, it is worthwhile to
668668
describe a few examples to clarify the semantics of byRef assignment.
@@ -736,7 +736,7 @@ Once all the aliases to the VStores are gone, the VStores can be
736736
destroyed, in which case, there are no more pointers to the HStore, and
737737
it can be destoyed too.
738738

739-
####Value Assignment of Array Types to Local Variables
739+
#### Value Assignment of Array Types to Local Variables
740740
The semantics of value assignment of array types is different from value
741741
assignment of other types. Recall the `Point` class from [the examples](#value-assignment-of-objects-to-a-local-variable), and consider the following [value assignments](10-expressions.md#simple-assignment) and their abstract implementation:
742742

@@ -889,7 +889,7 @@ arrays even though they can have an arbitrarily large number
889889
of elements. As to how an HStore accommodates all of them, is
890890
unspecified and unimportant to the abstract model.
891891

892-
####Deferred Array Copying
892+
#### Deferred Array Copying
893893
As mentioned in the [previous section](#value-assignment-of-array-types-to-local-variables), an implementation may
894894
choose to use a deferred copy mechanism instead of eagerly making a copy
895895
for value assignment of arrays. An implementation may use any deferred
@@ -1115,7 +1115,7 @@ difference, php.net's implementation produces behavior that is
11151115
compatible with the abstract model's definition of deferred array copy
11161116
mechanisms.
11171117

1118-
####General Value Assignment
1118+
#### General Value Assignment
11191119
The sections above thus far have described the mechanics of value assignment
11201120
to a local variable. The assignment to a modifiable lvalue that is not a variable, such as array element or
11211121
object property, works like the local variable assignment, except that the VSlot which represented
@@ -1180,7 +1180,7 @@ is considered a modifiable lvalue, and the VSlot will be created by the engine a
11801180
to the appropriate HStore automatically. Static class properties are considered modifiable lvalues too,
11811181
though new ones would not be created automatically.
11821182

1183-
####General ByRef Assignment
1183+
#### General ByRef Assignment
11841184
The sections above thus far have described the mechanics of byref assignment
11851185
with local variables. The byRef assignment to a modifiable lvalue that is not a variable,
11861186
such as array element or object property, works like the local variable assignment,
@@ -1205,15 +1205,15 @@ Will result in:
12051205
[VSlot $b *]---------------->[VStore int 123]&lt;---------------------------------------+
12061206
```
12071207

1208-
###Argument Passing
1208+
### Argument Passing
12091209
Argument passing is defined in terms of [simple assignment](#assignment) or [byRef assignment](#byref-assignment-for-scalar-types-with-local-variables), depending on how the parameter is declared.
12101210
That is, passing an argument to a function having a corresponding
12111211
parameter is like assigning that argument to that parameter. The
12121212
function call situations involving missing arguments or
12131213
undefined variable arguments are discussed in section describing
12141214
[the function call operator](10-expressions.md#function-call-operator).
12151215

1216-
###Value Returning
1216+
### Value Returning
12171217
Returning a value from a function is defined in terms of [simple assignment](#assignment) or [byRef assignment](#byref-assignment-for-scalar-types-with-local-variables), depending on how the function is declared.
12181218
That is, returning a value from a function to its
12191219
caller is like assigning that value to the user of the caller's return
@@ -1248,7 +1248,7 @@ Passing function's return to another function is considered the same as assignin
12481248
the value to the corresponding function's parameter, with byRef parameters
12491249
treated as byRef assignments.
12501250

1251-
###Cloning objects
1251+
### Cloning objects
12521252
When an object instance is allocated, operator [`new`](10-expressions.md#the-new-operator) returns a handle
12531253
that points to that object. As described [above](#value-assignment-of-objects-to-a-local-variable),
12541254
value assignment of a handle to an object does not copy the object HStore itself. Instead, it creates a copy of the handle.
@@ -1294,7 +1294,7 @@ copy*. If a *deep copy* of an object is desired, the programmer must
12941294
achieve this manually by using the [method `__clone`](14-classes.md#method-__clone) which
12951295
is called after the initial shallow copy has been performed.
12961296

1297-
##Scope
1297+
## Scope
12981298

12991299
The same name can designate different things at different places in a
13001300
program. For each different thing that a name designates, that name is
@@ -1346,7 +1346,7 @@ When a [trait](16-traits.md#general) is used by a class or an interface, the [tr
13461346
members](16-traits.md#trait-declarations) take on the class scope of a member of that class or
13471347
interface.
13481348

1349-
##Storage Duration
1349+
## Storage Duration
13501350

13511351
The lifetime of a variable is the time during program execution that
13521352
storage for that variable is guaranteed to exist. This lifetime is

spec/05-types.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Types
1+
# Types
22

3-
##General
3+
## General
44

55
The meaning of a value is determined by its *type*. PHP's types are
66
categorized as *scalar types* and *composite types*. The scalar types
@@ -26,9 +26,9 @@ The same variable can contain values of different types at different times.
2626
Useful library functions for interrogating and using type information
2727
include [`gettype`](http://www.php.net/gettype), [`is_type`](http://www.php.net/is_type), [`settype`](http://www.php.net/settype), and [`var_dump`](http://www.php.net/var_dump).
2828

29-
##Scalar Types
29+
## Scalar Types
3030

31-
###General
31+
### General
3232

3333
The integer and floating-point types are collectively known as
3434
*arithmetic types*. The library function [`is_numeric`](http://www.php.net/is_numeric) indicates if
@@ -43,7 +43,7 @@ convertible to scalar types (this is currently available only to internal classe
4343
Such object types together with scalar types are called *scalar-compatible types*.
4444
Note that the same object type may be scalar-compatible for one operation but not for another.
4545

46-
###The Boolean Type
46+
### The Boolean Type
4747

4848
The Boolean type is `bool`, for which the name `boolean` is a synonym. This
4949
type is capable of storing two distinct values, which correspond to the
@@ -53,7 +53,7 @@ The internal representation of this type and its values is unspecified.
5353
The library function [`is_bool`](http://www.php.net/is_bool) indicates if a given value has type
5454
`bool`.
5555

56-
###The Integer Type
56+
### The Integer Type
5757

5858
There is one integer type, `int`, for which the name `integer` is a synonym.
5959
This type is binary, signed, and uses twos-complement representation for
@@ -77,7 +77,7 @@ characteristics about type `int`.
7777
The library function [`is_int`](http://www.php.net/is_int) indicates if a given value has type
7878
`int`.
7979

80-
###The Floating-Point Type
80+
### The Floating-Point Type
8181

8282
There is one floating-point type, `float`, for which the names `double` and
8383
`real` are synonyms. The `float` type must support at least the range and
@@ -90,7 +90,7 @@ indicates if a given floating-point value is infinite. The library
9090
function [`is_nan`](http://www.php.net/is_nan) indicates if a given floating-point value is a
9191
`NaN`.
9292

93-
###The String Type
93+
### The String Type
9494

9595
A string is a set of contiguous bytes that represents a sequence of zero
9696
or more characters.
@@ -166,16 +166,16 @@ assignment, which involves the simple assignment [operator =](10-expressions.md#
166166
The library function [`is_string`](http://www.php.net/is_string) indicates if a given value has
167167
type string.
168168

169-
###The Null Type
169+
### The Null Type
170170

171171
The null type has only one possible value, [`NULL`](06-constants.md#core-predefined-constants). The representation
172172
of this type and its value is unspecified.
173173

174174
The library function [`is_null`](http://www.php.net/is_null) indicates if a given value is `NULL`.
175175

176-
##Composite Types
176+
## Composite Types
177177

178-
###The Array Type
178+
### The Array Type
179179

180180
An array is a data structure that contains a collection of zero or more
181181
elements whose values are accessed through keys that are of type `int` or
@@ -184,7 +184,7 @@ elements whose values are accessed through keys that are of type `int` or
184184
The library function [`is_array`](http://www.php.net/is_array) indicates if a given value is an
185185
array.
186186

187-
###Objects
187+
### Objects
188188

189189
An *object* is an instance of a [class](14-classes.md#classes). Each distinct
190190
[*class-declaration*](14-classes.md#class-declarations) defines a new class type, and each class
@@ -194,7 +194,7 @@ The library function [`is_object`](http://www.php.net/is_object) indicates if a
194194
object, and the library function
195195
[`get_class`](http://php.net/manual/function.get-class.php) indicates the name of an object's class.
196196

197-
###Resources
197+
### Resources
198198

199199
A [*resource*](http://php.net/manual/language.types.resource.php)
200200
is a descriptor to some sort of external entity. Examples include

spec/06-constants.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Constants
1+
# Constants
22

3-
##General
3+
## General
44

55
A *constant* is a [named](09-lexical-structure.md#names) value. Once defined, the value
66
of the constant can not be changed.
@@ -34,7 +34,7 @@ define('COEFFICIENT_1', 2.345, TRUE); // define a case-insensitive d-constant
3434
define('FAILURE', FALSE, FALSE); // define a case-sensitive d-constant
3535
```
3636

37-
##Context-Dependent Constants
37+
## Context-Dependent Constants
3838

3939
The following constants—sometimes referred to as *magic constants*—are
4040
automatically available to all scripts; their values are not fixed and they are case-insensitive:
@@ -53,7 +53,7 @@ automatically available to all scripts; their values are not fixed and they are
5353

5454
Constant names beginning with __ are reserved for future use by the Engine.
5555

56-
##Core Predefined Constants
56+
## Core Predefined Constants
5757

5858
The following constants are automatically available to all scripts; they are case-sensitive with the exception of `NULL`, `TRUE` and `FALSE`:
5959

@@ -134,7 +134,7 @@ Constant Name | Description
134134
The members of the `E_*` family have values that are powers of 2, so
135135
they can be combined meaningfully using bitwise operators.
136136

137-
##User-Defined Constants
137+
## User-Defined Constants
138138

139139
A constant may be defined inside or outside of functions, inside
140140
a [class](14-classes.md#constants), or inside an [interface](15-interfaces.md#constants).

0 commit comments

Comments
 (0)