I have a class that looks like this:
utils/Result.php
<?php
class Result
{
public static function ok()
{
echo "OK";
}
}
If I create the following script
./sandbox.php
<?php
require_once("utils/Result.php");
print_r(Result::ok());
And run it with php sandbox.php
it works fine. But if I do the following: cd test && php ../sandbox.php
it gives me the following error
PHP Fatal error: Call to undefined method Result::ok() in /mnt/hgfs/leapback/sandbox.php on line 5
Now, realize that the require statement seems to be working. If I add a property to the Result class, and use print_r on an instance of it, it looks right. But the static methods disappear. I'm very confused. I'm running php 5.2.6.