Michael Heap
June 09, 2017
230

# Don’t believe everything you learn - PHPSouthCoast

A minute always has 60 seconds, right? Wrong! Ok, but a country always has a capital city, right? Wrong again!

Come and join us for a lighthearted talk about some of the common falsehoods that developers believe which cause issues in real, production systems. We’ll cover the classics like timezones and names, as well as some new contenders such as geography and software versions.

June 09, 2017

## Transcript

7. ### @mheap The number of days in every month starts with

a 3, so either 30 or 31?
8. ### @mheap The number of days in every month starts with

a 3, so either 30 or 31? February has 28
9. ### #phpsc17 Each month always has the same number of days

every year though?
10. ### #phpsc17 Each month always has the same number of days

every year though? February has 29 in leap years

years
12. ### @mheap But we can calculate leap years. They’re every four

years Unless it’s divisible by 100
13. ### #phpsc17 But we can calculate leap years. They’re every four

years (Unless it’s divisible by 100)
14. ### #phpsc17 But we can calculate leap years. They’re every four

years (Unless it’s divisible by 100) If it divides by 100 and 400, it is a leap year

Sweden
17. ### #phpsc17 February is 28 or 29 days February the 30th

doesn’t exist
18. ### #phpsc17 February is 28 or 29 days February the 30th

doesn’t exist Unless you’re Sweden
19. ### #phpsc17 February is 28 or 29 days February the 30th

doesn’t exist
20. ### #phpsc17 February is 28 or 29 days February the 30th

doesn’t exist Or the Soviet Union

22. ### @mheap A month starts and ends in the same year

Not in ancient Rome

24. ### @mheap A month starts and ends in the same year

Or a modern Ethiopia

26. ### #phpsc17 Excluding DST, time always goes forwards Shanghai, 1927 1927-12-31

23:54:08 happened twice

same
31. ### #phpsc17 The offsets between two timezones will always be the

same 10 changes in 2016 2 changes so far in 2017

33. ### @mheap Timezones are always +/- an integer number of hours

Afghanistan, +04:30 New Zealand (Chatham Islands), +12:45

Time

37. ### @mheap If they do change, there’ll be plenty of notice

North Korea, 2015 8 days notice of a 30 minute change

40. ### @mheap There are always 24 hours in a day Daylight

Savings Time Means 23 or 25 hours in a day

42. ### #phpsc17 Is the time 23:59:60 invalid? Leap seconds A minute

can have 61 seconds

44. ### @mheap A child will have the same surname as either

their mother or father (or both)
45. ### @mheap A child will have the same surname as either

their mother or father (or both) Not in Iceland

47. ### #phpsc17 People have at least 2 names Teller (of Penn

& Teller fame) Akihito (Emperor of Japan)

55. ### @mheap For every rule, there are guaranteed to be exceptions

No spaces Van Buren

57. ### @mheap For every rule, there are guaranteed to be exceptions

Only letters O’Reilly

59. ### @mheap For every rule, there are guaranteed to be exceptions

One capital letter McDonald

⽑毛泽东

65. ### @mheap I can safely assume that this list of bad

words has no names in it
66. ### @mheap I can safely assume that this list of bad

words has no names in it Ever been to Middlesex?
67. ### @mheap I can safely assume that this list of bad

words has no names in it
68. ### @mheap I can safely assume that this list of bad

words has no names in it Eaten shittake mushrooms?
69. ### @mheap I can safely assume that this list of bad

words has no names in it
70. ### @mheap I can safely assume that this list of bad

words has no names in it Been named Craig Cockburn?
71. ### @mheap I can safely assume that this list of bad

words has no names in it
72. ### @mheap I can safely assume that this list of bad

words has no names in it Linda Callahan?
73. ### @mheap I can safely assume that this list of bad

words has no names in it

77. ### @mheap Did you hear about planning permission emails bouncing? Erection

of a structure

TS4 2HT

TS4 2HT
85. ### #phpsc17 If the addresses on the left are even, addresses

on the right must be odd
86. ### #phpsc17 If the addresses on the left are even, addresses

on the right must be odd Seine-Saint-Denis, France Even numbers on both sides, no odds

88. ### @mheap You can omit leading zeros 101 Alma St, Palo

Alto Apartments 1 and 001 on different floors.

90. ### #phpsc17 A street name won't include a number 8 Seven

Gardens Burgh, Woodbridge, IP13 6SU

in a country
94. ### #phpsc17 You can’t have two towns/cities with the same name

in a country The UK has three places named Newport

96. ### @mheap Those cities don’t have duplicate street names 10 High

Street, Newport, PO30 1SS 10 High Street, Newport, NP20 1FQ 10 High Street, Newport, TF10 7AN

98. ### #phpsc17 Street names will be reasonably short Aleja Alije Izetbegovića

Prvig Predsjednika Predsjedništva Republika Bosna i Hercegovina

100. ### @mheap A building has a single postcode DVLA Swansea: V5Cs

are processed at SA99 1BA, Driving licences at SA99 1AB

104. ### @mheap Concrete buildings are a fixed point in space In

Zürich, a 6200 ton building was moved by 60 meters to make way for railway tracks

107. ### #phpsc17 Do all countries have a capital city? Switzerland does

not. The government is currently in Bern, but the city is not the capital

110. ### #phpsc17 A product has one price Price with tax, price

without tax, sale price, list price, minimum price

112. ### @mheap A product has a price Products sold on auction

sites do not have a price until it’s sold

114. ### #phpsc17 Currencies symbols uniquely identify a currency The peso and

dollar sign \$ is used by many countries

116. ### @mheap Currencies have a unicode symbol that represents them The

Swiss franc does not Until 2010, neither did the Indian rupee

118. ### #phpsc17 Currencies symbols uniquely identify a currency The peso and

dollar sign \$ is used by many countries

123. ### #phpsc17 The currency symbol always precedes the amount e.g. £1.50

1.50€ in Spain

125. ### @mheap The currency symbol always precedes or follows the amount

1€50 in France

127. ### The network is reliable. Latency is zero. Bandwidth is infinite.

The network is secure. Topology doesn't change. There is one administrator. Transport cost is zero. The network is homogeneous.
128. ### (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[

\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000- \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\ ["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?: \r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\ [([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)? [ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?: (?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\ [\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?: (?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)? [ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\". \[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\ [\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\] (?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\ [\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?: \r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?: \r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)? [ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\ \".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)? [ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\ \".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z| (?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\ \.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)? (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000- \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\ \.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*))*)?;\s*)