File: http-www.digitalsandwich.com-feeds-index.rss2

package info (click to toggle)
php-horde-feed 2.0.4-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 6,608 kB
  • sloc: xml: 21,667; php: 786; jsp: 410; perl: 231; sh: 3; makefile: 2
file content (433 lines) | stat: -rw-r--r-- 88,798 bytes parent folder | download | duplicates (4)
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
<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Digital Sandwich</title>
    <link>http://www.ds-o.com/</link>
    <description>PHP, Music, and other stuff</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2 - http://www.s9y.org/</generator>
    <pubDate>Fri, 06 Jun 2008 13:35:39 GMT</pubDate>

    <image>
        <url>http://www.ds-o.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Digital Sandwich - PHP, Music, and other stuff</title>
        <link>http://www.ds-o.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>2008 DC PHP Conference - Advanced PHPUnit Testing</title>
    <link>http://www.ds-o.com/archives/74-2008-DC-PHP-Conference-Advanced-PHPUnit-Testing.html</link>
            <category>PHP Testing</category>
    
    <comments>http://www.ds-o.com/archives/74-2008-DC-PHP-Conference-Advanced-PHPUnit-Testing.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=74</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=74</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;And here are the advanced PHPUnit slides!&lt;/p&gt;
&lt;div id=&quot;__ss_446619&quot; style=&quot;width: 425px; text-align: left;&quot;&gt;&lt;object width=&quot;425&quot; height=&quot;355&quot; style=&quot;margin: 0px;&quot;&gt;&lt;param value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=advanced-php-unit-testing2-1212587249704441-9&quot; name=&quot;movie&quot; /&gt;&lt;param value=&quot;true&quot; name=&quot;allowFullScreen&quot; /&gt;&lt;param value=&quot;always&quot; name=&quot;allowScriptAccess&quot; /&gt;&lt;embed width=&quot;425&quot; height=&quot;355&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; type=&quot;application/x-shockwave-flash&quot; src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=advanced-php-unit-testing2-1212587249704441-9&quot; /&gt;&lt;/object&gt;&lt;div style=&quot;font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;&quot;&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=211&amp;amp;entry_id=74&quot; title=&quot;http://www.slideshare.net/?src=embed&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;&lt;img alt=&quot;SlideShare&quot; style=&quot;border: 0px none ; margin-bottom: -5px;&quot; src=&quot;http://static.slideshare.net/swf/logo_embd.png&quot; /&gt;&lt;/a&gt; | &lt;a title=&quot;View Advanced PHPUnit Testing on SlideShare&quot; href=&quot;http://www.ds-o.com/exit.php?url_id=212&amp;amp;entry_id=74&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/mjlivelyjr/advanced-phpunit-testing?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;View&lt;/a&gt; | &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=213&amp;amp;entry_id=74&quot; title=&quot;http://www.slideshare.net/upload?src=embed&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/upload?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Upload your own&lt;/a&gt;&lt;/div&gt;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Wed, 04 Jun 2008 09:55:41 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/74-guid.html</guid>
    
</item>
<item>
    <title>2008 DC PHP Conference - Automated Unit Testing</title>
    <link>http://www.ds-o.com/archives/73-2008-DC-PHP-Conference-Automated-Unit-Testing.html</link>
            <category>PHP Testing</category>
    
    <comments>http://www.ds-o.com/archives/73-2008-DC-PHP-Conference-Automated-Unit-Testing.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=73</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=73</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;As promised here are my automated unit testing slides for the 2008 DC PHP conference.&lt;/p&gt;
&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_446614&quot;&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=automated-unit-testing-1212587126813053-9&quot;/&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slideshare.net/swf/ssplayer2.swf?doc=automated-unit-testing-1212587126813053-9&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=208&amp;amp;entry_id=73&quot; title=&quot;http://www.slideshare.net/?src=embed&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;&lt;img src=&quot;http://static.slideshare.net/swf/logo_embd.png&quot; style=&quot;border:0px none;margin-bottom:-5px&quot; alt=&quot;SlideShare&quot;/&gt;&lt;/a&gt; | &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=209&amp;amp;entry_id=73&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/mjlivelyjr/automated-unit-testing?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;View Automated Unit Testing on SlideShare&quot;&gt;View&lt;/a&gt; | &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=210&amp;amp;entry_id=73&quot; title=&quot;http://www.slideshare.net/upload?src=embed&quot;  onmouseover=&quot;window.status=&#039;http://www.slideshare.net/upload?src=embed&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Upload your own&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Wed, 04 Jun 2008 09:52:32 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/73-guid.html</guid>
    
