Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
<?php
class Main {
var $db;
function __construct() {
$this->db = new Db();
$this->db->get_where()->num_rows();
}
}
class Db {
function get_where () {
return $this; // Returns the current Db object
}
function num_rows () {
echo 'Hello, World.';
}
}
new Main();
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 12:36 pm, edited 1 time in total.
McInfo wrote:
The extra parentheses should not be used in that statement.
OK. I tried it without the parentheses and it worked. Imagine that! It made logical sense that I would need them you know? As an example of my thinking.
So like for "$result" (and I know you know this), I wanted the result of the sum operation before multiplying by 2. It was my assumption (and I think a logical one) that I would need to write the expression in the same way. Remove the parentheses and the result is different of course.
But oh well. I was just having one of those "wouldn't it be nice if" moments so I decided to post it. I'm glad I did.