How can I tell the difference between a variable whose value is null and
a variable which is not set?
// cannot use === null:
ket% php -r '$null = null; var_dump(null === $null);'
bool(true)
ket% php -r 'var_dump(null === $unset);'
bool(true)
ket%
// - cannot use isset() either:
k
How do I get the file where a class is defined, from an instance of that
class?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> this does beg the question why don't you know the classname at runtime..
> seems to be a slight design flaw and may make sense for you to post the
> full problem (you must have chosen to implement this for a reason..)
The full problem is: I started off with a "DeployTask" for deploying a
new i
How do I access a static variable when I do not know the name of the
class until runtime?
I have the following example PHP:
ket% cat test.php
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I am trying to load PHP objects stored in a database, where the class
name is stored in a column:
$object = new $resultSet->getString(1);
This fails for the same reason that the following fails:
className();
Fatal error: Class name must be a valid object or a string in test.php
on line 12
I gu
How can I implement in PHP, a script which redirects stdout to stderr,
such that echo, etc. print to stderr instead of stdout?
I can redirect stdout to stderr when invoking PHP like so:
php script-name >&2
However I want to perform this redirection within the script itself.
The solution I curre
I'm trying to pull all the components out of strings structured like:
word followed by any number of ( dot word or square bracketed string )
This is an example: foo.bar[ab.cd].baz
>From the above example, I want: array('foo', 'bar', 'ab.cd', 'baz');
A regular expression to match these strings, i
7 matches
Mail list logo