</item>
<item>
    <title>DC PHP</title>
    <link>http://www.ds-o.com/archives/72-DC-PHP.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/72-DC-PHP.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=72</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=72</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;I will be flying out this weekend for my first speaking engagement at &lt;a title=&quot;The 2008 DC PHP Conference&quot; href=&quot;http://www.ds-o.com/exit.php?url_id=206&amp;amp;entry_id=72&quot;  onmouseover=&quot;window.status=&#039;http://www.dcphpconference.com/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;The 2008 DC PHP Conference&lt;/a&gt;. In looking at the speakers list there are a few familiar faces and quite a few new ones so it should be a fun experience all around. I will be giving &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=207&amp;amp;entry_id=72&quot; title=&quot;http://www.dcphpconference.com/node/87&quot;  onmouseover=&quot;window.status=&#039;http://www.dcphpconference.com/node/87&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;2.5 talks&lt;/a&gt; this year. One on Beginning PHPUnit Testing, another on Advanced PHPUnit Testing and then I will be giving a joint presentation Andrew Minerd, a co-worker of mine, on distributed CLI processes.&lt;/p&gt;&lt;p&gt;I am fairly excited as this is not only my first time speaking at a PHP conference but it is also the first time I have been to Washington DC. I have a profound respect for the early history of our country and I am looking forward to seeing the some of the landmarks honoring that history. In any case, if you are going to be in DC for the conference be sure to track me down, I shouldn&#039;t be too hard to find.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.ds-o.com/archives/72-DC-PHP.html#extended&quot;&gt;Continue reading &quot;DC PHP&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 29 May 2008 09:24:41 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/72-guid.html</guid>
    
</item>
<item>
    <title>Las Vegas PHP Group: It's Alive</title>
    <link>http://www.ds-o.com/archives/71-Las-Vegas-PHP-Group-Its-Alive.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/71-Las-Vegas-PHP-Group-Its-Alive.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=71</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=71</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;As promised, a couple of days ago the &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=204&amp;amp;entry_id=71&quot;  onmouseover=&quot;window.status=&#039;http://lvphp.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Las Vegas PHP User Group&quot;&gt;LV PHP User Group&lt;/a&gt; had its first meeting. The purpose of the meeting was to see what kind of interest there was and to gather some ideas for future meetings. We had a pretty good turnout for our first meeting. I think around 20 or so people attended and we mingled and talked amongst ourselves for around 2 hours.&lt;/p&gt;&lt;p&gt;We are going to be having another meeting in mid to late may. The current plan is that two of us will be doing a couple of short talks, I will be talking about testing and quality assurance. We also talked about getting involved in the&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=205&amp;amp;entry_id=71&quot; title=&quot;http://qa.php.net/testfest.php&quot;  onmouseover=&quot;window.status=&#039;http://qa.php.net/testfest.php&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt; PHP TestFest&lt;/a&gt; project. The last thing we decided is that the next meeting will be in a &#039;quieter&#039; environment. PT&#039;s Pub worked well for a meet and greet type of meeting but would be a tad loud for any kind of presenting. It also forcluded some people from attending due to the atmosphere.&lt;/p&gt;&lt;p&gt;When I hear more info about dates I will post it. For those of you that live nowhere near Vegas, maybe you can use us as a way to writeoff a vacation as a business expense? &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/laugh.png&quot; alt=&quot;:-D&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sat, 12 Apr 2008 09:57:06 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/71-guid.html</guid>
    
</item>
<item>
    <title>Las Vegas PHP User Group</title>
    <link>http://www.ds-o.com/archives/70-Las-Vegas-PHP-User-Group.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/70-Las-Vegas-PHP-User-Group.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=70</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=70</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;I am pleased to announce that Las Vegas finally has a &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=199&amp;amp;entry_id=70&quot;  onmouseover=&quot;window.status=&#039;http://lvphp.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Las Vegas PHP User&#039;s Group&quot;&gt;PHP User Group&lt;/a&gt; and our first meeting is...tomorrow. I am pretty excited as I know there is a fairly decent size PHP programmer community in LV, it just hasn&#039;t been organized yet. One of my co-workers Ray Lopez is organizing the group and it looks like we&#039;ll have a fairly decent size group at our first meeting. If you are from Las Vegas I would encourage you to attend if at all possible! If you are unable to attend then I would highly recommend you still sign up at &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=200&amp;amp;entry_id=70&quot;  onmouseover=&quot;window.status=&#039;http://php.meetup.com/422/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Las Vegas PHP Meetup&quot;&gt;meetup.com&lt;/a&gt; so you can keep informed of future meetings.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Time: 
Friday, Apr 11, 2008, 4:00 PM&lt;br /&gt;&lt;br /&gt;Place: &lt;a class=&quot;popVenue&quot; href=&quot;http://www.ds-o.com/exit.php?url_id=203&amp;amp;entry_id=70&quot; title=&quot;http://php.meetup.com/422/venue/?venueId=546845&amp;amp;eventId=7551002&quot;  onmouseover=&quot;window.status=&#039;http://php.meetup.com/422/venue/?venueId=546845&amp;amp;eventId=7551002&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;&lt;br /&gt;PT&#039;s PUB&lt;/a&gt;&lt;br /&gt;310 E. Warm Springs Rd.&lt;br /&gt;Las Vegas, NV 89119&lt;br /&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=202&amp;amp;entry_id=70&quot;  onmouseover=&quot;window.status=&#039;http://maps.yahoo.com/#mvt=m&amp;amp;lat=36.057116&amp;amp;lon=-115.15835&amp;amp;mag=3&amp;amp;q1=310%20E.%20Warm%20Springs%20Rd%2C%20Las%20Vegas%2C%20NV%2089119&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;PT&#039;s Pub&quot;&gt;Directions&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 10 Apr 2008 21:18:41 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/70-guid.html</guid>
    
</item>
<item>
    <title>Late Static Binding (LSB) forward_static_call()</title>
    <link>http://www.ds-o.com/archives/69-Late-Static-Binding-LSB-forward_static_call.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/69-Late-Static-Binding-LSB-forward_static_call.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=69</wfw:comment>

    <slash:comments>8</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=69</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;I finally freed up some time to finish some quick tests for some of the late static binding patches I made and one of them finally made it into head.&lt;/p&gt;&lt;p&gt;The original post I had bringing up this issue was lovingly title &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=190&amp;amp;entry_id=69&quot;  onmouseover=&quot;window.status=&#039;http://www.digitalsandwich.com/archives/65-Late-static-binding....sorta.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Late Static Binding Sorta&quot;&gt;Late Static Binding...Sorta&lt;/a&gt;. Basically the original patch alone did not provide a means to override a method, forward execution to the parent method and still preserve the ability for static:: to be anything meaningful. It would be turned into the syntactic equivelant of self::. I came up with a &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=191&amp;amp;entry_id=69&quot;  onmouseover=&quot;window.status=&#039;http://www.ds-o.com/archives/68-Late-Static-Binding-Changes-to-parent.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Late Static Binding - Changes to Parent&quot;&gt;few patches&lt;/a&gt; to address this. After several rounds of back and forth about the patches the conversation died out with no decision. I finally resurrected the topic and was able to find &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=192&amp;amp;entry_id=69&quot; title=&quot;http://news.php.net/php.internals/36208&quot;  onmouseover=&quot;window.status=&#039;http://news.php.net/php.internals/36208&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;concensus for the third patch (forward_static_call())&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;This weekend I wrapped up a few small tests and sent the patch in and it was subsequently &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=193&amp;amp;entry_id=69&quot; title=&quot;http://news.php.net/php.cvs/49508&quot;  onmouseover=&quot;window.status=&#039;http://news.php.net/php.cvs/49508&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;pushed to php 5.3 and php 6.0&lt;/a&gt;. Now, this is not at all the way I wanted things to work, in all honesty I think the patch is pretty hokey but unfortunately nobody really spoke up in support of the changes I wanted to make to parent:: in regards to LSB. So I thought it far more important to make sure there was a way to make sure static methods could be overridden while ensuring that access to parent methods would be unabated.&lt;/p&gt;&lt;p&gt;So now, if you want to override a static method and forward execution to the parent class, the safe way (in regards to static inheritance) is shown in Table2 while the (unfortunately) not so safe way is shown in Table1:&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ActiveRecord&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; funtion loadById&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;, PDO &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$table&lt;/span&gt; = get_called_class&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;prepare&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; SELECT * FROM {$table}&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; WHERE {$table}_id = ?&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;execute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$column_values&lt;/span&gt; = $&lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;fetch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;PDO::&lt;span style=&quot;color: #006600;&quot;&gt;FETCH_ASSOC&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$column_values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;column_values&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;fetch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;PDO::&lt;span style=&quot;color: #006600;&quot;&gt;FETCH_ASSOC&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Table1 extends ActiveRecord&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; loadById&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;, PDO &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * DANGER! the table name will resolve to ActiveRecord&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt; = parent::&lt;span style=&quot;color: #006600;&quot;&gt;loadById&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt; === &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Table2 extends ActiveRecord&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; loadById&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;, PDO &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * SAFE WAY! the table name will correctly resolve to Table2&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt; = forward_static_call&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;parent&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;loadById&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$id&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$ar&lt;/span&gt; === &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;This shows an example of the differences between using parent:: and forward_static_call. I really do wish that the behavior of parent:: would just be modified to work like forward_static_call does. It would be alot less awkward and imo closer to what the average oo programmer would expect. I suppose the issue is up for debate if anyone feels like bringing it up on internals, we aren&#039;t stuck with it until php 5.3 rolls &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. The &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=196&amp;amp;entry_id=69&quot;  onmouseover=&quot;window.status=&#039;http://ds-o.com/Patches/lsb.parent-forwarding.v2.php53.patch&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;LSB parent:: forwarding patch&quot;&gt;patch&lt;/a&gt; is even available it just needs some more vocal supporters.&lt;/p&gt;

