News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Joseph Scott's Blog:
Why PHP Strings Equal Zero
March 15, 2012 @ 09:47:49

Joseph Scott has a new post to his blog looking at "why PHP strings equal zero" - that when you use the "==" operator on a string to compare to zero, it's true.

The issue of PHP strings equaling zero has come up a few times recently. [...] Running that will display Equals zero!, which at first glance probably doesn't make much sense. So what is going on here?

He gets into the specifics of what's happening - a bit of type jugging, less strict comparison since it's the "==" versus "===" and how the PHP manual talks about strings being converted to numbers.

While I still think it is odd that the string gets cast as an integer instead of the other way around, I don't think this is a big deal. I can't recall a single time where I've ever run into this issue in a PHP app. I've only seen it come up in contrived examples like the ones above.
0 comments voice your opinion now!
string equal zero type juggling conversion


Ant Phillips' Blog:
Singletons, BIRT, Theads and PHP
February 18, 2009 @ 12:55:47

In doing some work with Zero (PHP in Java) and the Eclipse Business Intelligence and Reporting Tools project, Ant Phillips had some troubles with multithreaded PHP processes and wanting them all to use the same BIRT instance insted of spawning their own.

The problem is that BIRT needs to be started once, and only once, in any given process. Once it has been started up, then it is plain sailing to load reports and render them to HTML. The BIRT runtime should be kept around until the process shuts down.

Two problems came up with this approach - if each PHP process makes its own BIRT process any settings/current data will be wiped out and the BIRT instance would go away whenever the PHP script finishes. He found something that solves both of these problems - the Zero Global Context. Its a "storage area" that can contain just about anything. He used it to store the BIRT runtime until its told to finish and die off.

1 comment voice your opinion now!
birt java zero multithread singleton process global context


An Phillips' Blog:
COM/.NET Interop in Zero PHP
January 29, 2009 @ 15:03:25

Ant Phillips looks a bit at some interoperability between the PHP and Project Zero when to comes to using the COM/.NET extension.

Zero doesn't currently support the COM/.NET extension in PHP. No matter though, there is a handy open source project called JACOB that bridges between Java and COM/.NET. In fact, there is an easier way to do this using a Groovy library called Scriptom. This is really just a friendly wrapper around JACOB to provide a better syntax for calling methods and accessing properties.

He also includes a quick introduction and howto on getting the functionality up and working in a Windows environment - download, add the JAR to your path, edit your php.ini and copy and paste some example code in to see it in action.

0 comments voice your opinion now!
com net interoperability zero extension jacob scriptom


Felix Geisendorfer's Blog:
False == 0, or not?
August 14, 2007 @ 08:45:00

Felix Geisendorfer has come across something interesting in his coding - an issue where false might not be false in the right situation.

So far I've always thought false would evaluate to 0 when used in a computational context. Turns out that this isn't always the case.

His code example tries to check is a false value is greater than or equal to a negative number. The result, however (despite the thinking that false is a zero value) turns out to be false.

I randomly stumbled upon this when arguing with Mariano today if setting Model::recursive to 'false' has the same effect as setting it to '-1'. Turns out that cake uses a statement like this: if ($recursive > -1) in the core which in turn makes -1 and false do exactly the same thing.
0 comments voice your opinion now!
false zero evaluate compare negative false zero evaluate compare negative


Mike Lively's Blog:
81.4 is evil
January 04, 2007 @ 08:39:00

On his blog, Mike Lively has a little reminder for developers out there about working with floating point numbers in your applications, specifically their accuracy.

I know many of you all know pretty well that floating point precision and computers don't play nicely with each other. [...] I was working with a piece of code today at the office that was throwing an error saying two values weren't zeroing out when they clearly should have been.

In his code he shows the simple bit that he was using to evaluate if the result of subtraction would come to a certain value. In the comments, others share similar experiences and one even recommends another option to make things a bit more accurate - the bcmath library.

0 comments voice your opinion now!
floating point accuracy zero value floating point accuracy zero value


Davey Shafik's Blog:
php|tek Days 0 & 1
April 26, 2006 @ 16:18:33

Davey Shafik has already gotten some of his experiences down in blog post form from the php|tek conference today, actually starting with the day previous in his Day 0 and Day 1 posts.

In the Day 0 post he just mentions arriving at the conference and getting things ready, but Day 1 sees him giving his "Future Deployment of PHP Applications" talk and his upcoming "Migration to PHP 5.1".

He also mentions videoing the presentation from today ("Deployment" talk) and is hoping to get a Flash video of the presentation up for all to see post-conference (a great idea for non-attendees).

0 comments voice your opinion now!
phptek conference blog days zero one talks video flash movie phptek conference blog days zero one talks video flash movie



Community Events





Don't see your event here?
Let us know!


library deployment introduction list tips release conference interview series podcast laravel opinion symfony developer zendserver bugfix community framework api language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework