Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 71 lines (57 sloc) 2.71 kb
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
1 1. strrpos() and strripos() now use the entire string as a needle.
2 Be aware that the existing scripts may no longer work as you expect.
3
1fa7458 A small start for so called "not-yet-written faq" about small changes th...
Andrey Hristov authored
4 EX :
5 <?php
6 var_dump(strrpos("ABCDEF","DEF"));
7 var_dump(strrpos("ABCDEF","DAF"));
8 ?>
32f41d1 add an example for illegal string offset. the example is stolen from Mar...
Andrey Hristov authored
9
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
10 Will give you different results. The former returns 3 while the latter
11 returns false rather than the position of the last occurrence of 'D'.
12 The same applies to strripos().
13
14 2. Illegal use of string offsets causes E_ERROR instead of E_WARNING.
15
32f41d1 add an example for illegal string offset. the example is stolen from Mar...
Andrey Hristov authored
16 EX :
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
17 <?php
18 $a = "foo";
19 unset($a[0][1][2]);
20 ?>
21
22 Fatal error: Cannot use string offset as an array in ... on line 1
32f41d1 add an example for illegal string offset. the example is stolen from Mar...
Andrey Hristov authored
23
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
24 3. array_merge() was changed to accept only arrays. If a non-array variable is
25 passed, a E_WARNING will be thrown for every such parameter. Be careful
26 because your code may start emitting E_WARNING out of the blue.
32f41d1 add an example for illegal string offset. the example is stolen from Mar...
Andrey Hristov authored
27
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
28 4. Be careful when porting from ext/mysql to ext/mysqli. The following
29 functions return NULL when no more data is available in the result set
30 (ext/mysql's functions return FALSE).
31
32 - mysqli_fetch_row()
33 - mysqli_fetch_array()
34 - mysqli_fetch_assoc()
5ce35b8 Note about Apache2 SAPI change.
Moriyoshi Koizumi authored
35
36 5. PATH_TRANSLATED server variable is no longer set implicitly under
f4983c0 - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5
foobar authored
37 Apache2 SAPI in contrast to the situation in PHP 4, where it is set to the
5ce35b8 Note about Apache2 SAPI change.
Moriyoshi Koizumi authored
38 same value as the SCRIPT_FILENAME server variable when it is not populated
39 by Apache. This change was made to comply with the CGI specification.
40 Please refer to bug #23610 for further information.
61e6cd2 Reorganization.
Moriyoshi Koizumi authored
41
7baf31f another example
Andrey Hristov authored
42 6. Starting PHP 5.0.0 the T_ML_CONSTANT constant is no longer defined by the
43 ext/tokenizer extension. If error_reporting is set to E_ALL notices will
44 be produced. Instead of T_ML_CONSTANT for /* */ the T_COMMENT constant
45 is used, thus both // and /* */ are resolved as the T_COMMENT constant.
3bf293f @andigutmans - Change from PHP5 -> PHP 5
andigutmans authored
46 However the PHPDoc style comments /** */ ,which starting PHP 5 are parsed
d5d2d9e Clarification about phpDoc comments. Spotted by Greag Beaver.
Andrey Hristov authored
47 by PHP, are recongnized as T_DOC_COMMENT.
1a55992 adding info about $argc and $argv in CLI mode
Andrey Hristov authored
48
0fa195d use Rasmus' words
Andrey Hristov authored
49 7. $_SERVER should be populated with argc and argv if variables_order
50 includes "S". If you have specifically configured your system to not
51 create $_SERVER, then of course it shouldn't be there. The change was to
52 always make argc and argv available in the CLI version regardless of the
53 variables_order setting. As in, the CLI version will now always populate
54 the global $argc and $argv variables.
85de35e Adding note about declaration first use after that for classes.
Andrey Hristov authored
55
d39bd31 This is a definitive 'must'
Marcus Boerger authored
56 8. Classes must be declared before used:
85de35e Adding note about declaration first use after that for classes.
Andrey Hristov authored
57 <?php
58 $test = new fubar();
59 $test->echo();
60
61 class fubar {
62 function echo() {
63 echo 'fubar';
64 }
65 }
66 ?>
3bf293f @andigutmans - Change from PHP5 -> PHP 5
andigutmans authored
67 This script is perfectly valid and works in PHP 4 but with PHP 5 there
85de35e Adding note about declaration first use after that for classes.
Andrey Hristov authored
68 will be a fatal error like :
69 Fatal error: Class 'fubar' not found in ....
70 If there is defined function __autoload() it will be called.
Something went wrong with that request. Please try again.