&lt;p&gt;In either case at least there is a way around it now...&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 07 Apr 2008 20:19:27 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/69-guid.html</guid>
    
</item>
<item>
    <title>Late Static Binding - Changes to parent</title>
    <link>http://www.ds-o.com/archives/68-Late-Static-Binding-Changes-to-parent.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/68-Late-Static-Binding-Changes-to-parent.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=68</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=68</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;If you have been following the PHP internals list for the last few weeks you probably have seen a discussion concerning the current behaviour of late static binding (lsb) and how it seems to be unnecessarily limited when it comes to inheritance. I first posted about the limitations of the current lsb implementation as it relates to inheritance in &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=180&amp;amp;entry_id=68&quot;  onmouseover=&quot;window.status=&#039;http://www.digitalsandwich.com/archives/65-Late-static-binding....sorta.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Late Static Binding...Sorta&quot;&gt;Late Static Binding...Sorta&lt;/a&gt;. It has since been revived in this thread on the internals mailing list: &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=181&amp;amp;entry_id=68&quot;  onmouseover=&quot;window.status=&#039;http://marc.info/?l=php-internals&amp;amp;m=119538527824948&amp;amp;w=2&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;RE: [PHP-DEV] late static binding php6&quot;&gt;RE: [PHP-DEV] late static binding php6&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I won&#039;t rehash all of the arguments as you can quite easily find out my full thoughts by previous posts and on that mailing list thread. To put it simply I feel that somehow there needs to be a way to call methods in a parent class without losing the ability to reference back to the original called static.&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; A&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; get_called_class&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; B&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//do additional work ...&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; parent::&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B::&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//outputs B&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;This (or anything like it) is currently impossible in the current lsb implementation. I spent a bit of my extended weekend preparing three different patches to work around this problem. I just now sent them to the internals mailing list so they can be discussed. You can view this email and get a summary of the patches by viewing &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=184&amp;amp;entry_id=68&quot;  onmouseover=&quot;window.status=&#039;http://news.php.net/php.internals/33432&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;[Patch] late binding for parent (and other options)&quot;&gt;my recent php-dev posting&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=185&amp;amp;entry_id=68&quot; title=&quot;http://www.digitalsandwich.com/patches/lsb.parent-forwarding.patch&quot;  onmouseover=&quot;window.status=&#039;http://www.digitalsandwich.com/patches/lsb.parent-forwarding.patch&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;lsb.parent-forwarding.patch&lt;/a&gt; - Changing the behavior of parent.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=186&amp;amp;entry_id=68&quot; title=&quot;http://www.digitalsandwich.com/patches/lsb.new-keyword.patch&quot;  onmouseover=&quot;window.status=&#039;http://www.digitalsandwich.com/patches/lsb.new-keyword.patch&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;lsb.new-keyword.patch&lt;/a&gt; - Adding a new class keyword.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=187&amp;amp;entry_id=68&quot; title=&quot;http://www.digitalsandwich.com/patches/lsb.forward_static_call.patch&quot;  onmouseover=&quot;window.status=&#039;http://www.digitalsandwich.com/patches/lsb.forward_static_call.patch&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;lsb.forward_static_call.patch&lt;/a&gt; - Adding functions to do my dirty work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the above patches are against 5.3. I was having some strange problems with the test suite in php6 so I moved onto php5.3 so I could make sure things weren&#039;t breaking on me &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/tongue.png&quot; alt=&quot;:-P&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. If anyone reading this feels as strongly as I do that there should be a way to do this I hope to encourage you to make your thoughts known on PHP-Dev.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 26 Nov 2007 01:16:27 -0500</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/68-guid.html</guid>
    
</item>
<item>
    <title>ZendCon07 Day 1</title>
    <link>http://www.ds-o.com/archives/67-ZendCon07-Day-1.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/67-ZendCon07-Day-1.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=67</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=67</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;Day one of the conference is over and everything has gone well so far. I attended the extending PHP session by Wez, Sara, and Marcus. It was alot of review but it was very 

informative and brought up alot of things that I tend to forget frequently. It was also good to find out that Marcus has a pretty decent american impression. In either case I 

have a couple small php extension projects that I am thinking about starting now just to tinker around with some of what they talked about.&lt;/p&gt;

&lt;p&gt;I also heard some unconfirmed rumours that database testing was brought a fair amount in the Best Practices tutorial. So if any of you were in that tutorial and have any 

questions track me down.&lt;/p&gt;

&lt;p&gt;After the tutorials were finished all of us from the selling source decided to go into San Francisco for some food and what not. We went to the Stinking Rose which billed 

