- Introduction
- 1. Top 15 Most Popular Tips
- 2. Author index
- 3. PHP Error index
- 4. Translations
- 5. Tips
❱
- 5.1. Hijacked version_compare()
- 5.2. version_compare_beta_full
- 5.3. array_is_list() Can Fool You
- 5.4. Date Format Reading
- 5.5. This Won't Execute
- 5.6. Bcrypt Is Limited To 72 Characters
- 5.7. Parsing PHP From Within
- 5.8. eval() Kills It
- 5.9. A Dynamic Constant
- 5.10. list() Or array()
- 5.11. No Coercion On Unserialize
- 5.12. Static And Non Static Property
- 5.13. strripos() Searches From The End
- 5.14. Function Call As Default
- 5.15. A Missing Subpattern
- 5.16. Empty String Subpattern
- 5.17. String To Int
- 5.18. strpos() Fights Back
- 5.19. Define Variable By Reference
- 5.20. Named Constructor And Attribute
- 5.21. Not An Attribute
- 5.22. printf() With Locale
- 5.23. Replace The n-th In A String
- 5.24. Replace One In A String
- 5.25. When $café != $café
- 5.26. Leading Nor Trailing
- 5.27. Parsing INI With PHP Options
- 5.28. null For The Rest
- 5.29. array_map() with NULL
- 5.30. Check When A String Is An Integer
- 5.31. $_FILES' type Is Not Safe
- 5.32. Infinite Recursion
- 5.33. An Enum With An Interface
- 5.34. Reference In Array
- 5.35. Duplicate Keys In JSON
- 5.36. Binary And Back
- 5.37. echo And print
- 5.38. Less Arguments In Child Method
- 5.39. strtr() Does Only One Pass
- 5.40. basename() As A str_replace()
- 5.41. explode() negative third argument
- 5.42. Interface Implemented Too Low
- 5.43. What Array Is A List
- 5.44. Closure::getCurrent() To Reach The Closure
- 5.45. A Non-transitive Comparison
- 5.46. Chained Assignation Skips __get()
- 5.47. eval() And FILE
- 5.48. Fiber Throws Where The Fiber Is
- 5.49. Infinite Operations
- 5.50. array_find() And array_find_keys()
- 5.51. Readonly Class Must Match Its Parent
- 5.52. The undefined Keyword
- 5.53. SQL In Memory
- 5.54. The Unreachable Method
- 5.55. min() And max() For Interval
- 5.56. Extra ::class
- 5.57. Other Types For A Property
- 5.58. Larger Than Int
- 5.59. Duplicate Type
- 5.60. Yield Or Return
- 5.61. Multiple Method In Interface
- 5.62. Operator Overloading
- 5.63. Three Return Errors
- 5.64. array_unique() Is Slow
- 5.65. Cloning Static Variable
- 5.66. Datetime And Leap Second
- 5.67. Silent Type Cast
- 5.68. Objects As Keys In Foreach
- 5.69. isset() On Uninitialized Properties
- 5.70. Recycle Generator
- 5.71. Of Integers And Floats
- 5.72. max() On Strings
- 5.73. e And Euler
- 5.74. Closure On Constructor
- 5.75. ++ Riddle
- 5.76. Oversigned Integers
- 5.77. Local Variable Cost
- 5.78. Array Items By Value
- 5.79. Not Set But Exists
- 5.80. Sorting Enum
- 5.81. Hypotenuse In Action
- 5.82. Spaceship Always False
- 5.83. Inverted Spaceship Results
- 5.84. isset(), empty() And the Magic Methods
- 5.85. Comparing Arrays And Object
- 5.86. Mixed Compatibility
- 5.87. Where Did The Comma Go?
- 5.88. Argument Renaming
- 5.89. When htmlemtities() Is Failing
- 5.90. Static Arrow Function
- 5.91. defined() In Action
- 5.92. expm1() And log1p()
- 5.93. Is A Class Constant Set?
- 5.94. preg_split() Magic
- 5.95. Comparing NAN
- 5.96. array_unique() And Enum
- 5.97. Display A Tree Natively
- 5.98. Speed Up CSV Write To Disk
- 5.99. php://memory And Maxmemory
- 5.100. ::parent Operator
- 5.101. Stuttering PHP
- 5.102. Riddle: $this<-code
- 5.103. Multiple Const Types
- 5.104. Replacing PHP http Wrapper
- 5.105. Cast But Not A Cast
- 5.106. Hexadecimal Separator
- 5.107. Call echo With Commas
- 5.108. Reusing Decimals For Bananas
- 5.109. Where To Put The Cast?
- 5.110. Unpacking A Single Element Array
- 5.111. Abstract Or Not
- 5.112. (int) And (ant)
- 5.113. Cast In Const
- 5.114. global Overwrites
- 5.115. Property Hooks And Default Values
- 5.116. Static And Not Static Method
- 5.117. intval() And Its Arguments
- 5.118. Easy Map
- 5.119. Returning Void
- 5.120. Casting An Enum Case
- 5.121. Dynamic Class Constant Edge Cases
- 5.122. Dynamic Enum Cases
- 5.123. Yield And Keys
- 5.124. Array Callback Index
- 5.125. Time Of Closure Creation
- 5.126. Coalesce And The Fatal Error
- 5.127. Weakmap And Enums
- 5.128. parent In Function
- 5.129. isset() And The Fatal Error
- 5.130. All PHP Dereferencements
- 5.131. No Property Beyond Limits
- 5.132. Can't Be Compatible With Less Arguments
- 5.133. Arrow Functions Import Variables By Values
- 5.134. Never Is The Lowest Ranking Type
- 5.135. The Never Function Arrow
- 5.136. No Rewrite For Exit
- 5.137. Alias Conflicts
- 5.138. Not All Incremented Strings Are Deprecated
- 5.139. get_class() Or ::class?
- 5.140. No Binding But With Original
- 5.141. Infinite foreach()
- 5.142. Who Modifies This Property?
- 5.143. mixed Is Not No Type
- 5.144. The Recursive array_merge()
- 5.145. $GLOBALS Is Not Defined
- 5.146. Cast Private To Array
- 5.147. Properties In Interfaces
- 5.148. Bitwise Operations On String
- 5.149. Typed Variables
- 5.150. Type And Reference
- 5.151. Chaining Spaceship
- 5.152. parse_str() Edge Cases
- 5.153. Cast A Closure To Array
- 5.154. list() Does Not Type
- 5.155. Triple Plus Operator
- 5.156. Function Name In A Method
- 5.157. PHP Quine
- 5.158. Named Parameter In An Array
- 5.159. self Is A Valid Type On A Closure
- 5.160. Keep Interface New Argument Compatible
- 5.161. Undefined Constant A On Its Line Of Definition
- 5.162. http_build_query() And Enumerations
- 5.163. Cannot indirectly modify readonly
- 5.164. Ellipsis And Coalesce
- 5.165. namespace namespace
- 5.166. Namespace, But Far In The Name
- 5.167. No Hidden Nullable
- 5.168. Remove Last Item In An Array
- 5.169. Cancelling Native Function
- 5.170. Classes Constant Disambiguation With Parenthesis
- 5.171. compact() Is Recursive
- 5.172. No Final Parameter
- 5.173. Is Not A NAN
- 5.174. Impossible Named Arguments
- 5.175. func_get_args() Skips Variadic
- 5.176. Ellipsis With Array Parameters
- 5.177. Named Parameter Inheritance
- 5.178. __invoke() On New
- 5.179. Method Or Property?
- 5.180. No More Class _
- 5.181. Method Not Property Name Must Be String
- 5.182. Static Properties
- 5.183. The New And The Parenthesis
- 5.184. Fluent Function
- 5.185. Cannot Use Isset On Expression, So Use What?
- 5.186. Constant Redefinition
- 5.187. No Class Constant In String
- 5.188. Return Int Not Bool
- 5.189. By Reference, Error Or Notice?
- 5.190. Call Function With Strings
- 5.191. Non Empty Match
- 5.192. Named Sqlite3 In Memory
- 5.193. Variable Creation
- 5.194. All Enum Cases
- 5.195. Unicode Comments
- 5.196. Datetime Object, And Years
- 5.197. Escaping A Regex
- 5.198. Every Anonymous Class Is Different
- 5.199. instanceof With Variables
- 5.200. Undefined Variable
- 5.201. Compatible Signature
- 5.202. private Is Relaxed
- 5.203. Class Implement No More
- 5.204. Variadic Are Typed And Defaulted
- 5.205. array_column() To Hash
- 5.206. \array Was Customizable
- 5.207. array Is Not An Array
- 5.208. array_map_assoc() With Keys
- 5.209. array_map() Goes Full Throttle
- 5.210. Typed Array
- 5.211. Initialize Readonly On Child
- 5.212. Silent Optimisation Of Variables
- 5.213. Modify String With Array Syntax
- 5.214. No Force Object To String
- 5.215. __invoke() Method And Properties
- 5.216. Constructor Needed
- 5.217. No Self Referencing Constants
- 5.218. Deanonymize Class
- 5.219. Noscream On Ellipsis
- 5.220. Incompatible Promoted Readonly
- 5.221. Where Is The Semicolon?
- 5.222. Self As Attribute
- 5.223. Reading Micro-seconds
- 5.224. Promoted Properties Compatibility
- 5.225. Enum Are Not Linted
- 5.226. Sorting With Minus
- 5.227. Override With Interface
- 5.228. Send An Argument To Generator
- 5.229. PHP Integer Format
- 5.230. Compatible Only Interface
- 5.231. No Cast In Constant Expressions
- 5.232. Lots Of Silly Arguments
- 5.233. Child Of Attribute Is Not An Attribute
- 5.234. Dynamic Class Constant
- 5.235. The Function Method
- 5.236. Match() With Multiple Values
- 5.237. Interfaces Constants Conflicts
- 5.238. Foreach() Skips Uninitialized Properties
- 5.239. Casting And Power
- 5.240. Attribute Without Class
- 5.241. Class Is A Valid Type
- 5.242. Float Precision
- 5.243. Store Float As Index
- 5.244. Case Insensitive Cast
- 5.245. $this $this
- 5.246. No Returntype But Still, Only String
- 5.247. No Unknown For array_merge()
- 5.248. No Returntype Enforced
- 5.249. As As As
- 5.250. No DNF For Catch
- 5.251. new On Object
- 5.252. Unfinished Class Doesn't Compile
- 5.253. Yield, Not Return By Reference
- 5.254. class_exists() With Enums
- 5.255. No Semicolon In Sight
- 5.256. glob() With Hidden Files
- 5.257. A Function Called file_append_contents()
- 5.258. array_reduce() To Filter And Alter
- 5.259. $this Is Not Of The Current Class
- 5.260. Class Constants With Different Types
- 5.261. No Change To $this
- 5.262. file_put_contents() With Array Argument
- 5.263. Get The Generator
- 5.264. Redefine Native Functions
- 5.265. A Static Method Cannot Call A Non Static Method
- 5.266. Declared Before Or After
- 5.267. Cast Is So Strong
- 5.268. Roman Loops
- 5.269. Finally Catches Exception
- 5.270. Always Compatible Variadic
- 5.271. Yield, Not Return
- 5.272. try, catch, finally Are All Optional
- 5.273. null Or Boolean As Array
- 5.274. Hide Sensitive Parameter
- 5.275. No Property In Interface
- 5.276. The Uncallable Function
- 5.277. Easy Wither Call
- 5.278. Array Is Full
- 5.279. Const Without Parenthesis
- 5.280. Cast Are Case Insensitive
- 5.281. Array And Object Syntax, Not The Same Error
- 5.282. When Space Matters
- 5.283. array array = array()
- 5.284. Cannot Yield And Never
- 5.285. Class Invasion Both Ways
- 5.286. Typed By Enum
- 5.287. Change A Static Variable Outside Its Function
- 5.288. Scalar Types Are Unqualified
- 5.289. array_append() And Short Assignation
- 5.290. Coalesce And Null
- 5.291. All Classes Aliases
- 5.292. Mixed And Untyped Are Not Compatible Types
- 5.293. Abstract Constants
- 5.294. Cannot Static Static Property
- 5.295. More Attribute Usage
- 5.296. Run Any Script In A Phar
- 5.297. Static Variable Outside A Method
- 5.298. Enumeration's Cases Comparisons
- 5.299. All Static Curly Syntaxes And One Wrong
- 5.300. No Such Function As Empty
- 5.301. Strange --> Operator
- 5.302. Unexpected Keys In Array
- 5.303. Recursive Generator
- 5.304. Documenting Parameters
- 5.305. Catch Is Optional
- 5.306. Void Parameter In array_keys()
- 5.307. Unsetting Properties Surprises
- 5.308. Multiple Aliases
- 5.309. Plus Plus Minus Minus
- 5.310. Constants Can Be Impossible
- 5.311. Constants Are Mutable
- 5.312. Quick DTO Or VO Copy
- 5.313. Stealth Generator
- 5.314. Quick Serialize
- 5.315. Clone Clone Clone
- 5.316. Set readonly Properties Outside The Class
- 5.317. Exception Polymorphism
- 5.318. Exponential Minus One
- 5.319. PHP Infinity Is Reachable
- 5.320. Negative Squares
- 5.321. Negating An Assignation
- 5.322. Numeric Separators Inside A String?
- 5.323. Identifier Confusions
- 5.324. Relaxed Syntax With Const
- 5.325. Closure To Call
- 5.326. Get $this In A Static
- 5.327. How To array_intersect_uassoc_insensitive()
- 5.328. Class And Constant Confusion
- 5.329. Don't Forget To Yield
- 5.330. Inconsistent Constructor Signatures
- 5.331. foreach() With All The Same Keys
- 5.332. Battle Of Definition
- 5.333. Variadic All The Yields
- 5.334. Refactoring strpos()
- 5.335. is_a() Versus Instanceof
- 5.336. Exporting Properties
- 5.337. Another Cast To Int
- 5.338. ReturnTypeWillChange Is For All
- 5.339. URL As Comments
- 5.340. Coalesce And Assignation
- 5.341. Missing Methods Are Fatal
- 5.342. Only Initialize With Short Assignation Coalesce
- 5.343. Keys Are Integers Whenever Possible
- 5.344. Fast Creation Of stdClass Objects
- 5.345. An Elephpant In The Code
- 5.346. Internal Static Call
- 5.347. strict_types Exceptions
- 5.348. Playing With Integers Limits
- 5.349. Signature Compatibility Exception
- 5.350. Object Is Not A Type
- 5.351. Forgotten Throw
- 5.352. Keywords In Namespaces
- 5.353. No Warning For Unused Variables
- 5.354. Self In An Interface
- 5.355. instanceof Object
- 5.356. stdClass Object
- 5.357. A Case Of Misplaced Parenthesis
- 5.358. Checking For Names At Different Times
- 5.359. Integer Becomes Negative
- 5.360. Not All Strings In Arrays
- 5.361. Recursive Arrow Function
- 5.362. null Does Not Always Equal false
- 5.363. Recursive Closure
- 5.364. Cast Precedence
- 5.365. Enum As A Name
- 5.366. Type Is Not Always Returned
- 5.367. The Namespace Stack
- 5.368. Catch On Interfaces