News Feed
Sections




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

Anthony Ferrara:
The Anatomy Of Equals - Opcode Analysis
July 19, 2012 @ 10:11:48

Anthony Ferrara has a new post today getting into the details of how "equals" works in PHP at the opcode level. He focuses on the answer to a question he received:

I was asked an interesting question via email yesterday. The question is fairly simple. The answer, not so much... So, rather than reply in an email, I figured that I'd write a post about it instead. The question, simply stated, is: "When comparing a float to an integer using ==, where does the conversion happen?"

He starts with a super simple piece of test code that compares an integer (1) to a float (1.0) and walks through the process PHP takes to perform the comparison (with a double equals "=="). He talks about opcode handlers, the "fast equal function" and how it handles the casting from one type to another, C source highlights included.

0 comments voice your opinion now!
equals opcode source language cast variable


blog comments powered by Disqus

Similar Posts

Reddit.com: I'm interested in teaching others PHP. Is anyone interested?

Kore Nordmann's Blog: Installing cairo_wrapper on Gentoo

DZone.com: How to correctly work with PHP serialization

Padraic Brady: Zephir Language: Write PHP Extensions The Easy Way (Without C) Part 1: Introduction

William Candillon's Blog: PHP source code analysis: PHPCompiler versus Yaxx


Community Events

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


unittest library framework laravel api community introduction extension voicesoftheelephpant release podcast development laravel5 threedevsandamaybe interview wordpress language feature opinion series

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