itself as a garlic resteraunt and it certaintly did not dissapoint. We hung around for a while to chit-chat and what not. It is my first time in San Francisco and it pretty much 

has further confirmed that I am definately not a city guy &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.&lt;/p&gt;



&lt;p&gt;Today&#039;s sessions are underway and thus far I have found myself working the entire time but I plan on stopping that after the current round of sessions is over. I am looking 

forward to going to Give Your Site A Boost With memcached from Ben Ramsey and High Performance PHP &amp;amp; MySQL Scaling Techniques by Eli White. We will also be spending some time 

today setting up the Selling Source booth. We are also sponsering the opening reception tonight in the exhibit hall which I don&#039;t really think means anything other than we&#039;ll 

have our logo plastered in a few key places which is always nice. Also we are giving away a fairly nifty prize at the end of the conference to a random winner of a little code challenge that we put together.&lt;/p&gt;

&lt;p&gt;If any of the fellow conference goers plan on going to the opening reception be sure to track me down and say hello. I think I am going to leave both my laptop and black 

berry so there will be no distractions. I would love to talk to y&#039;all about pretty much anything. &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/tongue.png&quot; alt=&quot;:-P&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 09 Oct 2007 14:02:53 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/67-guid.html</guid>
    
</item>
<item>
    <title>Going to ZendCon </title>
    <link>http://www.ds-o.com/archives/66-Going-to-ZendCon.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/66-Going-to-ZendCon.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=66</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=66</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;I will be leaving for ZendCon on Sunday. This will be my first zend con and I am really looking forward to going. I was hoping to speak at the conference about refactoring and database testing but alas it wasn&#039;t meant to be &lt;img src=&quot;http://www.ds-o.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. I figure it gives me more time to enjoy everyone else&#039;s talks and I can also meet the other attendees without the impending doom of everyone in a room paying attention to me.&lt;/p&gt;&lt;p&gt;I will be attending the conference with a sizable group of co-workers from &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=178&amp;amp;entry_id=66&quot; title=&quot;http://sellingsource.com&quot;  onmouseover=&quot;window.status=&#039;http://sellingsource.com&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;The Selling Source&lt;/a&gt; and will be spending some time in our booth in the exhibit hall. If any of you would like to discuss unit testing, late static binding, or what not please come track me down. I am very interested to talk with anyone that may have checked out the &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=179&amp;amp;entry_id=66&quot; title=&quot;http://phpunit.de&quot;  onmouseover=&quot;window.status=&#039;http://phpunit.de&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHPUnit&lt;/a&gt; Database extension. I have a small list of features that I am hoping to add shortly and would love to hear about any other features people may be looking for.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 04 Oct 2007 23:51:01 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/66-guid.html</guid>
    
</item>
<item>
    <title>Late static binding....sorta :/</title>
    <link>http://www.ds-o.com/archives/65-Late-static-binding....sorta.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/65-Late-static-binding....sorta.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=65</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=65</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    &lt;p&gt;The good news is late static binding has been introduced into head and looks like it will be merged into 5.3 before it is released. The horrible news is I really don&#039;t think the patch went as far as it needs to.&lt;/p&gt;

&lt;p&gt;If you look at the &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=175&amp;amp;entry_id=65&quot;  onmouseover=&quot;window.status=&#039;http://www.ds-o.com/archives/53-Late-Static-Binding-in-PHP.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Late Static Binding In PHP&quot;&gt;original posts&lt;/a&gt; that cropped up about a year and a half ago the whole purpose of late static binding was to allow the same kind of  flexibility provided by inheritance of standard class methods for static methods, properties, and constants. This wouldn&#039;t really open the door for any grandios, new kind of applications, it would just allow a new way to code libraries the most prominant example being an Active Record Library.&lt;/p&gt;

&lt;p&gt;This is now possible, however I think there is a very unfortunate limitation that I brought up a few times on the Internals mailing list to apparently no avail. The problem is with the fact that static will ALWAYS return the &#039;resolved&#039; name of the class used to call the current function. So, imagine the following method:&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Foo&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt;::&lt;span style=&quot;color: #0000ff;&quot;&gt;$some_property&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Bar extends Foo&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;If you call test using Foo::test() then static:: will resolve to the &#039;Foo&#039; class. If you call it using Bar::test() then static:: will resolve to &#039;Bar&#039;. This is correct and works well for simple inheritance. However things start taking a downward turn the more you use inheritance. Consider the following change to Bar and the addition of a new class Bar_Child:&lt;/p&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Foo&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt;::&lt;span style=&quot;color: #0000ff;&quot;&gt;$some_property&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//...&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Bar extends Foo&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; test&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Do some work specific to Bar&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; parent::&lt;span style=&quot;color: #006600;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Bar_Child extends Bar&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;Now, calling Foo::test() will again result in static:: being bound to &#039;Foo&#039;. However, due to the fact that parent:: will resolve to Foo:: that means the call Bar::test() will now result in static:: being bound to &#039;Foo&#039;. Bar_Child::test() will do exactly the same thing, static:: will again be bound to &#039;Foo&#039;. This is incredibly inflexible and in my opinion this is the exact problem that &#039;late static binding&#039; is SUPPOSED to fix.&lt;/p&gt;

&lt;p&gt;There are a couple of ways to fix this that I can think of right now, unfortunately nobody on list seems very motivated to explore any compromises. The two ways that come to mind immediately are either setting the behavior of parent:: such that it forwards the calling class through the next function call. So in the example above, calling Bar::test() will still result in calling Foo::test() however it will not &#039;reset&#039; the calling class so that static:: will still resolve to &#039;Bar::&#039;, likewise Bar_Child::test() will result in static:: being bound to &#039;Bar_Child&#039;.&lt;/p&gt;

&lt;p&gt;The second alternative is introducing another scope. I have no clue what this scope would be called, but it would basically implement the functionality I just described for parent:: above but would do it using a new keyword so parent:: could remain the same.&lt;/p&gt;

&lt;p&gt;Dmitry Stogov mentioned my first alternative on the list however he also included this functionality for the self:: scope which I could see causing some serious problems. In either case, I am thankful that the functionality has started to make its way in, but I can&#039;t help but think that myself and some other early proponents of the functionality are getting completely shafted.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 26 Sep 2007 22:08:31 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/65-guid.html</guid>
    
</item>
<item>
    <title>Adding Database Tests to Existing PHPUnit Test Cases</title>
    <link>http://www.ds-o.com/archives/64-Adding-Database-Tests-to-Existing-PHPUnit-Test-Cases.html</link>
            <category>PHP Testing</category>
    
    <comments>http://www.ds-o.com/archives/64-Adding-Database-Tests-to-Existing-PHPUnit-Test-Cases.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>8</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    

&lt;p&gt;When I was first creating the &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=170&amp;amp;entry_id=64&quot;  onmouseover=&quot;window.status=&#039;http://www.ds-o.com/archives/63-PHPUnit-Database-Extension-DBUnit-Port.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;PHPUnit Database Extensions (DBUnit Port)&quot;&gt;Database Extension&lt;/a&gt; for &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=171&amp;amp;entry_id=64&quot;  onmouseover=&quot;window.status=&#039;http://www.phpunit.de&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;PHPUnit&quot;&gt;PHPUnit&lt;/a&gt; I realized that there was a very high likelihood that several people would have tests that were already written that they would like to add additional database tests too. To accomplish this I actually wrote the &lt;b&gt;PHPUnit_Extensions_Database_DefaultTester&lt;/b&gt; class. In fact, if you were to look at the source of the database test case you will see that all of it&#039;s operations are actually forwarded to this class which does all of the work.&lt;/p&gt;

&lt;p&gt;Please continue reading to see how you can use composition to add database tests to your existing test cases.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.ds-o.com/archives/64-Adding-Database-Tests-to-Existing-PHPUnit-Test-Cases.html#extended&quot;&gt;Continue reading &quot;Adding Database Tests to Existing PHPUnit Test Cases&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 05 Sep 2007 00:00:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/64-guid.html</guid>
    
