/
2011-07-25-php_turtles.html
818 lines (706 loc) · 20.5 KB
/
2011-07-25-php_turtles.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
---
layout: post
title: 'PHP turtles: a list of things you might not know about PHP'
permalink: '/wtf/php.html'
tags: ['php', 'wtf']
---
<link href="/prettify/prettify.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="/prettify/prettify.js"></script>
<script type="text/javascript" src="/jquery-1.7.1.min.js"></script>
<div class="hero-unit">
<h1>PHP turtles</h1>
<p>Turtles all the way down.</p>
<div>
<ol>
<li><a href="#turtle01">operator precedence</a></li>
<li><a href="#turtle02">calling instance methods in static context</a></li>
<li><a href="#turtle03">can't call future constructor</a></li>
<li><a href="#turtle04">redefine private methods</a></li>
<li><a href="#turtle05">__construct is just another method</a></li>
<li><a href="#turtle06">curl_multi_exec</a></li>
<li><a href="#turtle07">can't trust ==</a></li>
<li><a href="#turtle08">can't trust <</a></li>
<li><a href="#turtle09">funny increments</a></li>
<li><a href="#turtle10">can't trust get_class()</a></li>
<li><a href="#turtle11">constructor does not get called, but destructor sure does</a></li>
<li><a href="#turtle12" style="text-decoration: line-through">inflexible type hints</a></li>
<li><a href="#turtle13">to count or not to count</a></li>
<li><a href="#turtle14">error messages</a></li>
<li><a href="#turtle15">protected, not really</a></li>
<li><a href="#turtle16">hard to predict iterators</a></li>
<li><a href="#turtle17">non-transitive comparison</a></li>
<li><a href="#turtle18">setting CURLOPT_SSL_VERIFYHOST to true disables certificate validation</a></li>
<li><a href="#links">more stuff...</a></li>
</ol>
</div>
</div>
<section id="turtle01">
<div class="page-header">
<h1>turtle 1: operator precedence</h1>
</div>
<p>
You would think that PHP's operators are based on C's. Unfortunately there are subtle differences.
I usually end up abusing '(' and ')' in my expressions. For example, the following pieces of similar
PHP and C code don't output the same result!
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
echo 1 ? 2 : 3 ? 4 : 5;</pre>
<a onclick="$(event.target).hide();$('#turtle01output01').fadeIn()">(click to see output)</a>
<pre id="turtle01output01" style="display: none;">> 4</pre>
</div>
</div>
<div>
<h3>C code</h3>
<div>
<pre class="prettyprint linenums">#include <stdio.h>
int main() {
printf("f=%d\n", 1 ? 2 : 3 ? 4 : 5);
return 0;
}</pre>
<a onclick="$(event.target).hide();$('#turtle01output02').fadeIn()">(click to see output)</a>
<pre id="turtle01output02" style="display: none;">> 2</pre>
</div>
</div>
</section>
<section id="turtle02">
<div class="page-header">
<h1>turtle 2: calling instance methods in static context</h1>
</div>
<p>
Not a huge deal, since this can easily be solved with a linter.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class A {
public function printName() {
echo 'I am:', get_class($this), "\n";
}
public function foo() {
return A::printName();
}
}
class B {
public function foo() {
A::printName();
}
}
$a = new A();
$a->foo();
$b = new B();
$b->foo();</pre>
<a onclick="$(event.target).hide();$('#turtle02output01').fadeIn()">(click to see output)</a>
<pre id="turtle02output01" style="display: none;">> I am: A
> I am: B</pre>
</div>
</div>
</section>
<section id="turtle03">
<div class="page-header">
<h1>turtle 3: can't call future constructor</h1>
</div>
<p>Can lead to bugs as code changes over time.</p>
<div>
<h3>PHP code</h3>
<pre class="prettyprint linenums"><?php
class A {
}
class B extends A {
public function __construct() {
// make sure parent constructor gets called if someone adds one
parent::__construct();
}
}
new B();</pre>
<a onclick="$(event.target).hide();$('#turtle03output01').fadeIn()">(click to see output)</a>
<pre id="turtle03output01" style="display: none;">> Fatal PHP Fatal error: Can not call constructor in…</pre>
</div>
</section>
<section id="turtle04">
<div class="page-header">
<h1>turtle 4: redefine private methods</h1>
</div>
<p>It's debatable what's the right thing to do. PHP's design decision isn't unreasonable in this case.</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class A {
private function foo() {
return 'foo in A';
}
public function bar() {
echo $this->foo(), "\n";
}
}
class B extends A {
private function foo() {
return 'foo in B';
}
public function bar2() {
echo $this->foo(), "\n";
}
}
$b = new B();
$b->bar2();
$b->bar();</pre>
<a onclick="$(event.target).hide();$('#turtle04output01').fadeIn()">(click to see output)</a>
<pre id="turtle04output01" style="display: none;">> foo in B
> foo in A</pre>
</div>
</div>
</section>
<section id="turtle05">
<div class="page-header">
<h1>turtle 5: __construct is just another method</h1>
</div>
<p>
Unless you are writing at the compiler/framework layer, calling
__construct and __destruct behaves like just any methods and does
not cause you to allocate or free any memory.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class A {
public $v;
public function __construct($v) {
$this->v = $v;
}
}
$a = new A(42);
$b = range(0, 9);
for ($i=0; $i<10; $i++) {
$b[$i] = $a->__construct($i);
echo 'memory:', memory_get_usage(), "\n";
}</pre>
<a onclick="$(event.target).hide();$('#turtle05output01').fadeIn()">(click to see output)</a>
<pre id="turtle05output01" style="display: none;">> memory: 629952
> memory: 629952
> memory: 629952
> memory: 629952
> …</pre>
</div>
</div>
</section>
<section id="turtle06">
<div class="page-header">
<h1>turtle 6: curl_multi_exec</h1>
</div>
<p>curl_multi_exec does not affect curl_errno(), but it does affect the return value of curl_error().</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$c = curl_init('http://www.google.com:443/');
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$mh = curl_multi_init();
curl_multi_add_handle($mh,$c);
$active = null;
do {
$mrc = curl_multi_exec($mh, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM || $active);
$r = curl_multi_info_read($mh);
echo $r['result'], "\n";
echo curl_errno($c), "\n";
echo curl_error($c), "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle06output01').fadeIn()">(click to see output)</a>
<pre id="turtle06output01" style="display: none;">> 52
> 0
> Empty reply from server</pre>
</div>
</div>
</section>
<section id="turtle07">
<div class="page-header">
<h1>turtle 7: can't trust ==</h1>
</div>
<p>You can't trust ==, even when you know the types are going to match.</p>
<p>credits: erling</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
echo (int)(" 4" == " 4"), "\n";
echo (int)(" 4 " == " 4 "), "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle07output01').fadeIn()">(click to see output)</a>
<pre id="turtle07output01" style="display: none;">> 1
> 0</pre>
</div>
</div>
</section>
<section id="turtle08">
<div class="page-header">
<h1>turtle 8: can't trust <</h1>
</div>
<p>< and > can do weird things when there's a type mismatch.</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
echo (int)(null > -1), "\n";
echo (int)(null < 1), "\n";
echo (int)(null == 0), "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle08output01').fadeIn()">(click to see output)</a>
<pre id="turtle08output01" style="display: none;">> 0
> 1
> 1</pre>
</div>
</div>
</section>
<section id="turtle09">
<div class="page-header">
<h1>turtle 9: funny increments</h1>
</div>
<p>In general, I have tried to avoid critizing PHP's API, however this one deserves to be listed.</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$x = "x";
$x++; $x++; $x++;
echo $x, "\n";
$x--; $x--; $x--;
echo $x, "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle09output01').fadeIn()">(click to see output)</a>
<pre id="turtle09output01" style="display: none;">> aa
> aa</pre>
</div>
</div>
<br/>
<div>
<p>And another weird case:</p>
<div>
<pre class="prettyprint linenums"><?php
$x = null;
var_dump(--$x);
var_dump(++$x);</pre>
<a onclick="$(event.target).hide();$('#turtle09output02').fadeIn()">(click to see output)</a>
<pre id="turtle09output02" style="display: none;">> NULL
> int(1)</pre>
</div>
</div>
<br/>
<div>
<p>When you combine with <, you end up with fun things:</p>
<div>
<pre class="prettyprint linenums"><?php
$x = 'y';
echo (int)($x < 'yy'), "\n";
$x++;
echo (int)($x < 'yy'), "\n";
$x++;
echo (int)($x < 'yy'), "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle09output03').fadeIn()">(click to see output)</a>
<pre id="turtle09output03" style="display: none;">> 1
> 0
> 1</pre>
</div>
</div>
</section>
<section id="turtle10">
<div class="page-header">
<h1>turtle 10: can't trust get_class()</h1>
</div>
<p>
Note: this behavior is documented in the manual. Why would anyone go out of their way
to implement this behavior?</p>
<p>credits: jfrank</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class A { }
class Foo {
public static function bar($x) {
echo get_class($x), "\n";
}
}
Foo::bar(new A());
Foo::bar(null);</pre>
<a onclick="$(event.target).hide();$('#turtle10output01').fadeIn()">(click to see output)</a>
<pre id="turtle10output01" style="display: none;">> A
> Foo</pre>
</div>
</div>
</section>
<section id="turtle11">
<div class="page-header">
<h1>turtle 11: constructor does not get called, but destructor sure does</h1>
</div>
<p>This caused us hours in debugging time. Things were eventually fixed in php 5.3.x.</p>
<p>credits: pgriess</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class Foo {
public function __construct($a) {
echo 'Foo::__construct()',"\n";
}
public function __destruct() {
echo 'Foo::__destruct()',"\n";
}
}
function blah() {
throw new Exception();
}
try {
$f = new Foo(blah());
} catch (Exception $e){
}</pre>
<a onclick="$(event.target).hide();$('#turtle11output01').fadeIn()">(click to see output)</a>
<pre id="turtle11output01" style="display: none;">> Foo::__destruct()</pre>
</div>
</div>
</section>
<section id="turtle12">
<div class="page-header">
<h1 style="text-decoration: line-through">turtle 12: inflexible type hints</h1>
</div>
<p>Note: Removed, since this only applies to hphp.</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class Stringy {
public function __toString() {
return "I am Stringy";
}
}
function foo(string $s) {
echo $s.' is a string';
}
foo(new Stringy());</pre>
<a onclick="$(event.target).hide();$('#turtle12output01').fadeIn()">(click to see output)</a>
<pre id="turtle12output01" style="display: none;">> Catchable fatal error: Argument 1 passed to foo() must be an instance of string, instance of Stringy given</pre>
</div>
</div>
</section>
<section id="turtle13">
<div class="page-header">
<h1>turtle 13: to count or not to count</h1>
</div>
<p>
Reference counting based garbage collectors have lots of pros and some cons. The pros are that it's usually
simpler to implement and runs faster. The cons can usually be worked around & ignored in the context
of web applications.
</p>
<p>
In PHP, the concept of references is exposed to the programmer, which can lead to various nasty bugs,
as shown by the following example.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
function foo() {
$i = 1;
return array(&$i);
}
function bar() {
$i = 1;
return array(&$i, &$i);
}
$a = foo();
$b = $a;
$a[0] = 2;
echo $b[0], "\n";
$a = bar();
$b = $a;
$a[0] = 2;
echo $b[0], "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle13output01').fadeIn()">(click to see output)</a>
<pre id="turtle13output01" style="display: none;">> 1
> 2</pre>
</div>
</div>
<br/>
<p>Similarly, the following code's output is hard to predict:</p>
<p>credits: julienv</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
function foo($x) {
$x[0] = 42;
}
$a = array(1);
$b = array(&$a[0]);
foo($b);
$c = array(1);
$d = array(&$c[0]);
$c=0;
foo($d);
echo $b[0], "\n";
echo $d[0], "\n";</pre>
<a onclick="$(event.target).hide();$('#turtle13output02').fadeIn()">(click to see output)</a>
<pre id="turtle13output02" style="display: none;">> 42
> 1</pre>
</div>
</div>
<p>And another case where the fact that $a is pointed to leaks:</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$a = array(); $b = array();
$c = &$b;
$a[] = 1; $b[] = 1;
unset($a[0]); unset($b[0]);
$c = $a; $c = $b;
$a[] = 2; $b[] = 2;
print_r($a); print_r($b);
</pre>
<a onclick="$(event.target).hide();$('#turtle13output03').fadeIn()">(click to see output)</a>
<pre id="turtle13output03" style="display: none;">> Array
> (
> [1] => 2
> )
> Array
> (
> [0] => 2
> )</pre>
</div>
</div>
<p>You can accidentally run into this when using foreach loops:</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$a = array(1); $b = array(1);
foreach ($a as $value) {}
foreach ($b as &$value) {}
$x = $a; $y = $b;
$x[0] = 'a'; $y[0] = 'a';
print_r($a); print_r($b);
</pre>
<a onclick="$(event.target).hide();$('#turtle13output04').fadeIn()">(click to see output)</a>
<pre id="turtle13output04" style="display: none;">> Array
> (
> [0] => 1
> )
> Array
> (
> [0] => a
> )</pre>
</div>
</div>
</section>
<section id="turtle14">
<div class="page-header">
<h1>turtle 14: error messages</h1>
</div>
<p>
The error messages you get sometimes don't make sense. It's however not a big issues, since
Googling around will quickly help you figure out what's going on.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
::</pre>
<a onclick="$(event.target).hide();$('#turtle14output01').fadeIn()">(click to see output)</a>
<pre id="turtle14output01" style="display: none;">> Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM…</pre>
</div>
<br/>
<div>
<pre class="prettyprint linenums"><?php
function foo(string $s){}
foo("hello world");</pre>
<a onclick="$(event.target).hide();$('#turtle14output02').fadeIn()">(click to see output)</a>
<pre id="turtle14output02" style="display: none;">> Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given…</pre>
</div>
<br/>
<div>
<pre class="prettyprint linenums"><?php
$x =
?></pre>
<a onclick="$(event.target).hide();$('#turtle14output03').fadeIn()">(click to see output)</a>
<pre id="turtle14output03" style="display: none;">> PHP Parse error: syntax error, unexpected ';'</pre>
</div>
</div>
</section>
<section id="turtle15">
<div class="page-header">
<h1>turtle 15: protected, not really</h1>
</div>
<p>
PHP's handling of the protected visibiltiy on method is counter intuitive in many ways. Here is one example.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
class A {
public static function f1() {
$b = new B();
$b->f2();
}
}
class B extends A {
protected function f2() {
echo "protected method\n";
}
}
A::f1();
</pre>
<a onclick="$(event.target).hide();$('#turtle15output01').fadeIn()">(click to see output)</a>
<pre id="turtle15output01" style="display: none;">> protected method</pre>
</div>
</div>
</section>
<section id="turtle16">
<div class="page-header">
<h1>turtle 16: hard to predict iterators</h1>
</div>
<p>
PHP has two ways to deal with array iterators. In some cases, foreach uses an array's internal iterator, in other
cases it uses an external iterator. This can lead to confusing code.
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$x = range(4, 10);
foreach ($x as $v) {
echo key($x),",", current($x), " ";
}
echo "\n";
$x = range(4, 10);
$y = $x;
foreach ($x as $v) {
echo key($x),",", current($x), " ";
}
echo "\n";
$x = range(4, 10);
$y = &$x;
foreach ($x as $v) {
echo key($x),",", current($x), " ";
}
echo "\n";
</pre>
<a onclick="$(event.target).hide();$('#turtle16output01').fadeIn()">(click to see output)</a>
<pre id="turtle16output01" style="display: none;">> 1,5 1,5 1,5 1,5 1,5 1,5 1,5
> 0,4 0,4 0,4 0,4 0,4 0,4 0,4
> 1,5 2,6 3,7 4,8 5,9 6,10 , </pre>
</div>
</div>
</section>
<section id="turtle17">
<div class="page-header">
<h1>turtle 17: non-transitive comparison</h1>
</div>
<p>
PHP's <a href="http://php.net/manual/en/function.sort.php">sort</a> documentation warns about
sorting arrays with mixed types. Most dynamically typed languages have some sort of similar quirk.
Here is an overview of PHP's:
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
function is_sorted($a) {
$t = $a;
sort($a);
return $t === $a;
}
function is_really_sorted($a) {
$t = $a;
sort($a);
sort($a);
return $t === $a;
}
$a = array('a', 0);
sort($a);
echo (int)is_sorted($a), "\n";
echo (int)is_really_sorted($a), "\n";
</pre>
<a onclick="$(event.target).hide();$('#turtle17output01').fadeIn()">(click to see output)</a>
<pre id="turtle17output01" style="display: none;">> 0
> 1</pre>
</div>
</div>
<br/>
<p>
Another, simpler, example:
</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$a = array('a', 0, 'a', 0);
sort($a);
print_r($a);
</pre>
<a onclick="$(event.target).hide();$('#turtle17output02').fadeIn()">(click to see output)</a>
<pre id="turtle17output02" style="display: none;">> Array
> (
> [0] => 0
> [1] => a
> [2] => 0
> [3] => a
> )</pre>
</div>
</div>
</section>
<section id="turtle18">
<div class="page-header">
<h1>turtle 18: setting CURLOPT_SSL_VERIFYHOST to true disables certificate validation</h1>
</div>
<p>
Curl's CURLOPT_SSL_VERIFYHOST takes an integer, with 1 being a partial check.
</p>
<p>This was fixed in cURL 7.28.1. Setting the option to 1 is equivalent to setting it to 2.</p>
<div>
<h3>PHP code</h3>
<div>
<pre class="prettyprint linenums"><?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://alok.quaxio.com/");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$r = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
}
print_r($r);
</pre>
<a onclick="$(event.target).hide();$('#turtle18output01').fadeIn()">(click to see output)</a>
<pre id="turtle18output01" style="display: none;">> HTTP/1.1 200 OK
> Content-Type: text/html
> Accept-Ranges: bytes
> ETag: "3176198254"
> Last-Modified: Mon, 13 May 2013 17:44:31 GMT
> Content-Length: 88
> Date: Fri, 17 Oct 2014 16:49:04 GMT
> Server: lighttpd/1.4.35
>
> <html>
> <body>
> <a href="http://quaxio.com/">Alok Menghrajani's stuff</a>
> </body>
> </html></pre>
</div>
</div>
</section>
<section id="links">
<div class="page-header">
<h1>more stuff</h1>
</div>
<ul>
<li><a href="http://www.reddit.com/r/lolphp">http://www.reddit.com/r/lolphp</a></li>
<li><a href="http://phpsadness.com/">http://phpsadness.com/</a></li>
<li><a href="http://www.phpwtf.org/">http://www.phpwtf.org/</a></li>
<li><a href="http://wiki.theory.org/YourLanguageSucks#PHP_sucks_because%3A">http://wiki.theory.org/YourLanguageSucks</a></li>
<li><a href="http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/">PHP: a fractal of bad design</a></li>
</section>
<script>
prettyPrint();
</script>