</item>
<item>
    <title>PHPUnit Database Extension (DBUnit Port)</title>
    <link>http://www.ds-o.com/archives/63-PHPUnit-Database-Extension-DBUnit-Port.html</link>
            <category>PHP Testing</category>
    
    <comments>http://www.ds-o.com/archives/63-PHPUnit-Database-Extension-DBUnit-Port.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>21</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;I have completed the initial feature set for the Database extension to &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=158&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://www.phpunit.de&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;PHPUnit&quot;&gt;PHPUnit&lt;/a&gt;. This is a essentially a port of &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=159&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://dbunit.sourceforge.net/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;DBUnit&quot;&gt;DBUnit&lt;/a&gt; to &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=160&amp;amp;entry_id=63&quot; title=&quot;http://www.php.net&quot;  onmouseover=&quot;window.status=&#039;http://www.php.net&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHP&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For those that may not have read any of my &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=161&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://www.ds-o.com/archives/62-PHPDBUnit-Testing-DB-interaction-with-PHPUnit.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;PHPDBUnit Testing DB interaction with PHPUnit&quot;&gt;previous postings&lt;/a&gt; on the subject the goal of this software is to extend the functionality of PHPUnit to allow using seed data to put a given database into a known state prior to executing each test. It also provides an easy mechanism to compare database contents with an expected dataset.&lt;/p&gt;&lt;p&gt;The database extension has recently been merged into the PHPUnit 3.2 branch and is scheduled to be released in that version. &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=162&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://sebastian-bergmann.de/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Sebastian Bergmann&quot;&gt;Sebastian Bergmann&lt;/a&gt; will be introducing the extension in his &lt;a title=&quot;Advanced Testing with PHPUnit&quot; href=&quot;http://www.ds-o.com/exit.php?url_id=163&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://works.phparch.com/c/schedule/talk/d2s5/0&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;Advanced Testing with PHPUnit&lt;/a&gt; talk at &lt;a title=&quot;PHP|Works 2007&quot; href=&quot;http://www.ds-o.com/exit.php?url_id=164&amp;amp;entry_id=63&quot;  onmouseover=&quot;window.status=&#039;http://works.phparch.com/c/p/index&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;PHP|Works 2007&lt;/a&gt; in Atlanta September 13 - 14. If you would like to tinker around with the database extension prior to it&#039;s release you can always download the latest copy of PHPUnit 3.2 from svn: svn://svn.phpunit.de/phpunit/phpunit/branches/3.2. The source can also be browsed at &lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=165&amp;amp;entry_id=63&quot; title=&quot;http://www.phpunit.de/browser/phpunit/branches/3.2/PHPUnit/Extensions/Database&quot;  onmouseover=&quot;window.status=&#039;http://www.phpunit.de/browser/phpunit/branches/3.2/PHPUnit/Extensions/Database&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;&gt;http://www.phpunit.de/browser/phpunit/branches/3.2/PHPUnit/Extensions/Database&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Please continue reading for an example of how you can now use PHPUnit to even more effectively test data-centric applications.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.ds-o.com/archives/63-PHPUnit-Database-Extension-DBUnit-Port.html#extended&quot;&gt;Continue reading &quot;PHPUnit Database Extension (DBUnit Port)&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 02 Sep 2007 15:55:16 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/63-guid.html</guid>
    
</item>
<item>
    <title>PHPDBUnit - Testing DB interaction with PHPUnit</title>
    <link>http://www.ds-o.com/archives/62-PHPDBUnit-Testing-DB-interaction-with-PHPUnit.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/62-PHPDBUnit-Testing-DB-interaction-with-PHPUnit.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=62</wfw:comment>

    <slash:comments>10</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=62</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;It&#039;s been a while since I have put anything in the heavily neglected little site of mine so I thought I would start posting some updates on a few little projects I have been working on. I have been spending a considerable amount of time traveling for work so I am not quite as far along in these projects as I would like to be, but I have been making some major head way.&lt;/p&gt;&lt;p&gt;The project I would like to talk about right now is a port of Java&#039;s DBUnit for php that will compliment the PHPUnit test suite. For those of you not familiar with DBUnit, it is a framework that allows you to easily and quickly test php code that modifies and works with database data. The whole idea behind unit testing is testing functions using well defined input and then comparing the output of that function with the values that you expect the function to produce. With database code this is somewhat difficult because you have to ensure that your database is in a known state prior to running your tests. Currenty, in order to do this properly you would find yourself adding significant amounts of code to your test to simply enter data into your database and then you will add even more code to compare the resulting database values with what your expected output. Ending up with something like this:&lt;/p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;pdo = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; PDO&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;SOME_PDO_DSN&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;pdo&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;exec&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;TRUNCATE test_table&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;pdo&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;exec&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;INSERT INTO test_table (test_table_id, col1, col2, col3) VALUES (1, &#039;value1&#039;, &#039;value2&#039;, &#039;value3&#039;),(2, &#039;value4&#039;, &#039;value5&#039;, &#039;value6&#039;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;test_class&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Foo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;pdo&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; tearDown&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;pdo&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; testDeleteByCol1&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;test_class&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;deleteByCol1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;value1&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;pdo&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;SELECT * FROM test_table&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$rows&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$statement&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;fetchAll&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;PDO::&lt;span style=&quot;color: #006600;&quot;&gt;FETCH_NUM&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;assertEquals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;value4&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;value5&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;value6&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$rows&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;p&gt;This is a fairly simple example and they really only get more complicated from this point forward. In order to the equivelant test using PHPDBUnit you would create a test class as follows:&lt;/p&gt;&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;test_class = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Foo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getConnection&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; parent::&lt;span style=&quot;color: #006600;&quot;&gt;setUp&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** Must be defined in all dbunit tests **/&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getDataSet&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; PHPDBUnit_DataSet_FlatXML&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;_data/dataset.xml&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * This is just an arbitrary function that is getting &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * a database connection...this could be implemented anyway &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * you see fit. &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getConnection&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * I don&#039;t necessarily advocate this method of getting a &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * connection. This part of DBUnit has just not been &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; * implemented fully yet.&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; */&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$GLOBALS&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;phpdbunit_connection&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; testDeleteByCol1&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;test_class&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;deleteByCol1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;value1&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;assertDataSetEquals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; PHPDBUnit_DataSet_FlatXML&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;_data/expected.xml&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getConnection&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getDataSet&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;p&gt;You will also have to provide two xml files for the above code. This first xml file (dataset.xml) is used to seed the database before every test. The second xml file (expected.xml) is used to compare your database after the test is ran. These two files allow to get the code seeding your database out of your test cases and into their own xml files. There are also other options for generating data sets, I will discuss these options as well as the xml formats for datasets in a future post.&lt;/p&gt;&lt;p&gt;The database connection functionality is built overtop of PDO and support is planned for all standard pdo drivers. The big question mark for me right now is the ODBC driver. The PDO connection is wrapped by a PHPDBUnit_Database class that provides the functionality to generate datasets from the database to test your data and ensure it is correct.&lt;/p&gt;&lt;p&gt;The seeding is controlled by two functions that I did not choose to override in my example: getSetUpOperation() and getTearDownOperation(). These functions simply return a database &#039;operation&#039; that is to be performed on the database connection using the data set returned by getDataSet. The default setUp operation is a clean insert. This is a truncate operation immediately followed by an insert of all data in the dataset. The default tear down operation is a null operation. You have several built-in possibilities for these operations such as Truncate, refresh, and update. You can also create your own operations if necesary.&lt;/p&gt;&lt;p&gt;My plan is to keep the interface of PHPDBUnit as close as possible to DBUnit while maintaining a more phpish way of doing things. I am planning on the first beta release of PHPDBUnit in July. Of course I welcome feedback on any features you would like to see. In the coming days and weeks I will continue to post more information and examples of how to use DBUnit in your tests.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 21 Jun 2007 01:02:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/62-guid.html</guid>
    
</item>
<item>
    <title>81.4 is evil</title>
    <link>http://www.ds-o.com/archives/61-81.4-is-evil.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/61-81.4-is-evil.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=61</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=61</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
&lt;p&gt;I know many of you all know pretty well that floating point precision and computers don&#039;t play nicely with each other. I think I learned about it in the first book on &#039;C&#039; I ever read, but I had never really been bitten by it until today. I was working with a piece of code today at the office that was throwing an error saying two values weren&#039;t zeroing out when they clearly should have been. I narrowed down the problem and after a bit of time decided that 81.4 is a terrible, terrible number. For example:&lt;/p&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$total&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;81&lt;/span&gt;.&lt;span style=&quot;color: #cc66cc;&quot;&gt;4&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//$total should be 18.6&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;18.6 == {$total}? &quot;&lt;/span&gt; .&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$total&lt;/span&gt; == &lt;span style=&quot;color: #cc66cc;&quot;&gt;18&lt;/span&gt;.&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt; ? &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;yes&#039;&lt;/span&gt; : &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;no&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; .&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;;&lt;br /&gt;&lt;a href=&quot;http://www.php.net/var_dump&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;var_dump&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;18&lt;/span&gt;.&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt; - &lt;span style=&quot;color: #0000ff;&quot;&gt;$total&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;p&gt;So, let that be a lesson to us all. No matter how simple the calculation, don&#039;t blindly trust floats.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 02 Jan 2007 22:52:29 -0500</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/61-guid.html</guid>
    
</item>
<item>
    <title>Come Work With Me!</title>
    <link>http://www.ds-o.com/archives/60-Come-Work-With-Me!.html</link>
            <category>PHP</category>
    
    <comments>http://www.ds-o.com/archives/60-Come-Work-With-Me!.html#comments</comments>
    <wfw:comment>http://www.ds-o.com/wfwcomment.php?cid=60</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.ds-o.com/rss.php?version=2.0&amp;type=comments&amp;cid=60</wfw:commentRss>
    

    <author>nospam@example.com (Mike Lively)</author>
    <content:encoded>
    
I have recently been very encouraged by the number of job opportunities available to PHP developers lately. In light of this I thought I would make everyone aware of yet another excellent opportunity for a highly motivated, well-versed PHP programmer. The company I recently started working for (&lt;a href=&quot;http://www.ds-o.com/exit.php?url_id=152&amp;amp;entry_id=60&quot;  onmouseover=&quot;window.status=&#039;http://sellingsource.com&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; target=&quot;_blank&quot; title=&quot;The Selling Source&quot;&gt;The Selling Source&lt;/a&gt;) is still hiring PHP Developers. I can say without a doubt that it&#039;s a great company to work for and they take very good care of their programmers. Read on for details.&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;http://www.ds-o.com/archives/60-Come-Work-With-Me!.html#extended&quot;&gt;Continue reading &quot;Come Work With Me!&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 27 Oct 2006 15:02:18 -0400</pubDate>
    <guid isPermaLink="false">http://www.ds-o.com/archives/60-guid.html</guid>
    
</item>

</channel>
</rss>